Page rendering method and device, equipment, storage medium and product
By deploying code call components in the page code, blocking rendering operations and judging the latest code in the database, the problem of redundancy in the page vulnerability repair and rendering process in the existing technology is solved, and the rapid repair and rendering of page vulnerabilities is achieved, which improves the improvement of Repair and rendering efficiency.
Patent Information
- Application Number
- CN202411496994.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-25
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2044-10-25
AI Technical Summary
After the existing engineering code development methods discover page vulnerabilities, they need to be modified and compiled in the local development environment, resulting in redundant repair and rendering processes, and the page cannot be repaired and rendered in time.
By deploying code call components in the page code, blocking page rendering operations, determining page identification information, and determining whether the latest updated page code exists in the target database. If it exists, update the current page code to achieve fast rendering.
It realizes rapid repair and compilation of page vulnerabilities, timely renders the repaired page, improves page repair and rendering efficiency, and ensures the timeliness and reliability of page repairs.
Smart Images

Figure CN119045853A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of front-end development technology, and in particular to a page rendering method, device, equipment, storage medium and product. Background Art
[0002] With the development and improvement of engineering code development technology, a large number of front-end page development projects are built in an engineering way. Usually, they are packaged, compiled and released through module packaging tools, and then the VUE (view framework) code is compiled into JS (JavaScript, Hypertext Markup Language Script) code to form the compiled running code.
[0003] However, once a code vulnerability is discovered during page operation, the above engineering construction method needs to be modified in the local development environment and then compiled, and then deployed to the server. The whole process is very redundant and cannot repair page-level vulnerabilities in the first place, resulting in the inability to compile the code in time, and the inability to render the repaired page in time. Summary of the invention
[0004] The present invention provides a page rendering method, device, equipment, storage medium and product to achieve rapid repair and compilation of page vulnerabilities and timely rendering of the repaired page.
[0005] According to one aspect of the present invention, a page rendering method is provided, the method comprising:
[0006] When the current page of the target project meets the page rendering condition, a blocking page rendering operation is performed by calling a code component deployed in the page code of the current page, 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 a target page code in the target database in the latest update time period associated with the current page identification information;
[0008] If so, the target page code is used to update the current page code of the current page to perform page rendering on the current page.
[0009] According to another aspect of the present invention, a page rendering device is provided, the device comprising:
[0010] An identification information determination module is used to, when the current page of the target project meets the page rendering condition, perform a blocking page rendering operation by calling a code 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] A page code determination module, used for determining, based on the current page identification information, whether there is a target page code in the target database in the latest update time period associated with the current page identification information;
[0012] The page rendering module is used to update the current page code of the current page with the target page code if there is a target page code in the latest update time period associated with the current page identification information in the target database, so as to render the current page.
[0013] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0014] at least one processor; and
[0015] a memory communicatively connected to the at least one processor; 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 so that the at least one processor can execute the page rendering method described in any embodiment of the present invention.
[0017] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the page rendering method described in any embodiment of the present invention when executed.
[0018] According to another aspect of the present invention, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the page rendering method according to any embodiment of the present invention is implemented.
[0019] The technical solution of the above-mentioned embodiment performs a blocking page rendering operation by calling a code component deployed in the page code of the current page when the current page of the target project meets the page rendering conditions, and determines the current page identification information of the current page according to the page identification attribute of the code calling component; when it is determined according to the current page identification information that the target page code within the latest update time period exists in the target database, the current page code of the current page is updated with the target page code to render the current page, thereby achieving rapid response and timely rendering of the modified code. Whether it is a quick repair of page vulnerabilities or page code modification based on actual needs, the page can be repaired and rendered in time when the page rendering conditions are met.
[0020] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0022] Figure 1 is a flow chart of a page rendering method provided according to an embodiment of the present invention;
[0023] Figure 2 is a structural schematic diagram of a page rendering device provided according to an embodiment of the present invention;
[0024] Figure 3 It is a structural schematic diagram of an electronic device for implementing the page rendering method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0025] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0026] 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. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0027] Figure 1This is a flow chart of a page rendering method provided by an embodiment of the present invention. This embodiment can be applied to timely repair, compile and render 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. Figure 1 As shown, the method includes:
[0028] S110. When the current page of the target project meets the page rendering conditions, a blocking page rendering operation is performed by calling a code component deployed in the page code of the current page, 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 project may be a project that needs page maintenance, which may be obtained after page development by relevant technical personnel. It may be a page development project that has been deployed online, or it may be a page development project that has not been deployed online. The number of project pages maintained by the target project may be one or more. The current page is a project page in the target project that meets the page rendering conditions. The page rendering conditions may be rendering when the page is started, or rendering needs to be started when the page is modified.
[0030] The code calling component may be a global component pre-packaged by relevant technical personnel, and the component may include two attributes, namely, a page identification attribute and a page code attribute. To facilitate subsequent developers to modify the page code on the running page, when packaging the component, the page code attribute may be assigned an interactive control function that can display the page code, so that developers 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 information can be located through the page identification attribute. The page identification information is used to characterize the page uniqueness of the project page.
[0032] For example, when the current page of the target project meets the page rendering conditions, such as when the current page is opened 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 calls the component to perform a blocking operation, that is, suspend other operations during the rendering process, and determine the current page identification information of the current page according to the page identification attribute of the code calling component.
[0033] S120: According to the current page identification information, it is determined whether there is a target page code in the target database in the latest update time period associated with the current page identification information.
[0034] The target database is used to store page code vectors corresponding to the project page codes of the project pages of the target engineering project. The page code vectors are generated based on the abstract syntax tree of the project page codes. Different page code vectors correspond to different code blocks of the corresponding project pages. The target database can maintain page code vectors corresponding to at least one version of the project page code, and the page code vectors are stored in association with the page identification information to distinguish page code vectors of different project pages. The page identification information corresponding to different project pages is different.
[0035] Exemplarily, according to the current page identification information, the target page code corresponding to the latest update time period of the current page identification information, that is, the target page code vector, is obtained from the target database. The latest update time period may 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 so, it is determined that the target page code associated with the current page identification information exists in the target database; if not, it is determined that the target page code associated with the current page identification information does not exist in the target database.
[0036] S130: If yes, the target page code is used to update the current page code of the current page to render the current page.
[0037] Exemplarily, if the target database contains a 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 render the current page.
[0038] The technical solution of the above-mentioned embodiment performs a blocking page rendering operation by calling a code component deployed in the page code of the current page when the current page of the target project meets the page rendering conditions, and determines the current page identification information of the current page according to the page identification attribute of the code calling component; when it is determined according to the current page identification information that the target page code within the latest update time period exists in the target database, the current page code of the current page is updated with the target page code to render the current page, thereby achieving rapid response and timely rendering of the modified code. Whether it is a quick repair of page vulnerabilities or page code modification based on actual needs, the page can be repaired and rendered in time when the page rendering conditions are met.
[0039] It is understandable that the existing method of modifying page code is usually to complete the modification in the local development environment and then compile and deploy it to the server, but this method is inefficient. This embodiment provides two code modification methods. In order to improve the efficiency of page code modification or repair, the first modification method can be: relevant personnel can directly modify the front-end page, and the back-end quickly compiles and renders the page. The second modification method can be: relevant technical personnel compile and deploy after completing the modification in the local development environment. However, there may be a conflict in the first modification method. Therefore, this embodiment also provides a specific implementation method for resolving the conflict.
[0040] Regarding the modification method on the front-end page, relevant technicians can modify the page code in the debugging mode. In an optional embodiment, the following steps are included:
[0041] Step a1, in response to a code debugging request from relevant personnel for a project page in a target engineering project, the current page code of the project page is displayed through the page code attribute of the code calling component deployed in the project page, so that relevant personnel can modify the current page code and obtain the page modification code; wherein the project page includes the 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 of the entire target project starts the debugging mode, relevant technicians, such as administrators, can log in according to their own permissions, click the interactive button, and view the specific content of the current page code, and modify the code based on this to obtain the page modification code.
[0043] Step a2: determine the project page identification information of the project page according to the page identification attribute of the code calling component, and establish a mapping relationship between the project page identification information and the page modification code.
[0044] Step a3: Send the mapping relationship to the central server, so that the central server can 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.
[0045] The central server compiles the page modification code and stores the compiled page modification code in the target database.
[0046] It should be noted that since the modification to the current page code may only be a modification to part of the code, not all of it, in order to improve compilation efficiency, code update efficiency or page rendering efficiency, only the modified part of the code may be compiled and updated.
[0047] In an optional embodiment, the mapping relationship is sent to a central server so that the central server can 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-built code transmission tunnel. The code transmission tunnel is a transmission channel for securely transmitting code or data between the client and the server. The code transmission tunnel can transmit code updates to the client without reloading the page, thereby realizing an instant update function. In a development environment, development tools such as WebpackDev Server (Webpack development server) can use tunneling technology to transmit changes in the local development environment to the browser in real time, so as to instantly preview code modifications.
[0048] The central server performs the following operations:
[0049] Step b1: parse the page modification code to generate a reference abstract syntax tree corresponding to the page modification code, extract nodes from the reference abstract syntax tree, and generate modification code vectors corresponding to the reference abstract syntax tree.
[0050] Exemplarily, a reference abstract syntax tree of the page modification code can be generated by a parsing tool. The parsing tool can be, for example, Babel (JavaScript compiler). The reference abstract syntax tree is traversed and information is extracted, which may include different types of nodes, such as variable declarations, function calls, expressions, etc. The node type is used as part of the generated modification code vector. For text or code content, embedded technology can be used to convert it into a vector; the relationship between step nodes is encoded into the vector, and at least one modification code vector is obtained through integration and standardization. Different modification code vectors can represent different code blocks in the page code.
[0051] Step b2: According to the target page identification information, obtain each current page code vector of the project page 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 to obtain the current page code vector of the project page. The current page code vector can be the code vector in the latest update time period.
[0053] Step b3: Compare each modified code vector with each current page code vector to determine the page modified part code of the project page.
[0054] Each modified code vector is compared with each current page code vector one by one. If the comparison is consistent, it is determined that the code block of the consistent part has not been modified; if the comparison is inconsistent, it is determined that the code block of the inconsistent part has been modified. Through the comparison results, the page modified part code of the project page can be determined.
[0055] Step b4: compile the page modification part code, and use the compiled page modification part code to update the current page code of the project page stored in the target database.
[0056] The page modification part code 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, so that when the page is rendered, the page is rendered based on the compiled page modification part code.
[0057] The above technical solution can quickly repair page vulnerabilities and improve page repair efficiency by directly repairing the code on the page interface and uploading it to the server to compile the modified part of the code in time and render the page in time. In addition, by determining to modify part of the code and only compiling the modified part of the code, the code compilation efficiency is improved, the repair efficiency is further improved and the page rendering is realized quickly, so that users are not aware of it.
[0058] Regarding the method for relevant technicians to modify the page code locally, in an optional embodiment, the following steps are included:
[0059] Step c1: when the project page construction conditions for the target engineering project are met, the file resource path of the page code is obtained, and based on the file resource path, the project page code of the project page is obtained; the project page includes the current page.
[0060] Among them, the project page building conditions can be pre-set by relevant technical personnel, specifically, when executing the build page instruction, or, that is, when running the "npm run Build" command, obtaining the page code file resource path.
[0061] It should be noted that the process of obtaining the page code file path can be specifically executed through a custom loader component. In the project configuration file, the file rule 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 with each other.
[0062] The page code is the VUE file of the project page. The file resource path of the page code is obtained, and based on the file resource path, the project page code of the project page is obtained.
[0063] Step c2: parse the project page code of the project page to generate a page abstract syntax tree corresponding to the project page code.
[0064] Step c3: extract nodes from the page abstract syntax tree, and generate page code vectors corresponding to the page abstract syntax tree based on the extracted syntax tree nodes.
[0065] Step c4: Generate page identification information of the project page according to the file resource path of the project page.
[0066] Since the file resource paths of different project pages are different, page identification information for representing the uniqueness of the project page can be generated according to the file resource path.
[0067] Step c5: 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.
[0068] In an optional embodiment, the page code attribute of the code calling component has an interactive control function. Therefore, there is a certain correlation between the code calling component and the project page. The code calling component is generated, and the page identification attribute and the page code attribute are assigned as follows:
[0069] Step d1: insert the code calling component 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] Insert a code call component into the root node of the page abstract syntax tree to establish an association relationship between the code call component and the project page; or insert a code call component into the first index of the page abstract syntax tree to establish an association relationship between the code call component and the project page.
[0071] Step d2: Use the page identification information of the project page as the page identification attribute of the code calling component, and use the project page code of the project page 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] Furthermore, when the local page code is modified, there may be relevant technicians modifying the code on the front-end interface. When the local technicians modify the page code locally, they are unaware of the process of modifying the code on the front-end interface. Therefore, in order to further resolve the conflict of simultaneous modifications, before storing the mapping relationship of the page code modification locally to the target database, the code transmission tunnel of the central server can be used to check whether there is code modified on the front-end interface at the same time.
[0074] In an optional embodiment, before storing the mapping relationship in the target database, the method further includes:
[0075] Step e1: Send a code determination request to the central server to request the central server to determine whether there is a page modification code of the project page in the code transmission tunnel within a preset time period. If there is, execute steps e2 to e5; if not, execute step e6.
[0076] Among them, the preset time period can be pre-set by relevant technical personnel according to actual needs. For example, the preset time period can be that the time difference between local code modification and front-end interface code modification and transmission to the code transmission tunnel does not exceed 20 minutes.
[0077] Step e2: Obtain the page modification code in the code transmission tunnel.
[0078] Step e3: parse the page modification code to generate a reference abstract syntax tree corresponding to the page modification code, extract nodes from the reference abstract syntax tree, and generate modification code vectors corresponding to the reference abstract syntax tree.
[0079] Step e4: determine whether each modified code vector is consistent with each page code vector.
[0080] Step e51: If yes, store the mapping relationship in the target database.
[0081] If they are consistent, it means that the modification codes of the two are the same. If they are inconsistent, it means that the modification codes of the two are partially different. If they are the same, the mapping relationship is directly stored in the target database.
[0082] Step e51: If not, compile the page modification part code corresponding to the modification code vector, and use the compiled page modification part code to update the current page code of the project page stored in the target database.
[0083] If they are not the same, the modified part of the code modified by the front-end page shall prevail, and this part of the code shall be compiled and stored, so that the page can be rendered when the rendering conditions are met.
[0084] Step e6: store the mapping relationship in the target database.
[0085] The technical solution of this embodiment realizes fast repair and fast page rendering when there are vulnerabilities in the page through two code modification methods: front-end page modification and local modification, and the whole process can be realized without user perception. In addition, when a conflict occurs between the two modification methods, the conflict can be responded to in time, which improves the modification and rendering efficiency while ensuring the reliability of code modification.
[0086] Figure 2 A schematic diagram of the structure of a page rendering device provided by an embodiment of the present invention. A page rendering device provided by an embodiment of the present invention can be used to timely repair, compile and render the front-end page of an engineering project. The page rendering device can be implemented in the form of hardware and / or software, such as Figure 2 As shown, it specifically includes: an identification information determination module 201, a page code determination module 202 and a page rendering module 203. Among them,
[0087] The identification information determination module 201 is used to, when the current page of the target project meets the page rendering condition, perform a blocking page rendering operation by calling a code 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;
[0088] The page code determination module 202 is used to determine whether there is a target page code in the latest update time period associated with the current page identification information in the target database according to the current page identification information;
[0089] The page rendering module 203 is used to update the current page code of the current page with the target page code if there is a target page code in the latest update time period associated with the current page identification information in the target database, so as to render the current page.
[0090] The technical solution of the above-mentioned embodiment performs a blocking page rendering operation by calling a code component deployed in the page code of the current page when the current page of the target project meets the page rendering conditions, and determines the current page identification information of the current page according to the page identification attribute of the code calling component; when it is determined according to the current page identification information that the target page code within the latest update time period exists in the target database, the current page code of the current page is updated with the target page code to render the current page, thereby achieving rapid response and timely rendering of the modified code. Whether it is a quick repair of page vulnerabilities or page code modification based on actual needs, the page can be repaired and rendered in time when the page rendering conditions are met.
[0091] Optionally, the device further comprises:
[0092] A code display module is used to respond to a code debugging request of a project page in the target engineering project by a relevant person, and to display the current page code of the project page through the page code attribute of the code calling component deployed in the project page, so that the relevant person can modify the current page code of the project to obtain the page modification code; wherein the project page includes the current page;
[0093] A mapping relationship building module, used to determine the project page identification information of the project page according to the page identification attribute of the code calling component, and establish a mapping relationship between the project page identification information and the page modification code;
[0094] The mapping relationship sending module is used to send the mapping relationship to the central server, so that the central server can update 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.
[0095] Optionally, the mapping relationship sending module is specifically used to: upload the mapping relationship to the central server through a pre-built code transmission tunnel;
[0096] The central server performs the following operations:
[0097] Parsing the page modification code to generate a reference abstract syntax tree corresponding to the page modification code, extracting nodes from the reference abstract syntax tree to generate modification code vectors corresponding to the reference abstract syntax tree;
[0098] According to the target page identification information, acquiring each current page code vector of the project page from the target database;
[0099] Comparing each of the modified code vectors with each of the current page code vectors to determine a page modified portion code of the project page;
[0100] The page modification part code is compiled, and the compiled page modification part code is used to update the project current page code of the project page stored in the target database.
[0101] Optionally, the device further comprises:
[0102] A page code acquisition module, used to acquire a file resource path of the page code when a project page construction condition for the target engineering project is met, and acquire a project page code of the project page based on the file resource path; the project page includes the current page;
[0103] A code parsing module, used for parsing the project page code of the project page and generating a page abstract syntax tree corresponding to the project page code;
[0104] A vector generation module, used to extract nodes from 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] An identification information generating module, used for generating page identification information of the project page according to the file resource path of the project page;
[0106] The relationship storage module is used to establish a mapping relationship between the page identification information of the project page and each of the page code vectors, and store the mapping relationship in the target database to update the current page code of the project page stored in the target database.
[0107] Optionally, the device further comprises:
[0108] A component insertion module, used for inserting the code calling component 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;
[0109] The attribute assignment module is used to use the page identification information of the project page as the page identification attribute of the code calling component, and to use the project page code of the project page as the page code attribute of the code calling component.
[0110] Optionally, the device further comprises:
[0111] A determination request sending module, used for sending a code determination request to a central server before storing the mapping relationship in the target database, so as to request the central server to determine whether there is a page modification code of the project page in the code transmission tunnel within a preset time period;
[0112] A modification code acquisition module, configured to acquire the page modification code in the code transmission tunnel if the page modification code of the project page exists in the code transmission tunnel;
[0113] A code parsing module, used to parse the page modification code, generate a reference abstract syntax tree corresponding to the page modification code, and extract nodes from the reference abstract syntax tree to generate modification code vectors corresponding to the reference abstract syntax tree;
[0114] A vector determination module, used for determining whether each of the modified code vectors is consistent with each of the page code vectors;
[0115] A relationship storage module is used for executing the step of storing the mapping relationship in the target database if each of the modified code vectors is consistent with each of the page code vectors.
[0116] Optionally, the device further comprises:
[0117] The code replacement module is used to compile the page modification part code corresponding to the modification code vector if there is an inconsistency between each modification code vector and each page code vector, and use the compiled page modification part code to update the current page code of the project page stored in the target database.
[0118] The page rendering device provided in the embodiment of the present invention can execute the page rendering method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0119] Figure 3 A schematic diagram of the structure of an electronic device 30 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0120] like Figure 3As shown, the electronic device 30 includes at least one processor 31, and a memory connected to the at least one processor 31 in communication, such as a read-only memory (ROM) 32, a random access memory (RAM) 33, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 31 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 32 or the computer program loaded from the storage unit 38 to 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] A number of 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, speakers, etc.; a storage unit 38, such as a 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 may be a variety of general and / or special processing components with 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 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 executes the various methods and processes described above, such as a page rendering method.
[0123] In some embodiments, the page rendering method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 38. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 30 via the ROM 32 and / or the communication unit 39. When the computer program is loaded into the RAM 33 and executed by the processor 31, one or more steps of the page rendering method described above may be performed. Alternatively, in other embodiments, the processor 31 may be configured to perform the page rendering method in any other appropriate manner (e.g., by means of firmware).
[0124] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0125] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0126] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0127] To provide interaction with a user, the systems and techniques described herein may 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 trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0128] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may 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] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may 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 difficult management and weak business scalability in traditional physical hosts and VPS services.
[0130] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0131] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A page rendering method, characterized in that: include: When the current page of the target project meets the page rendering condition, a blocking page rendering operation is performed by calling a code component deployed in the page code of the current page, and the current page identification information of the current page is determined according to the page identification attribute of the code calling component; According to the current page identification information, it is determined whether there is a target page code in the target database in the latest update time period associated with the current page identification information; If so, the target page code is used to update the current page code of the current page to perform page rendering on the current page.
2. The method according to claim 1, characterized in that: The method further comprises: In response to a code debugging request of a relevant person for a project page in the target engineering project, the current page code of the project page is displayed through the page code attribute of the code calling component deployed in the project page, so that the relevant person can modify the current page code to obtain a page modification code; wherein the project page includes the current page; Determine the project page identification information of the project page according to the 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 is sent to a central server, so that the central server can 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.
3. The method according to claim 2, characterized in that The sending of the mapping relationship to the central server so that the central server updates 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 includes: Uploading the mapping relationship to the central server through a pre-built code transmission tunnel; The central server performs the following operations: Parsing the page modification code to generate a reference abstract syntax tree corresponding to the page modification code, extracting nodes from the reference abstract syntax tree to generate modification code vectors corresponding to the reference abstract syntax tree; According to the target page identification information, acquiring each current page code vector of the project page from the target database; Comparing each of the modified code vectors with each of the current page code vectors to determine a page modified portion code of the project page; The page modification part code 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.
4. The method according to claim 1, characterized in that: The method further comprises: When the project page construction condition for the target engineering project is met, the file resource path of the page code is obtained, and based on the file resource path, the project page code of the project page is obtained; the project page includes the current page; Parsing the project page code of the project page to generate a page abstract syntax tree corresponding to the project page code; Extracting nodes from the page abstract syntax tree, and generating page code vectors corresponding to the page abstract syntax tree based on the extracted syntax tree nodes; Generate page identification information of the project page according to the file resource path of the project page; A mapping relationship between the page identification information of the project page and each of the page code vectors 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.
5. The method according to claim 4, characterized in that The method further comprises: Inserting the code calling component 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; The page identification information of the project page is used as the page identification attribute of the code calling component, and the project page code of the project page is used as the page code attribute of the code calling component.
6. The method according to claim 4, characterized in that Before storing the mapping relationship in the target database, the method further includes: Sending a code determination request to a central server to request the central server to determine whether there is a page modification code of the project page in the code transmission tunnel within a preset time period; If it exists, obtaining the page modification code in the code transmission tunnel; Parsing the page modification code to generate a reference abstract syntax tree corresponding to the page modification code, extracting nodes from the reference abstract syntax tree to generate modification code vectors corresponding to the reference abstract syntax tree; Determining whether each of the modified code vectors is consistent with each of the page code vectors; If yes, the step of storing the mapping relationship in the target database is performed.
7. The method according to claim 6, characterized in that The method further comprises: If there is inconsistency between each modification code vector and each page code vector, the page modification partial code corresponding to the modification code vector is compiled, and the compiled page modification partial code is used to update the current page code of the project page stored in the target database.
8. A page rendering device, characterized in that: include: An identification information determination module is used to, when the current page of the target project meets the page rendering condition, perform a blocking page rendering operation by calling a code 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; A page code determination module, used for determining, based on the current page identification information, whether there is a target page code in the target database in the latest update time period associated with the current page identification information; The page rendering module is used to update the current page code of the current page with the target page code if there is a target page code in the latest update time period associated with the current page identification information in the target database, so as to render the current page.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; 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 so that the at least one processor can execute the page rendering method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the page rendering method according to any one of claims 1 to 7 when executed.
11. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the computer program implements the page rendering method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Page generation method and device, equipment and storage medium
CN111666526A
Browser optimization method and system, computer equipment and readable storage medium
CN113821751A
A page rendering method, apparatus, computer device, and storage medium
CN114579137B
Page offline rendering method and system, terminal equipment and storage medium
CN115544407A
File compiling system and method for low-code application program
CN116126347A
