Page rendering method, device, apparatus, storage medium and product

By deploying code-calling components in the page code, rendering operations are blocked and the latest page code is obtained, solving the problem of page vulnerabilities not being able to be fixed in a timely manner in existing technologies. This enables rapid repair and rendering, improving efficiency.

CN119045853BActive Publication Date: 2026-02-27HANGZHOU NEWGRAND TECHNOLOGY CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411496994.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-25
Publication Date
2026-02-27
Estimated Expiration
2044-10-25

AI Technical Summary

Technical Problem

Existing engineering-based build methods cannot promptly fix and render page code vulnerabilities after they are discovered, resulting in the inability to repair page-level vulnerabilities in a timely manner and leading to low efficiency.

Method used

By deploying a code-calling component in the page code, the page rendering operation is blocked, the page identification information is determined, and the latest updated page code is retrieved from the target database to update the current page code for rendering.

Benefits of technology

It enables rapid repair and timely rendering of page vulnerabilities, improves page repair and rendering efficiency, and ensures a fast response that is imperceptible to users.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119045853B_ABST
    Figure CN119045853B_ABST
Patent Text Reader

Abstract

The application discloses a page rendering method, device, equipment, storage medium and product. The method comprises the following steps: when a current page of a target engineering project meets a page rendering condition, a code calling component in page code deployed in the current page is used to execute a blocking page rendering operation, and current page identification information of the current page is determined according to a page identification attribute of the code calling component; whether target page code in a latest update time period associated with the current page identification information exists in a target database is judged according to the current page identification information; if yes, the target page code is used to update current page code of the current page, so that the current page is rendered. The technical scheme of the embodiment of the application realizes fast repair and compilation of a page vulnerability, and renders the repaired page in time.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of front-end development, and in particular to a page rendering method and device, equipment, storage medium and product. BACKGROUND

[0002] With the development and improvement of engineering code development technology, a large number of front-end page development projects are constructed in an engineering manner. Usually, the VUE (view framework) code is compiled into JS (JavaScript, HyperText Markup Language script) code to form the compiled running code after packaging and compiling by a module packaging tool.

[0003] However, once a code vulnerability is found in the page running process using the above engineering construction method, the modification needs to be completed in the local development environment and then compiled, and the compiled code needs to be deployed to the server, which is a very redundant process. The page-level vulnerability cannot be repaired in the first time, so that the repaired page cannot be rendered in time. SUMMARY

[0004] The present application provides a page rendering method, device, equipment, storage medium and product to realize rapid repair and compilation of page vulnerabilities and timely rendering of the repaired page.

[0005] According to an aspect of the present application, a page rendering method is provided, which comprises:

[0006] When the current page of the target engineering project meets the page rendering condition, a code calling component deployed in the page code of the current page is used to execute a blocking page rendering operation, and the current page identification information of the current page is determined according to the page identification attribute of the code calling component;

[0007] According to the current page identification information, it is determined whether there is target page code associated with the current page identification information in the latest update time period in the target database;

[0008] If yes, the current page code of the current page is updated using the target page code to render the current page.

[0009] According to another aspect of the present application, a page rendering device is provided, which comprises:

[0010] An identification information determination module is configured to, when the current page of the target engineering project meets the page rendering condition, execute a blocking page rendering operation by a code calling component deployed in the page code of the current page, and determine the current page identification information of the current page according to the page identification attribute of the code calling component.

[0011] The page code judging module is configured to judge, according to the current page identification information, whether the target database has target page code in a latest update time period associated with the current page identification information.

[0012] The page rendering module is configured to update the current page code of the current page with the target page code if the target database has target page code in a latest update time period associated with the current page identification information, so as to perform page rendering on the current page.

[0013] According to another aspect of the present application, an electronic device is provided, which comprises:

[0014] at least one processor; and

[0015] a memory connected to the at least one processor in communication; wherein

[0016] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to perform the page rendering method according to any one of the embodiments of the present application.

[0017] According to another aspect of the present application, a computer readable storage medium is provided, which stores computer instructions for enabling a processor to perform the page rendering method according to any one of the embodiments of the present application when executed by the processor.

[0018] According to another aspect of the present application, a computer program product is provided, which comprises a computer program for implementing the page rendering method according to any one of the embodiments of the present application when executed by a processor.

[0019] The above technical solution of the embodiments realizes quick response and timely rendering of modified code, and can perform page repair and rendering in time when the page rendering condition is met, whether it is quick repair of page vulnerability or modification of page code based on actual demand.

[0020] It is to be understood that the embodiments described herein are merely exemplary of the application and that a person skilled in the art can devise other embodiments without departing from the scope of the present application. It is also to be understood that not all of the benefits described herein need necessarily be realized in any particular embodiment of the application and that various embodiments of the present application can be directed to one or more particular benefits or be directed to no benefits at all. It should also be understood that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting. BRIEF DESCRIPTION OF DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings needed in the embodiments description. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without any creative effort based on these drawings.

[0022] Figure 1 is a flow chart of a page rendering method according to an embodiment of the present application;

[0023] Figure 2 is a structural schematic diagram of a page rendering device according to an embodiment of the present application;

[0024] Figure 3 is a structural schematic diagram of an electronic device implementing the page rendering method according to an embodiment of the present application. DETAILED DESCRIPTION

[0025] In order to make the technical personnel in the art better understand the present application, the following will combine the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without any creative effort should be within the scope of the present application.

[0026] It should be noted that the terms "first", "second", and the like in the specification and claims of the present application and the above-described drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or a chronological sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0027] Figure 1A flowchart of a page rendering method provided by an embodiment of the present application. The embodiment can be applied to the timely repair, compilation and rendering of the front-end page of an engineering project. The method can be executed by a page rendering device, which can be implemented in the form of hardware and / or software and can be configured in an electronic device. As shown in FIG. 10, the method comprises the following steps. Figure 1

[0028] S110. When the current page of the target engineering project meets the page rendering condition, a code calling component deployed in the page code of the current page is used to execute a blocking page rendering operation, and the current page identification information of the current page is determined according to the page identification attribute of the code calling component.

[0029] The target engineering project can be an engineering project that needs to be maintained, and can be obtained after page development by a relevant technical personnel. The target engineering project can be a page development project deployed online or a page development project not deployed online. The number of project pages maintained by the target engineering project can be one or more. The current page is a project page of the target engineering project that meets the page rendering condition. The page rendering condition can be that the page is rendered when the page is started, or the page is rendered when the page is modified.

[0030] The code calling component can be a global component pre-encapsulated by a relevant technical personnel. The component can include two attributes, namely a page identification attribute and a page code attribute. To facilitate the modification of the page code by a subsequent developer on the running page, the page code attribute can be assigned an interactive control function for displaying the page code when the component is encapsulated, so that the developer can display the page code based on the interactive control function and modify the code in the debugging mode.

[0031] The page identification information is assigned to the page identification attribute of the code calling component. The page identification attribute can be used to locate the page identification information. The page identification information is used to represent the page uniqueness of the project page.

[0032] For example, when the current page of the target engineering project meets the page rendering condition, such as when the current page is started or the current page is modified and re-rendered, the current page needs to be rendered. At this time, before the page is rendered, the code calling component executes a blocking operation, that is, other operations are paused during the rendering process, and the current page identification information of the current page is determined according to the page identification attribute of the code calling component.

[0033] S120. According to the current page identification information, it is determined whether the target page code in the latest update time period associated with the current page identification information exists in the target database.

[0034] ​The target database is configured to store a page code vector corresponding to a project page code of a project page of a target engineering project. The page code vector is generated based on an abstract syntax tree of the project page code. Different page code vectors correspond to different code blocks of the corresponding project page. At least one version of the page code vector corresponding to the project page code can be maintained in the target database, and the page code vector is stored in association with page identification information, which is used to distinguish the page code vectors of different project pages. The page identification information corresponding to different project pages is different.

[0035] For example, according to the current page identification information, the target page code corresponding to the current page identification information in the latest update time period is obtained from the target database, that is, the target page code vector. The latest update time period can be the latest code update version. It is determined whether the target page code is consistent with the page code of the current page. If yes, it is determined that the target database contains the target page code in the latest update time period associated with the current page identification information. If no, it is determined that the target database does not contain the target page code in the latest update time period associated with the current page identification information.

[0036] S130, if yes, the target page code is used to update the current page code of the current page to perform page rendering on the current page.

[0037] For example, if the target database contains the target page code in the latest update time period associated with the current page identification information, the target page code is used to update the current page code of the current page to perform page rendering on the current page.

[0038] The above technical solutions of the embodiments are configured to, when the current page of the target engineering project meets the page rendering condition, execute the blocking page rendering operation through the code calling component in the page code deployed in the current page, and determine the current page identification information of the current page according to the page identification attribute of the code calling component. When it is determined that the target database contains the target page code in the latest update time period according to the current page identification information, the target page code is used to update the current page code of the current page to perform page rendering on the current page. The above technical solutions realize the fast response and timely rendering of the modified code, and can timely perform page repair and rendering when the page rendering condition is met, whether it is fast repair of a page vulnerability or modification of a page code based on actual needs.

[0039] It can be understood that the existing page code modification method is usually modified in the local development environment and then compiled and deployed to the server, but this method is low in efficiency. The embodiment provides two code modification methods. To improve the page code modification or repair efficiency, the first modification method can be that the relevant personnel can directly modify the front-end page, and the back-end quickly compiles and then renders the page. The second modification method can be that the relevant technical personnel completes the modification in the local development environment and then compiles and deploys. However, there may be conflicts in the first modification method. Therefore, the embodiment further provides a specific implementation method for solving the conflicts.

[0040] For the modification method in the front-end page, the relevant technical personnel can modify the page code in the debugging mode. In an optional embodiment, the method comprises the following steps:

[0041] Step a1, in response to a code debugging request of a project page in a target project by the relevant personnel, the page code attribute of the code calling component deployed in the project page is called to display the current page code of the project page, so that the relevant personnel can modify the current page code to obtain page modified code; wherein the project page comprises a current page.

[0042] Specifically, in the process of encapsulating the code debugging component, the page code attribute of the component is given an interactive control function. Specifically, when the application program of the entire target project starts the debugging mode, the relevant technical personnel, such as an administrator, can access and log in according to their own permissions, click the interactive button, view the specific content of the current page code, and modify the code on this basis to obtain the page modified code.

[0043] Step a2, according to the page identifier attribute of the code calling component, the project page identifier information of the project page is determined, and the mapping relationship between the project page identifier information and the page modified code is established.

[0044] Step a3, the mapping relationship is sent to the center server, so that the center server updates the current page code of the project page stored in the target database according to the project page identifier information and the page modified code.

[0045] The center server compiles the page modified code, and stores the compiled page modified code in the target database.

[0046] It should be noted that since the modification of the current page code may only be a modification of part of the code, but not all, in order to improve the compilation efficiency, code update efficiency or page rendering efficiency, only the modified part of the code can be compiled and updated and replaced.

[0047] In an optional embodiment, the mapping relationship is sent to the central server for the central server to update the current page code of the project page stored in the target database according to the project page identification information and the page modification code, including: uploading the mapping relationship to the central server through a pre-constructed code transmission tunnel. Wherein, the code transmission tunnel is a transmission channel for securely transmitting codes or data between the client and the server. The code transmission tunnel can transmit code updates to the client without reloading the page, realizing the instant update function. In the development environment, development tools such as WebpackDev Server (Webpack development server) can use tunnel technology to transmit changes in the local development environment to the browser in real time, so as to preview the modification of the code instantly.

[0048] Wherein, the central server performs operations as follows:

[0049] Step b1, code parsing is performed on the page modification code to generate a reference abstract syntax tree corresponding to the page modification code, and node extraction is performed on the reference abstract syntax tree to generate each modification code vector corresponding to the reference abstract syntax tree.

[0050] Exemplarily, the reference abstract syntax tree of the page modification code can be generated by a parsing tool. Wherein, the parsing tool can be Babel (JavaScript compiler) for example. Node traversal and information extraction are performed on the reference abstract syntax tree, which can specifically include different types of nodes such as variable declaration, function call, expression, etc. The node type is taken as part of the generated modification code vector, and the text or code content can be converted into a vector using embedded technology; the relationship between nodes is encoded into the vector, and at least one modification code vector is obtained through integration and standardization. Wherein, different modification code vectors can represent different code blocks in the page code.

[0051] Step b2, according to the target page identification information, each current page code vector of the project page is obtained from the target database.

[0052] The target database stores page code vectors of different project pages. According to the target page identification information, the project page in the target database can be located, so as to obtain the current page code vector of the project page. Wherein, the current page code vector can be the code vector in the latest update time period.

[0053] Step b3, compare each modification code vector with each current page code vector to determine the page modification part code of the project page.

[0054] The modified code vectors are compared with the current page code vectors respectively, and if the comparison is consistent, it is determined that the code blocks of the consistent part are not modified, and if the comparison is inconsistent, it is determined that the code blocks of the inconsistent part are modified. Through the comparison result, the page modified part code of the project page can be determined.

[0055] Step b4, code compilation is performed on the page modified part code, and the compiled page modified part code is used to update the current page code of the project page stored in the target database.

[0056] Code compilation is performed on the page modified part code, and the compiled page modified part code is used to update the current page code of the project page stored in the target database, so that page rendering is performed based on the compiled page modified part code when page rendering is performed.

[0057] The above technical solution directly repairs the code on the page interface, and uploads the server to compile the modified part code in time, and performs page rendering in time, realizes the rapid repair of the page vulnerability, improves the page repair efficiency. In addition, by determining the modified part code and only compiling the modified part code, the code compilation efficiency is improved, the repair efficiency is further improved, the page is quickly rendered, and the user is not aware.

[0058] For the way of modifying the page code locally by the related technical personnel, in an optional embodiment, the following steps are included:

[0059] Step c1, when the project page construction condition of the target engineering project is met, the file resource path of the page code is obtained, and the project page code of the project page is obtained based on the file resource path; the project page includes the current page.

[0060] The project page construction condition can be pre-set by the related technical personnel, specifically, when the page construction instruction is executed, or when the "npm run Build" command is run, the page code file resource path is obtained.

[0061] It should be noted that the execution of the page code file path acquisition process can be realized by customizing the loader component. In the engineering configuration file, the rule of the file ending with VUE is specified to use the custom "vue-ng-loader" component for compilation, so that the custom component and the page program source code of the project page are associated.

[0062] The page code is the VUE file of the project page, and the file resource path of the page code is obtained, and the project page code of the project page is obtained based on the file resource path.

[0063] Step c2, code parsing is performed on the project page code of the project page to generate a page abstract syntax tree corresponding to the project page code.

[0064] Step c3, node extraction is performed on the page abstract syntax tree, and based on the extracted syntax tree nodes, each page code vector corresponding to the page abstract syntax tree is generated.

[0065] Step c4, page identification information of the project page is generated according to the file resource path of the project page.

[0066] Since the file resource paths of different project pages are different, the page identification information for representing the uniqueness of the project page can be generated according to the file resource path.

[0067] Step c5, a mapping relationship between the page identification information of the project page and each page code vector is established, and the mapping relationship is stored in the target database to update the current page code of the project page stored in the target database.

[0068] In an optional embodiment, the page code attribute of the code calling component has an interactive control function, so the code calling component has a certain association with the project page, and the code calling component is generated, and the page identification attribute and the page code attribute are assigned in the following manner:

[0069] Step d1, the code calling component is inserted into the root node of the page abstract syntax tree of the project page code to establish an association relationship between the code calling component and the project page.

[0070] The code calling component is inserted into the root node of the page abstract syntax tree to establish an association relationship between the code calling component and the project page, or the code calling component is inserted into the first index of the page abstract syntax tree to establish an association relationship between the code calling component and the project page.

[0071] Step d2, the page identification information of the project page is taken as the page identification attribute of the code calling component, and the project page code of the project page is taken as the page code attribute of the code calling component.

[0072] The page identification information of the project page is assigned to the page identification attribute of the code calling component, and the project page code is assigned to the page code attribute of the code calling component.

[0073] Further, while the local page code is modified, there can be a related technical personnel modifying the code in the front-end interface, and the process of modifying the code in the front-end interface is unknown when the local technical personnel modifies the page code locally. Therefore, to further solve the conflict of simultaneous modification, before storing the mapping relationship of modifying the page code locally to the target database, the central server can be used to check whether there is code for modifying the front-end interface in the code transmission tunnel.

[0074] In an optional embodiment, before storing the mapping relationship to the target database, the method further comprises:

[0075] Step e1, a code judgment request is sent to the central server to request the central server to judge whether there is page modification code of the project page in the code transmission tunnel within a preset time period. If there is, steps e2 to e5 are executed; if there is not, step e6 is executed.

[0076] The preset time period can be set by the related technical personnel according to actual needs, for example, the preset time period can be that the time difference between the local modification code and the front-end interface modification code and the transmission to the code transmission tunnel is not more than 20 minutes.

[0077] Step e2, the page modification code in the code transmission tunnel is obtained.

[0078] Step e3, the page modification code is parsed to generate a reference abstract syntax tree corresponding to the page modification code, and nodes of the reference abstract syntax tree are extracted to generate each modification code vector corresponding to the reference abstract syntax tree.

[0079] Step e4, whether each modification code vector is consistent with each page code vector is judged.

[0080] Step e51, if yes, the mapping relationship is stored to the target database.

[0081] If they are consistent, it means that the modification codes of the two are the same. If they are not consistent, it means that the modification codes of the two are partially different. If they are the same, the mapping relationship is directly stored to the target database.

[0082] Step e51, if no, the page modification part code corresponding to the modification code vector is compiled, and the compiled page modification part code is used to update the current page code of the project page stored in the target database.

[0083] If they are not the same, the modification part code modified by the front-end page is used as the standard, the part of the code is compiled and stored to meet the rendering condition for page rendering.

[0084] Step e6, store the mapping relationship to the target database.

[0085] The technical scheme of the embodiment realizes quick repair and quick page rendering when a page exists a vulnerability, and the whole process can be realized without user awareness. When the two modification methods conflict, the conflict can be responded in time, the modification and rendering efficiency is improved, and the code modification reliability is ensured.

[0086] Figure 2 A structural schematic diagram of a page rendering device provided by the embodiment is provided. The page rendering device provided by the embodiment can be applied to timely repair, compilation and rendering of a front-end page of an engineering project. The page rendering device can be realized in the form of hardware and / or software. Figure 2 As shown in the figure, the page rendering device specifically comprises: an identification information determination module 201, a page code judgment module 202 and a page rendering module 203. Among them,

[0087] The identification information determination module 201 is configured to, when a current page of a target engineering project meets a page rendering condition, execute a blocking page rendering operation through a code calling component deployed in page code of the current page, and determine current page identification information of the current page according to a page identification attribute of the code calling component.

[0088] The page code judgment module 202 is configured to determine whether there is target page code in the target database in the latest update time period associated with the current page identification information according to the current page identification information.

[0089] The page rendering module 203 is configured to, if there is target page code in the target database in the latest update time period associated with the current page identification information, update the current page code of the current page with the target page code to render the current page.

[0090] The technical scheme of the above embodiment realizes quick response and timely rendering of modified code by executing a blocking page rendering operation through a code calling component deployed in page code of a current page of a target engineering project when the current page meets a page rendering condition, and determining current page identification information of the current page according to a page identification attribute of the code calling component. When it is determined that there is target page code in the target database in the latest update time period according to the current page identification information, the current page code of the current page is updated with the target page code to render the current page. Quick response and timely rendering of modified code are realized, whether it is quick repair of a page vulnerability or modification of page code based on actual needs, page repair and rendering can be performed in time when the page rendering condition is met.

[0091] Optionally, the apparatus further comprises:

[0092] a code display module configured to, in response to a code debugging request of a relevant person on a project page in the target engineering project, display a project current page code of the project page through a page code attribute of a code calling component deployed in the project page, so that the relevant person modifies the project current page code to obtain a page modified code; wherein the project page comprises the current page.

[0093] a mapping relationship construction module configured to determine project page identification information of the project page according to a page identification attribute of the code calling component, and establish a mapping relationship between the project page identification information and the page modified code.

[0094] a mapping relationship sending module configured to send the mapping relationship to a central server, so that the central server updates a project current page code of a project page stored in the target database according to the project page identification information and the page modified code.

[0095] Optionally, the mapping relationship sending module is specifically configured to upload the mapping relationship to the central server through a pre-constructed code transmission tunnel.

[0096] wherein the central server performs operations as follows:

[0097] code parsing on the page modified code to generate a reference abstract syntax tree corresponding to the page modified code, and node extraction on the reference abstract syntax tree to generate each modified code vector corresponding to the reference abstract syntax tree;

[0098] acquiring each current page code vector of the project page from the target database according to the target page identification information;

[0099] comparing each modified code vector with each current page code vector to determine a page modified part code of the project page;

[0100] code compiling on the page modified part code, and updating a project current page code of a project page stored in the target database by using the compiled page modified part code.

[0101] Optionally, the apparatus further comprises:

[0102] The page code obtaining module is configured to obtain a file resource path of the page code when a project page construction condition of the target engineering project is met, and obtain project page code of the project page based on the file resource path, wherein the project page comprises the current page.

[0103] The code parsing module is configured to perform code parsing on the project page code of the project page to generate a page abstract syntax tree corresponding to the project page code.

[0104] The vector generating module is configured to perform node extraction on the page abstract syntax tree, and generate each page code vector corresponding to the page abstract syntax tree based on the extracted syntax tree nodes.

[0105] The identification information generating module is configured to generate page identification information of the project page according to the file resource path of the project page.

[0106] The relationship storing module is configured to establish a mapping relationship between the page identification information of the project page and each page code vector, and store the mapping relationship to the target database to update the current page code of the project page stored in the target database.

[0107] Optionally, the apparatus further comprises:

[0108] The component inserting module is configured to insert the code calling component into a root node of a page abstract syntax tree of the project page code to establish an association relationship between the code calling component and the project page.

[0109] The attribute assigning module is configured to assign the page identification information of the project page as a page identification attribute of the code calling component, and assign the project page code of the project page as a page code attribute of the code calling component.

[0110] Optionally, the apparatus further comprises:

[0111] The judgment request sending module is configured to send a code judgment request to a center server to request the center server to judge whether there is page modification code of the project page in a code transmission tunnel within a preset time period before the mapping relationship is stored to the target database.

[0112] The modification code obtaining module is configured to obtain the page modification code in the code transmission tunnel if there is the page modification code of the project page in the code transmission tunnel.

[0113] The code parsing module is configured to perform code parsing on the page modification code, generate a reference abstract syntax tree corresponding to the page modification code, and perform node extraction on the reference abstract syntax tree to generate each modification code vector corresponding to the reference abstract syntax tree.

[0114] The vector judging module is configured to judge whether each modification code vector is consistent with each page code vector.

[0115] The relationship storing module is configured to store the mapping relationship into the target database if each modification code vector is consistent with each page code vector.

[0116] Optionally, the apparatus further comprises:

[0117] The code replacing module is configured to perform code compiling on the page modification partial code corresponding to each modification code vector if there is inconsistency between each modification code vector and each page code vector, and update the current page code of the project page stored in the target database by using the compiled page modification partial code.

[0118] The page rendering apparatus provided by the embodiments of the present application can execute the page rendering method provided by any of the embodiments of the present application, and has the corresponding function modules and beneficial effects of the execution method.

[0119] Figure 3 A structural schematic diagram of an electronic device 30 that can be used to implement embodiments of the present application is shown. The electronic device is intended to represent various forms of digital computers, such as laptops, desktops, tablets, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular telephones, smart phones, wearable devices (e.g., headsets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not intended to limit the implementations of the present application described and / or claimed in this document.

[0120] As Figure 3As shown, the electronic device 30 includes at least one processor 31, and a memory, such as a read-only memory (ROM) 32, a random access memory (RAM) 33, etc., connected to the at least one processor 31 in communication. The memory stores computer programs executable by the at least one processor 31, and the processor 31 can perform various appropriate actions and processes according to the computer programs stored in the read-only memory (ROM) 32 or loaded from the storage unit 38 into the random access memory (RAM) 33. In the RAM 33, various programs and data required for the operation of the electronic device 30 can also be stored. The processor 31, the ROM 32, and the RAM 33 are connected to each other through a bus 34. An input / output (I / O) interface 35 is also connected to the bus 34.

[0121] Various components in the electronic device 30 are connected to the I / O interface 35, including an input unit 36, such as a keyboard, a mouse, etc., an output unit 37, such as various types of displays, a speaker, etc., a storage unit 38, such as a magnetic disk, an optical disk, etc., and a communication unit 39, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 39 allows the electronic device 30 to exchange information / data with other devices through a computer network, such as the Internet, and / or various telecommunication networks.

[0122] The processor 31 can be various general and / or special-purpose processing components having processing and computing capabilities. Some examples of the processor 31 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 31 performs various methods and processes described above, such as the page rendering method.

[0123] In some embodiments, the page rendering method can be implemented as a computer program tangibly embodied in a computer readable storage medium, such as the storage unit 38. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 30 via the ROM 32 and / or the communication unit 39. When the computer program is loaded onto the RAM 33 and executed by the processor 31, one or more steps of the page rendering method described above can be performed. Alternatively, in other embodiments, the processor 31 can be configured to perform the page rendering method by any other appropriate means, such as by means of firmware.

[0124] The various embodiments of the systems and techniques described above can be implemented in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a load programmable logic device (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.

[0125] Computer programs used to implement the processes of the application can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer program, when executed, can cause instructions defined in the flow charts and / or block diagrams to be implemented. The computer program can be executed entirely on a machine, partially on a machine, partially on a machine as a standalone software package and partially on a remote machine or entirely on a remote machine or server.

[0126] In the context of the present application, a computer-readable storage medium can be a tangible medium that can contain or store computer programs for use by or in connection with an instruction execution system, apparatus, or device. Computer-readable storage media can include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of the machine-readable storage medium will include one or more lines of electrical connections, portable computer disks, hard disk drives, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or Flash memory), optical fibers, portable compact disc read-only memories (CD-ROMs), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0127] To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.

[0128] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0129] The computing system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. A server can be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system, to solve the defects of large management difficulty and weak business scalability in traditional physical host and VPS service.

[0130] It should be understood that the various forms of flow shown above can be re-ordered, added to, or deleted from without departing from the scope of the present disclosure. For example, the steps recited in the present disclosure can be executed in parallel, executed in sequence, or executed in a different order, as long as the desired results of the present disclosure are achieved, and the present disclosure is not limited herein.

[0131] The specific embodiments described above are not intended to be limiting, and persons skilled in the art will appreciate that various modifications, combinations, sub-combinations and alternatives can be made to the specific embodiments without departing from the spirit and principles of the disclosure. Accordingly, the disclosure is not limited to the specific embodiments described above, but only by the scope of the appended claims.

Claims

1. A method of rendering a page, the method comprising: The method comprises the following steps: When a current page of a target engineering project meets a page rendering condition, a blocking page rendering operation is performed by a code calling component deployed in page code of the current page, and current page identification information of the current page is determined according to a page identification attribute of the code calling component; According to the current page identification information, it is judged whether there is target page code in a target database associated with the current page identification information in a latest update time period; If yes, the current page code of the current page is updated by using the target page code to perform page rendering on the current page; In response to a code debugging request of a project page in the target engineering project by a relevant person, the current page code of the project page is displayed through a page code attribute of a code calling component deployed in the project page, so that the relevant person can modify the current page code to obtain page modified code; wherein the project page comprises the current page; According to the page identification attribute of the code calling component, project page identification information of the project page is determined, and a mapping relationship between the project page identification information and the page modified code is established; The mapping relationship is uploaded to a central server through a pre-constructed code transmission tunnel; The central server performs the following operations: The page modified code is parsed to generate a reference abstract syntax tree corresponding to the page modified code, and nodes of the reference abstract syntax tree are extracted to generate each modified code vector corresponding to the reference abstract syntax tree; According to the target page identification information, each current page code vector of the project page is obtained from the target database; Each modified code vector is compared with each current page code vector to determine a page modified part code of the project page; The page modified part code is compiled, and the compiled page modified part code is used to update the current page code of the project page stored in the target database; When a project page construction condition of the target engineering project is met, a file resource path of the page code is obtained, and based on the file resource path, a project page code of the project page is obtained; the project page comprises the current page; The project page code of the project page is parsed to generate a page abstract syntax tree corresponding to the project page code; Nodes of the page abstract syntax tree are extracted, and based on the extracted syntax tree nodes, each page code vector corresponding to the page abstract syntax tree is generated; According to the file resource path of the project page, page identification information of the project page is generated; A mapping relationship between the page identification information of the project page and each page code vector is established, and the mapping relationship is stored in the target database to update the current page code of the project page stored in the target database.

2. The method of claim 1, wherein, The method further comprises: inserting the code calling component into a root node of a page abstract syntax tree of the project page code to establish an association between the code calling component and the project page; setting page identification information of the project page as a page identification attribute of the code calling component, and setting project page code of the project page as a page code attribute of the code calling component.

3. The method of claim 2, wherein, Before the storing of the mapping relationship into the target database, the method further comprises: sending a code judgment request to a center server to request the center server to judge whether there is page modification code of the project page in a code transmission tunnel within a preset time period; if there is, obtaining the page modification code in the code transmission tunnel; performing code analysis on the page modification code to generate a reference abstract syntax tree corresponding to the page modification code, and performing node extraction on the reference abstract syntax tree to generate each modification code vector corresponding to the reference abstract syntax tree; judging whether each modification code vector is consistent with each page code vector; if yes, performing the storing of the mapping relationship into the target database.

4. The method of claim 3, wherein, The method further comprises: if there is inconsistency between each modification code vector and each page code vector, performing code compilation on a page modification partial code corresponding to the modification code vector, and updating the current page code of the project page stored in the target database by using the compiled page modification partial code.

5. A page rendering apparatus characterized by comprising: comprises: an identification information determination module configured to, when a current page of a target engineering project meets a page rendering condition, execute a blocking page rendering operation by a code calling component deployed in page code of the current page, and determine current page identification information of the current page according to a page identification attribute of the code calling component; a page code judgment module configured to judge, according to the current page identification information, whether there is target page code in a latest update time period associated with the current page identification information in a target database; a page rendering module configured to, if there is target page code in a latest update time period associated with the current page identification information in the target database, update current page code of the current page by using the target page code to perform page rendering on the current page; The apparatus further comprises: a code display module configured to, in response to a code debugging request of a related person on project page code of a project page in a target engineering project, display the project current page code of the project page by using a page code attribute of a code calling component deployed in the project page, so that the related person can modify the project current page code to obtain page modification code; wherein the project page comprises the current page; a mapping relationship construction module configured to determine project page identification information of the project page according to a page identification attribute of the code calling component, and establish a mapping relationship between the project page identification information and the page modification code. The mapping relationship sending module is configured to send the mapping relationship to a center server, so that the center server updates the project current page code of the project page stored in the target database according to the project page identification information and the page modification code; The mapping relationship sending module is specifically configured to upload the mapping relationship to the center server through a pre-constructed code transmission tunnel. The center server performs operations as follows: The page modification code is parsed to generate a reference abstract syntax tree corresponding to the page modification code, and nodes of the reference abstract syntax tree are extracted to generate each modification code vector corresponding to the reference abstract syntax tree; According to the target page identification information, each current page code vector of the project page is obtained from the target database; Each modification code vector is compared with each current page code vector to determine a page modification part code of the project page; The page modification part code is compiled, and the project current page code of the project page stored in the target database is updated by using the compiled page modification part code; The device further comprises: A page code obtaining module is configured to obtain a file resource path of the page code when a project page construction condition of the target engineering project is met, and obtain the project page code of the project page based on the file resource path; the project page includes the current page. A code parsing module is configured to parse the project page code of the project page to generate a page abstract syntax tree corresponding to the project page code. A vector generating module is configured to extract nodes of the page abstract syntax tree, and generate each page code vector corresponding to the page abstract syntax tree based on the extracted syntax tree nodes. An identification information generating module is configured to generate page identification information of the project page according to the file resource path of the project page. A relationship storing module is configured to establish a mapping relationship between the page identification information of the project page and each page code vector, and store the mapping relationship in the target database to update the current page code of the project page stored in the target database.

6. An electronic device, comprising: The electronic device comprises: at least one processor; and a memory connected with the at least one processor in communication; wherein The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the page rendering method in any one of claims 1-4.

7. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer instructions for enabling the processor to execute the page rendering method in any one of claims 1-4 when executed.

8. A computer program product, characterised in that, The computer program product comprises a computer program, and the computer program implements the page rendering method according to any one of claims 1-4 when executed by the processor.

Citation Information

Patent Citations

  • Application hot update method and device and storage medium

    CN118642735A