Front-end resource processing method and device

By determining and processing the front-end resources in type, the problem of low efficiency of front-end release and rollback is solved, and a more efficient resource management and release process is achieved.

CN120011672APending Publication Date: 2025-05-16ZHEJIANG DAHUA SMART IOT OPERATION SERVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510023523.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-06
Publication Date
2025-05-16

AI Technical Summary

Technical Problem

The front-end needs to upload static files during the release and rollback stages, resulting in low release efficiency.

Method used

By determining the type of front-end resources, including front-end static resources and dynamic resources, and processing them according to the type. The specific method includes uploading multimedia information to the static resource server during the front-end development stage, and dynamically generating a hypertext markup language when the application server receives an access request.

Benefits of technology

Improve the front-end release and rollback efficiency, reduce the stability dependence on the upload process, and avoid waste of time and bandwidth.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120011672A_ABST
    Figure CN120011672A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a front-end resource processing method and device, and the method comprises the steps: determining the types of front-end resources, the types of the front-end resources comprise front-end static resources and front-end dynamic resources, the types of the front-end static resources comprise multimedia information and a webpage development language, and the front-end dynamic resources comprise a hypertext markup language; and processing the front-end resources according to the types of the front-end resources. According to the method and the device, the problem that the front-end publishing efficiency is relatively low due to the fact that the front-end needs to upload the static file in the publishing and rollback stages in the prior art is solved, and the effects of improving the rollback and publishing efficiency of the front-end and seamlessly combining with other dynamic contents of the rear-end are achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the technical field of web page applications, and in particular, to a method and device for processing front-end resources. Background Art

[0002] At present, most web development adopts the front-end and back-end separation development method. The front-end developers only care about the static file deployment after the front-end is packaged, and the back-end developers only care about providing data port application deployment. The above method has the following problems: low efficiency of rollback and release: the front-end code needs to go through the static file upload process once, whether it is released or rolled back, which wastes time and bandwidth, and depends on the stability of each upload process.

[0003] There is currently no effective solution to the above problems. Summary of the invention

[0004] The embodiment of the present invention provides a method and device for processing front-end resources, so as to at least solve the problem in the related art that the front-end publishing efficiency is low because the front-end needs to upload static files in both the publishing and rollback stages.

[0005] According to one embodiment of the present invention, a method for processing front-end resources is provided, comprising: determining the type of front-end resources, wherein the type of front-end resources comprises: front-end static resources, front-end dynamic resources, the type of front-end static resources comprises multimedia information, web page development language, the type of front-end dynamic resources comprises hypertext markup language; processing the front-end resources according to the type of the front-end resources.

[0006] In an exemplary embodiment, the front-end resources are processed according to the type of the front-end resources, including: when the front-end resources are the multimedia information, uploading the multimedia information to the static resource server through the static resource management platform during the front-end development stage; when the type of the front-end resources is the web development language, determining the environment of the web development language, and processing the web development language according to the application environment of the web development language; when the front-end resource is the hypertext markup language, the hypertext markup language is dynamically generated by the application server when the application server receives an access request.

[0007] In an exemplary embodiment, the multimedia information is configured to apply an online publishing environment.

[0008] In an exemplary embodiment, the web page development language is processed according to the application environment of the web page development language, including: when the application environment of the web page development language is an online publishing environment, setting an online domain name for the web page development language, wherein the online domain name is set as a long-term valid cache and overwriting and publishing are not allowed; when the application environment of the web page development language is an offline testing environment, setting an offline domain name for the web page development language, wherein the offline domain name is set to no cache.

[0009] In an exemplary embodiment, the access path of the web page development language includes a version number.

[0010] In an exemplary embodiment, when the front-end resource is the hypertext markup language, the hypertext markup language is dynamically generated by the application server when the application server receives an access request, including: when the application server receives the access request, the application server obtains a version number from a configuration center, and obtains the static resource from the static resource server through the version number; the application server generates the hypertext markup language based on the static resource.

[0011] In an exemplary embodiment, the web page development language includes: a scripting language js and a cascading style sheet CSS for web page development.

[0012] According to another embodiment of the present invention, a front-end resource processing device is provided, including: a determination module, used to determine the type of the front-end resource, wherein the type of the front-end resource includes: front-end static resources, front-end dynamic resources, the types of the front-end static resources include multimedia information, web page development language, and the types of the front-end dynamic resources include hypertext markup language; a processing module, used to process the front-end resource according to the type of the front-end resource.

[0013] According to yet another embodiment of the present invention, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, wherein the computer program implements the steps of any of the above methods when executed by a processor.

[0014] According to yet another embodiment of the present invention, there is provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0015] According to yet another embodiment of the present invention, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the steps of any of the above methods are implemented.

[0016] According to yet another embodiment of the present invention, a computer program product is provided, comprising computer instructions, wherein when the computer instructions are executed by a processor, the steps of any of the above methods are implemented.

[0017] Through the present invention, the types of front-end resources are determined, wherein the types of front-end resources include: front-end static resources and front-end dynamic resources, the types of front-end static resources include multimedia information and web page development languages, and the types of front-end dynamic resources include hypertext markup languages; according to the types of front-end resources, the front-end resources are processed. Therefore, the problem of low front-end publishing efficiency caused by the need to upload static files in the publishing and rollback stages in the related technology can be solved, and the effect of improving the front-end rollback and publishing efficiency can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 It is a hardware structure block diagram of a mobile terminal of a front-end resource processing method according to an embodiment of the present invention;

[0019] Figure 2 is a flowchart of a method for processing front-end resources according to an embodiment of the present invention;

[0020] Figure 3 It is a front-end publishing flow chart with separation of front-end and back-end;

[0021] Figure 4 It is a schematic diagram of uploading the static file package to the specified directory of the server;

[0022] Figure 5 It is a front-end code rollback flowchart with front-end and back-end separation;

[0023] Figure 6 is a consumption sequence diagram of static resources according to an embodiment of the present invention;

[0024] Figure 7 is a schematic diagram of multimedia information management according to an embodiment of the present invention;

[0025] Figure 8 is a schematic diagram of CDN access rules for static resources according to an embodiment of the present invention;

[0026] Fig. 9 is a front-end publishing flow chart according to an embodiment of the present invention;

[0027] Fig.10 is a timing diagram of SSR rendering according to an embodiment of the present invention;

[0028] Fig.11 It is a structural block diagram of a front-end resource processing device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0029] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings and in combination with the embodiments.

[0030] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0031] The front-end resource processing method provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 FIG. 1 is a hardware structure block diagram of a mobile terminal of a method for processing front-end resources according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0032] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for processing front-end resources in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the mobile terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.

[0033] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0034] In this embodiment, a method for processing front-end resources running on the above mobile terminal or network architecture is provided. Figure 2 is a flowchart of a method for processing front-end resources according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:

[0035] Step S202, determining the type of the front-end resource, wherein the type of the front-end resource includes: front-end static resource and front-end dynamic resource, the type of the front-end static resource includes multimedia information and web page development language, and the type of the front-end dynamic resource includes hypertext markup language;

[0036] The above-mentioned front-end resources include front-end static resources and front-end dynamic resources, the above-mentioned multimedia information can be pictures, audio, video, etc., and the above-mentioned web page development language includes: scripting language js for web page development and cascading style sheets CSS.

[0037] Step S204: Process the front-end resources according to the types of the front-end resources.

[0038] As an optional implementation manner, when the front-end resource is the multimedia information, the multimedia information is uploaded to the static resource server through the static resource management platform during the front-end development stage.

[0039] Specifically, the above multimedia information is set to apply an online publishing environment.

[0040] For example, pictures, audio, video and other multimedia information are uploaded to CDN through the static resource management platform during the development phase to obtain an absolute access address (such as: https: / / img.abc.com / xxx.jpg). The above multimedia information is only available in the online environment and is not allowed to be overwritten in principle, but it can be overwritten for those with less impact on the business. When overwriting, please note that the CDN cache must be refreshed. This type of multimedia information content is updated by re-uploading to obtain a new access address and then updating the relevant code.

[0041] As an optional implementation manner, when the type of the front-end resource is a web page development language, the environment of the web page development language is determined, and the web page development language is processed according to the application environment of the web page development language.

[0042] Specifically, when the application environment of the web page development language is an online publishing environment, an online domain name is set for the web page development language, wherein the online domain name is set as a long-term valid cache, and overwriting and publishing are not allowed; when the application environment of the web page development language is an offline testing environment, an offline domain name is set for the web page development language, wherein the offline domain name is set as no cache.

[0043] Specifically, the access path of the web page development language includes a version number.

[0044] For example, web development languages ​​such as js and css distinguish between offline and online environments and can have two domain names, such as the offline domain name: static-dev.abc.com, and the online domain name: static.abc.com. The offline domain name is set to no cache, and the online domain name is set to a long-term cache, and overwriting and publishing are not allowed. The access path of such resources is not hash-coded, such as https: / / static.abc.com / app1 / asserts / js / index.wi8s87.js, but is distinguished by version number, such as: https: / / static.abc.com / app1 / 1.0.2 / asserts / js / index.js, so that the access path is more semantic.

[0045] As an optional implementation manner, when the front-end resource is the hypertext markup language, the hypertext markup language is dynamically generated by the application server when the application server receives an access request.

[0046] Specifically, when the application server receives the access request, the application server obtains a version number from a configuration center, and obtains the static resource from the static resource server through the version number; the application server generates the hypertext markup language based on the static resource.

[0047] For example, the page HTML is not a static resource. Each time a user visits it, the application server returns it dynamically, and obtains the static resource file address of the configuration center in real time. Web applications introduce view engines, such as veloctiy in the Java framework (a Java-based template engine used to render web pages), to dynamically render and generate page HTML. The page HTML content update needs to be released together with the back-end application, but because the frequency of changes is not high, except for the first release, it needs to wait for the back-end, but the subsequent product function iteration can still be developed and released separately in the front-end and back-end mode, which has very little impact on the development model.

[0048] Optionally, the executor of the above steps may be a background processor, or other devices with similar processing capabilities, or a machine that integrates at least an image acquisition device and a data processing device, wherein the image acquisition device may include a graphics acquisition module such as a camera, and the data processing device may include a computer, a mobile phone or other terminal, but is not limited thereto.

[0049] Figure 3 It is a front-end publishing flow chart with separation of front-end and back-end, such as Figure 3 As shown, the process includes:

[0050] Step 1: Local code submission;

[0051] Step 2: The publishing platform packages the latest code into a static file package, which is usually named after the release time. The publishing platform will save the packaged file at that time. If there is no unified publishing platform, historical versions can only be manually backed up elsewhere;

[0052] Step 3: Upload the static file package to the specified directory of the server through the upload tool or method. Figure 4 It is a schematic diagram of uploading the static file package to the specified directory of the server.

[0053] When a problem occurs in the online code, the front end needs to be rolled back. Figure 5 This is a flow chart of front-end code rollback with front-end and back-end separation, such as Figure 5 As shown, the process includes:

[0054] Step 1: Find the version to be rolled back on the publishing platform;

[0055] Step 2: Upload the static file package to the specified directory of the server through the upload tool or method.

[0056] The rollback and release efficiency of the front-end code separated from the front-end and back-end is not high: the front-end code needs to go through the static file upload process once whether it is released or rolled back, which wastes time and bandwidth, and depends on the stability of each upload process.

[0057] The embodiment of the present invention is based on existing products and tools, and is used with specific specifications to improve publishing efficiency and stability. The specific specifications are executed in accordance with a static resource management platform.

[0058] The embodiment of the present invention is divided into two parts. One part is the production of static resources: how static resources are published to the CDN server, including the release of new code functions and code rollback. The second part is the consumption of static resources: how to ensure that the correct static resource address is obtained in different environments.

[0059] The present invention involves 4 functional modules:

[0060] 1. Web application server;

[0061] 2. Web application configuration center, such as nacos (an open source service discovery, configuration management and service management platform);

[0062] 3.CDN;

[0063] 4.Static resource management platform.

[0064] The static resource management platform is a tool platform built by this embodiment, and the others are functions and tools already available in existing applications.

[0065] Figure 6 is a consumption sequence diagram of static resources according to an embodiment of the present invention, such as Figure 6 As shown, the process includes the following steps:

[0066] S601.1, user accesses a web page;

[0067] S601.2, the web page sends the home page route to the business application;

[0068] S601.3, the business application searches the configuration center for static resource configuration content;

[0069] S601.4, the configuration center returns the version number to the business application;

[0070] S601.5, the business application dynamically generates the page HTML and returns it to the web gateway;

[0071] S601.6, the web gateway returns the HTML to the user, and the user obtains the page HTML;

[0072] S602, the browser parses the page HTML;

[0073] S603.1, the user requests css, js, and images (img) from the static resource server;

[0074] S603,2, the static resource server returns css, js, and img to the user;

[0075] S604, the browser renders the page html;

[0076] S605.1, the user obtains dynamic business data from the business application through an asynchronous interface;

[0077] S605.2, the user obtains dynamic business data for page display.

[0078] like Figure 6 The page HTML does not belong to static resources. Every time a user visits, the web application obtains the normal static resource file address, such as js and css address, from the configuration center in real time, and dynamically splices the correct HTML content and returns it to the user's browser. The browser requests the static resources js, css, img, etc. required for the page from the CDN based on the content of the page HTML.

[0079] The configuration center distinguishes between development environment, test environment, pre-release environment, and online environment, which correspond to the server environment of the web application one by one; however, the CDN server only distinguishes between two environments: offline and online. The offline environment corresponds to the development environment and the test environment, and the online environment corresponds to the pre-release environment and the online environment. In the front-end and back-end separate development mode, the back-end online environment is used to coordinate the front-end development environment through the proxy tool.

[0080] To ensure page response performance, the application server needs to cache the content of the configuration center locally and subscribe to content updates. In this way, the page response speed is not much different from the speed of returning static HTML through ngnix (high-performance http and reverse proxy server). The development environment test conclusion is within 5ms.

[0081] In order to ensure that the browser or CDN node static resource cache will not be affected by errors during code development, release and rollback, the embodiments of the present invention perform different processing methods according to the type of static resources:

[0082] 1. Multimedia information types such as pictures, audio, and video are uploaded to CDN through the static resource management platform during the development phase, and the absolute access address (such as: https: / / img.abc.com / xxx.jpg) is obtained, which is hard-coded in the code. Such resources have only one environment, which is the online environment, and in principle, overwriting is not allowed. Overwriting can be done for those with less impact on the business. When overwriting, please note that the CDN cache must be refreshed. This type of multimedia information content is updated by re-uploading to obtain a new access address, and then updating the relevant code.

[0083] 2.js and css static resources are distinguished between offline and online environments, with two domain names, such as the offline domain name: static-dev.abc.com, and the online domain name: static.abc.com. The offline domain name is set to no cache, and the online domain name is set to a long-term cache, and overwriting and publishing are not allowed. The access path of such resources is not distinguished by hash encoding, but by version number, such as: https: / / static.abc.com / app1 / 1.0.2 / asserts / js / index.js, so that the access path is more semantic.

[0084] 3. The page HTML is not a static resource. Each time a user visits, the application server returns the static resource file address in real time to the configuration center. Web applications introduce view engines, such as veloctiy in the Java framework, to dynamically render and generate page HTML. The page HTML content update needs to be released together with the back-end application, but because the frequency of changes is not high, except for the first release, it needs to wait for the back-end, but the subsequent product function iteration can still be developed and released separately in the front-end and back-end mode, which has little impact on the development model.

[0085] Each application creates a configuration file according to different environments. The file content only contains the access addresses of js and css required by the page html.

[0086] like:{

[0087] css:"https: / / static.abc.com / app1 / 1.0.2 / asserts / js / index.csss",

[0088] js:https: / / static.abc.com / app1 / 1.0.2 / asserts / js / index.js

[0089] }

[0090] Because the access paths of resources such as js and css of each application have fixed rules, and the content and version number change each time they are released, the content of the configuration center can be further simplified into version numbers, such as: 1.0.3. The updated entry and release records of the configuration content are uniformly managed on the static resource management platform.

[0091] Uploading static resources on the CDN server requires a specific account and permissions. By building a static resource management platform to connect the CDN server, it is convenient for developers to use.

[0092] 1. Multimedia information management

[0093] Create convenient entrances for images, audio, and video in the management platform, and return absolute paths for developers to use. Figure 7 2 is a schematic diagram of multimedia information management according to an embodiment of the present invention.

[0094] 2. Web development language (js, css) file management

[0095] js and css need to be built through front-end engineering, packaged into static resource packages, and uploaded to the CDN specified directory.

[0096] In general, front-end publishing tools obtain the application name and version number of the static resources published from the package.json file in the front-end project, or strongly associate them with the publishing branch name, which are strongly associated with the git code tool. The present invention defines static resource CDN access rules. Figure 8 Schematic diagram of CDN access rules for static resources according to an embodiment of the present invention. Figure 8 As shown, the above static resource CDN access rules include CDN domain name, application name, version number, front-end built files and other contents.

[0097] Fig. 9 is a front-end publishing flow chart according to an embodiment of the present invention, such as Fig. 9 As shown, the process includes the following steps:

[0098] S901, search for front-end applications;

[0099] S902, determine whether the front-end application exists, if not, jump to S903, if yes, jump to S905;

[0100] S903, creating a web front-end application;

[0101] Specifically, a front-end application name is created on the platform, the application name is associated with a specific project address, and the front-end application name within the platform cannot be repeated.

[0102] S904, set the application name, associate the code repository address, and jump to S905;

[0103] S905, create a release plan;

[0104] Specifically, a release plan is created in the platform, corresponding to each functional iteration. To prevent duplication of version numbers, the platform will automatically generate version numbers. The version number rule is in the form of xyz, and the automatically generated version number is z + 1 each time. Of course, you can set the version number yourself, but the platform will do a duplication check. Each time you release, a static resource package is generated through cloud build. Note that only js and css are selected here to be published to the CDN server.

[0105] S906, automatically generate a version number;

[0106] S907, determine whether it is a daily release; if so, jump to S908, if not, jump to S912;

[0107] S908, front-end engineering cloud construction;

[0108] S909, get the js and css files in the dist directory;

[0109] S910, publishing to the CDN server;

[0110] S911, update the version number of the configuration center in the test environment and conduct testing; according to the test vulnerabilities, perform multiple daily releases and jump to S908;

[0111] Specifically, update the version number of the configuration center in the test environment, conduct testing and fix vulnerabilities. After the test passes, you can apply for formal release, and you need to submit a code review before formal release.

[0112] S912, determine whether the daily test is passed; if so, jump to S913, if not, jump to S914;

[0113] S913, obtaining resources of the daily environment according to the application name and version number, and jumping to S915;

[0114] S914, fix the problem and pass the test directly, jump to S908;

[0115] S915, determine whether the acquisition is normal, if not, jump to S916, if yes, jump to S917;

[0116] S916: Daily release fails, and the daily release process is repeated, jumping to S907;

[0117] S917, determine whether the branch code review (Code Review, referred to as CR) is passed, if not, jump to S917, if yes, jump to S918;

[0118] S917, awaiting code review;

[0119] Specifically, after the code review is passed, the js and css files in the daily environment are searched according to the application name and version number. If the corresponding file is not found, it means that there is a problem in the daily release process and it needs to be re-released.

[0120] S918, determine whether the same content already exists in the formal environment; if so, jump to S919, if not, jump to S920;

[0121] Specifically, the file path is obtained based on the daily environment, and a search is conducted in the online CDN environment to determine whether the same content exists. If so, overwriting and publishing is not allowed, and the developer is required to upgrade the version number and start the publishing process from the beginning.

[0122] S919, upgrade the version number, re-follow the release process, and jump to S905;

[0123] S920, copy the daily published content to the formal environment;

[0124] Specifically, copy the content of the daily environment to the online environment. There is no need to repackage and build it here to prevent changes in the packaged js and css content due to inconsistent build environments, which may affect the correctness of the test results.

[0125] S921: Update the configuration center version number of the pre-release environment and perform pre-release testing.

[0126] Specifically, update the version number of the configuration center of the pre-release environment and perform pre-release testing. If there is a problem with the pre-release test, you need to roll back the version number configuration.

[0127] S922, determine whether the pre-launch test is passed, if not, jump to S923, if yes, jump to S924;

[0128] S923: The pre-release environment configuration center rolls back, restarts the release process, and jumps to S905;

[0129] S924, update the configuration center content of the formal environment for online regression testing;

[0130] Specifically, update the version number of the configuration center of the online environment and perform online testing. If there is a problem with the online test, you need to roll back the version number configuration.

[0131] S925, judging whether the online regression is passed, if so, jumping to S926, if not, jumping to S927;

[0132] S926, the official release is over;

[0133] Specifically, if there are no problems with the online test, the entire release process is completed.

[0134] S927: Roll back the content of the online configuration center, restart the publishing process, and jump to S905.

[0135] When a problem occurs in the online environment and the front-end code needs to be rolled back, you only need to do the following to quickly roll back:

[0136] 1. Find the resource version number 1.0.9 to be rolled back on the static resource management platform;

[0137] 2. Update the version number content of the application's static resources in the configuration center of the online environment.

[0138] Through the above steps, the problem of low front-end publishing efficiency caused by the need to upload static files in both the publishing and rollback stages in the related technology is solved, and the efficiency of front-end rollback and publishing is improved.

[0139] The embodiments of the present invention have the following advantages:

[0140] 1. Make full use of the advantages of CDN static resource caching, and avoid product function errors due to cache problems on the user side or CDN node. Summary of technical implementation method: By managing and controlling the main page document html and the static resources (js, css, img) used on the page separately, the static resource management platform is used to ensure that the online environment prohibits the overwriting and release of images, js, and css.

[0141] 2. Improved stability of release and rollback processes. The release process of the front-end project is redesigned and implemented through a static resource management platform. The front-end application release resource path is completely decoupled from the code. Online release is to copy the resources of the daily environment to the online environment. The formal release no longer requires packaging of the front-end project, reducing various problems caused by human factors and environmental instability.

[0142] 3. Simplify the rollback process. Technical implementation summary: The static resource platform ensures that the published content is accessible. When rolling back, there is no need to rebuild or re-upload the static resources to be rolled back. You only need to update the version number of the online environment configuration center.

[0143] 4. Simplify the content of the configuration center, only set the version number of static resources, and only be responsible for the consumption link to reduce the cost of getting started for newcomers.

[0144] 5. Perfectly compatible with high-performance optimization methods such as server-side rendering (SSR): The page HTML application gateway obtains the static resource address and the latest content in real time through a configuration center. The page gateway can also obtain other dynamic data and process the SSR rendering logic at the same time. Fig.10 This is a timing diagram of SSR rendering according to an embodiment of the present invention. It can be seamlessly combined with the back-end SSR and dynamic data (such as thousands of faces for thousands of people) synchronous output.

[0145] In this embodiment, page static resources are managed separately by type. js, css, pictures, etc. are static content and are not allowed to be overwritten. Page html is dynamic content and can be seamlessly integrated with other dynamic data processing logic on the server side. Online publishing is to copy the static resources published daily to the online environment, and no front-end engineering packaging is performed. This embodiment redesigns the front-end publishing and rollback processes, and guarantees execution through the static resource management platform, which improves the publishing efficiency and the front-end stability of the entire application.

[0146] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0147] In the present embodiment, a processing device for front-end resources is also provided, and the device is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0148] Fig.11 is a structural block diagram of a front-end resource processing device according to an embodiment of the present invention, such as Fig.11 As shown, the device includes a determination module 1102, which is used to determine the type of front-end resources, wherein the type of front-end resources includes: front-end static resources and front-end dynamic resources, the type of front-end static resources includes multimedia information and web page development language, and the type of front-end dynamic resources includes hypertext markup language; a processing module 1104, which is used to process the front-end resources according to the type of the front-end resources.

[0149] In an exemplary embodiment, the above-mentioned device is also used to upload the multimedia information to the static resource server through the static resource management platform during the front-end development stage when the front-end resource is the multimedia information; when the type of the front-end resource is a web development language, determine the environment of the web development language, and process the web development language according to the application environment of the web development language; when the front-end resource is the hypertext markup language, the hypertext markup language is dynamically generated by the application server when the application server receives an access request.

[0150] In an exemplary embodiment, the above-mentioned device is also used to set an online domain name for the web development language when the application environment of the web development language is an online publishing environment, wherein the online domain name is set as a long-term valid cache and overwriting and publishing are not allowed; when the application environment of the web development language is an offline testing environment, set an offline domain name for the web development language, wherein the offline domain name is set as no cache.

[0151] In an exemplary embodiment, the above-mentioned device is also used for, when the application server receives the access request, the application server obtains the version number from the configuration center, and obtains the static resource from the static resource server through the version number; the application server generates the hypertext markup language based on the static resource.

[0152] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.

[0153] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above methods are implemented.

[0154] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0155] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0156] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0157] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0158] An embodiment of the present invention further provides a computer program product, including a computer program, which implements the steps of the method described in each embodiment of the present application when executed by a processor.

[0159] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0160] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for processing front-end resources, characterized in that: include: Determine the type of front-end resources, wherein the types of the front-end resources include: front-end static resources and front-end dynamic resources, the types of the front-end static resources include multimedia information and web page development languages, and the types of the front-end dynamic resources include hypertext markup language; The front-end resources are processed according to the types of the front-end resources.

2. The method according to claim 1, characterized in that Processing the front-end resource according to the type of the front-end resource includes: In the case where the front-end resource is the multimedia information, uploading the multimedia information to the static resource server through the static resource management platform during the front-end development stage; In the case where the type of the front-end resource is a web page development language, determining the environment of the web page development language, and processing the web page development language according to the application environment of the web page development language; In the case that the front-end resource is the hypertext markup language, the hypertext markup language is dynamically generated by the application server when the application server receives an access request.

3. The method according to claim 2, characterized in that The multimedia information is set to apply an online publishing environment.

4. The method according to claim 2, characterized in that: Processing the web page development language according to the application environment of the web page development language includes: In the case where the application environment of the web page development language is an online publishing environment, an online domain name is set for the web page development language, wherein the online domain name is set as a long-term effective cache and overwriting and publishing are not allowed; In a case where the application environment of the web page development language is an offline test environment, an offline domain name is set for the web page development language, wherein the offline domain name is set to be non-cached.

5. The method according to claim 2 or 4, characterized in that: The access path of the web page development language includes a version number.

6. The method according to claim 2, characterized in that In the case where the front-end resource is the hypertext markup language, the application server dynamically generates the hypertext markup language when the application server receives the access request, including: When the application server receives the access request, the application server obtains a version number from the configuration center, and obtains the static resource from the static resource server through the version number; The application server generates the hypertext markup language based on the static resources.

7. The method according to claim 1, characterized in that Web page development languages ​​include: scripting language js for web page development and cascading style sheets CSS.

8. A front-end resource processing device, characterized in that: include: A determination module, used to determine the type of front-end resources, wherein the types of the front-end resources include: front-end static resources and front-end dynamic resources, the types of the front-end static resources include multimedia information and web page development languages, and the types of the front-end dynamic resources include hypertext markup language; The processing module is used to process the front-end resources according to the type of the front-end resources.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method described in any one of claims 1 to 7 when executed by a processor.

10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 7.

11. 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 described in any one of claims 1 to 7 are implemented.