Page updating method and device, electronic equipment and storage medium
By receiving and executing pseudo-instruction objects to update the page, the problems of high cost, difficulty, and low efficiency in page updates in existing technologies are solved, and efficient and low-cost page updates are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-18
- Publication Date
- 2026-06-26
AI Technical Summary
Existing technologies suffer from high costs, high difficulty, low efficiency, and low coverage in page updates, especially when using JavaScript and the Flutter framework, where performance bottlenecks and insufficient syntax support exist.
By receiving the target pseudo-instruction object sent by the compilation device, the pseudo-instruction object is run on the client using a preset runtime environment, and the running results are generated and applied to update the page, thus avoiding direct updates to the target application.
It reduces the cost and difficulty of page updates, improves the efficiency and coverage of updates, and achieves the effect of dynamic updates.
Smart Images

Figure CN116955875B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of computer technology, and specifically relates to a page update method, apparatus, electronic device and storage medium. Background Technology
[0002] In page update scenarios, related technologies typically use the operating system to provide a WebView to load the page, and use interpreted or just-in-time compiled programming languages (JavaScript, JS) to render the native user interface (UI) to update the page. Alternatively, the front-end compilation output, the Abstract Syntax Tree (AST), is sent to the client, which then parses and runs the AST to achieve page updates.
[0003] However, the JS approach relies on a JS engine to execute dynamic code and requires pre-embedded tags. Updating or adding tags requires version support, making page updates costly and difficult. In addition, there are performance bottlenecks in bridging communication between JS and the mobile application UI open source framework (Flutter). The AST approach requires symbol mapping of classes, methods, and variables in Flutter and updates them in advance along with the app, resulting in lower efficiency and accuracy of page updates. Furthermore, it cannot support all the features of the syntax of the programming language (Dart) on which Flutter depends, leading to lower page update coverage. Summary of the Invention
[0004] To address the aforementioned problems, this application provides a page updating method, apparatus, electronic device, and storage medium.
[0005] On the one hand, this application proposes a page update method, the method comprising:
[0006] The compiler receives a target pseudo-instruction object sent by the compiler device. The target pseudo-instruction object is obtained by the compiler device compiling the original data to be updated. The target pseudo-instruction object is used to represent the pseudo-instructions and objects generated during the compilation process of the original data to be updated. The original data to be updated is the data corresponding to the target page in the target application.
[0007] The target pseudo-instruction object is run based on a preset runtime environment to obtain the execution result of the target pseudo-instruction object; the preset runtime environment is set in the target application, and the target application with the preset runtime environment is compiled by the compilation device and then published to the local client;
[0008] The target page is updated based on the running results to obtain the updated target page.
[0009] On the other hand, this application proposes a page update method, which includes:
[0010] Retrieve the original data to be updated corresponding to the target page in the target application;
[0011] The original data to be updated is compiled to obtain a target pseudo-instruction object corresponding to the original data to be updated; the target pseudo-instruction object is used to characterize the pseudo-instructions and objects generated during the compilation process of the original data to be updated.
[0012] Send the target pseudo-instruction object to the client; cause the client to run the target pseudo-instruction object based on a preset runtime environment, and obtain the running result of the target pseudo-instruction object; the preset runtime environment is set in the target application, and the target application with the preset runtime environment is compiled by the compilation device and then published to the client; and cause the client to update the target page based on the running result, and obtain the updated target page.
[0013] On the other hand, this application proposes a page updating apparatus, which includes:
[0014] The receiving module is used to receive a target pseudo-instruction object sent by the compilation device; the target pseudo-instruction object is obtained by the compilation device compiling the original data to be updated, and the target pseudo-instruction object is used to represent the pseudo-instructions and objects generated during the compilation process of the original data to be updated, and the original data to be updated is the data corresponding to the target page in the target application.
[0015] The execution module is used to run the target pseudo-instruction object based on a preset execution environment and obtain the execution result of the target pseudo-instruction object; the preset execution environment is set in the target application, and the target application with the preset execution environment is compiled by the compilation device and then published to the local client;
[0016] The update module is used to update the target page based on the running results, so as to obtain the updated target page.
[0017] On the other hand, this application proposes a page updating apparatus, which includes:
[0018] The acquisition module is used to acquire the original data to be updated corresponding to the target page in the target application.
[0019] The compilation module is used to compile the original data to be updated to obtain the target pseudo-instruction object corresponding to the original data to be updated; the target pseudo-instruction object is used to characterize the pseudo-instructions and objects generated during the compilation process of the original data to be updated.
[0020] A sending module is configured to send the target pseudo-instruction object to the client; to enable the client to run the target pseudo-instruction object based on a preset runtime environment, and obtain the running result of the target pseudo-instruction object; the preset runtime environment is set in the target application, and the target application with the preset runtime environment is compiled by the compilation device and then published to the client; and to enable the client to update the target page based on the running result, and obtain the updated target page.
[0021] On the other hand, this application proposes an electronic device for page updating, which includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or at least one program is loaded and executed by the processor to implement the page updating method as described above.
[0022] On the other hand, this application proposes a computer-readable storage medium storing at least one instruction or at least one program, which is loaded and executed by a processor to implement the page update method as described above.
[0023] On the other hand, this application proposes a computer program product, including a computer program that, when run by a processor, implements the page update method described above.
[0024] The page update method, apparatus, electronic device, and storage medium proposed in this application receive a target pseudo-instruction object sent by a compilation device, run the target pseudo-instruction object based on a preset running environment, obtain the running result of the target pseudo-instruction object, and update the target page in the target application based on the running result to obtain the updated target page. This realizes the effect of compiling the original data to be updated into a target pseudo-instruction object, distributing and running the target pseudo-instruction object to achieve dynamic page updates. Thus, the target page in the target application can be updated without updating the target application, reducing the cost and difficulty of page updates and improving the efficiency and coverage of page updates. Attached Figure Description
[0025] To more clearly illustrate the technical solutions and advantages in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0026] Figure 1 This is a schematic diagram illustrating the implementation environment of a page update method according to an exemplary embodiment.
[0027] Figure 2 This is a flowchart illustrating a page update method according to an exemplary embodiment. Figure 1 .
[0028] Figure 3 This is a flowchart illustrating, according to an exemplary embodiment, a method for compiling raw data to be updated to obtain a target pseudo-instruction object corresponding to the raw data to be updated.
[0029] Figure 4 This is a flowchart illustrating a method for compiling an abstract syntax tree to obtain a target pseudo-instruction object, according to an exemplary embodiment.
[0030] Figure 5 This is a schematic diagram of an abstract syntax tree according to an exemplary embodiment.
[0031] Figure 6 This is a schematic diagram of a page update process according to an exemplary embodiment. Figure 2 .
[0032] Figure 7 This is a schematic diagram illustrating the integration of a preset operating environment with a target application according to an exemplary embodiment.
[0033] Figure 8 This is a flowchart illustrating, according to an exemplary embodiment, a method for running a target pseudo-instruction object based on a preset runtime environment and obtaining the execution result of the target pseudo-instruction object.
[0034] Figure 9 This is a schematic diagram of a runtime environment class according to an exemplary embodiment.
[0035] Figure 10 This is a flowchart illustrating, according to an exemplary embodiment, the execution results of obtaining pseudo-instruction objects corresponding to multiple nodes.
[0036] Figure 11 This is a flowchart illustrating, according to an exemplary embodiment, a method for executing preset instructions based on pseudo-instructions corresponding to multiple nodes to obtain the execution results of pseudo-instruction objects corresponding to multiple nodes.
[0037] Figure 12 This is a schematic diagram illustrating the execution of instructions according to an exemplary embodiment.
[0038] Figure 13 This is a schematic diagram illustrating an update of a page according to an exemplary embodiment.
[0039] Figure 14 This is a flowchart illustrating a page update method according to an exemplary embodiment. Figure 2 .
[0040] Figure 15 This is a flowchart illustrating a page update method according to an exemplary embodiment. Figure 4
[0041] Figure 16 This is a block diagram illustrating a page update apparatus according to an exemplary embodiment.
[0042] Figure 17 This is a block diagram illustrating another page updating device according to an exemplary embodiment.
[0043] Figure 18 This is a hardware structure block diagram of a page update server according to an exemplary embodiment. Detailed Implementation
[0044] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0045] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or server that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.
[0046] Figure 1 This is a schematic diagram illustrating an implementation environment for a page update method according to an exemplary embodiment. For example... Figure 1 As shown, the implementation environment may include at least a client 01 and a compilation device 02. The client 01 and the compilation device 02 may be directly or indirectly connected via wired or wireless communication, and this application does not impose any restrictions on this.
[0047] Specifically, the compilation device 02 is used to obtain the original data to be updated corresponding to the target page; to compile the original data to be updated to obtain the target pseudo-instruction object corresponding to the original data to be updated; and to send the target pseudo-instruction object to the client. Optionally, the compilation device 02 can be a smartphone, tablet, laptop, desktop computer, smart TV, smartwatch, etc., but is not limited to these.
[0048] Specifically, the client 01 is used to run the target pseudo-instruction object based on a preset runtime environment to obtain the execution result of the target pseudo-instruction object; and to update the target page based on the execution result to obtain the updated target page. As an example, the compilation device 02 can be a smartphone, tablet, laptop, desktop computer, smart TV, smartwatch, etc. As another example, the compilation device 02 can also be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.
[0049] It should be noted that, Figure 1 This is just one example. Other implementation environments may also be included in other scenarios.
[0050] The following describes the technical terms used in the embodiments of this application:
[0051] Flutter: An open-source UI framework for mobile applications that can be used to build user interfaces in mobile applications such as Android (developed by Google) and iOS (developed by Apple).
[0052] Dynamic updates: After a user installs the application (App), some user pages can be updated without updating the App in the app store, thereby saving data and enabling rapid distribution.
[0053] Dart: A programming language upon which Flutter relies. It is an object-oriented, class-defined, single-inheritance programming language.
[0054] Dart VM: The Dart language runtime environment, which is a collection of components that execute the Dart language.
[0055] Pseudo-instructions: The Conch framework abstracts classes that support specific Dart syntax features, containing variables describing those features and logical functions for executing them. The Conch framework is a dynamically updated framework, comprising Conch pseudo-instructions, a pseudo-instruction compiler (Conch compiler), and a pseudo-instruction runtime environment (Conch runtime environment).
[0056] Memory snapshot: This is a technique that serializes objects in a certain state in the Dart VM's memory to a file. Using this technique, objects in memory can be serialized into memory snapshot files for the corresponding platform (Android / iOS) during the compilation stage, and the objects in the serialized files can be quickly loaded into memory through the deserialization of the memory snapshot.
[0057] Figure 2 This is a flowchart illustrating a page update method according to an exemplary embodiment. Figure 1 This method can be used for Figure 1 In the implementation environment described in this specification, the method operation steps are as illustrated in the embodiments or flowcharts. However, based on conventional or non-inventive labor, more or fewer operation steps may be included. The order of steps listed in the embodiments is merely one possible order of execution among many steps and does not represent the only possible order. In actual system or server product operation, the method can be run in the order shown in the embodiments or drawings, or in parallel (e.g., in a parallel processor or multi-threaded processing environment). Specifically, as shown in the embodiments or drawings... Figure 2 As shown, the method may include:
[0058] S101. The compilation device obtains the raw data to be updated corresponding to the target page in the target application.
[0059] In this embodiment of the application, when it is necessary to dynamically update the target page in the target application, the compilation device can obtain the original data to be updated corresponding to the target page in the target application.
[0060] In one implementation, the client can send an update request carrying the identification information of the target page to the compilation device at a preset frequency (e.g., daily, weekly, monthly, etc.). In response to the update request, the compilation device obtains the original data to be updated corresponding to the target page based on the identification information.
[0061] In another implementation, when the target page on the client meets preset conditions, the client can send an update request carrying the identification information of the target page to the compilation device. The compilation device responds to the update request and obtains the original data to be updated corresponding to the target page based on the identification information. As an example, the preset conditions may include, but are not limited to: a product logic failure on the target page, or a visual UI failure on the target page.
[0062] Optionally, the target application is an application within a client application, which may include, but is not limited to, game applications, short video applications, instant messaging applications, shopping applications, etc. The target page may be a portion or all of the pages within the target application.
[0063] Alternatively, the original data to be updated can also be data on the target page that needs to be updated. As an example, the original data to be updated can be Dart source code that needs to be dynamically updated.
[0064] Optionally, the original data to be updated can also be annotated with Conch annotations. These Conch annotations are specific annotations provided by the Conch framework and are used to identify data that needs to be dynamically updated. By annotating with Conch annotations, the compilation device can accurately and quickly identify the data that needs to be compiled, improving compilation speed and page update speed.
[0065] S103. The above-mentioned compilation device compiles the original data to be updated to obtain the target pseudo-instruction object corresponding to the original data to be updated; the target pseudo-instruction object is used to characterize the pseudo-instructions and objects generated during the compilation process of the original data to be updated.
[0066] Optionally, this pseudo-instruction can be a class abstracted by the Conch framework based on Dart syntax features, supporting a specific Dart syntax, containing variables describing that feature and logical functions for executing that feature. This object can include, but is not limited to: a class object (Class object) that records class information, a method object (TMethod object) that records method information, etc.
[0067] Optionally, the compilation device may compile the original data to be updated in various ways, and the embodiments of this application do not specifically limit it here.
[0068] Figure 3 This is a flowchart illustrating an exemplary embodiment of compiling raw data to be updated to obtain a target pseudo-instruction object corresponding to the raw data to be updated. Figure 3 As shown, in an optional embodiment, in step S103 above, the compilation device compiles the original data to be updated to obtain the target pseudo-instruction object corresponding to the original data to be updated, which may include:
[0069] S1031. The compilation device compiles the original data to be updated and obtains the abstract syntax tree corresponding to the original data to be updated.
[0070] S1033. The compiler compiles the abstract syntax tree to obtain the target pseudo-instruction object.
[0071] Optionally, in step S1031 above, the compilation device can use the front-end compilation tools provided by Flutter to compile the original data to be updated into an AST. Taking the original data to be updated as Dart source code as an example, the front-end compilation tools provided by Flutter can be used to compile the Dart source code marked with the Conch annotation into an AST.
[0072] In a specific embodiment, the process of compiling the original data to be updated into an abstract syntax tree in S1031 above can be as follows:
[0073] 1) Parse the original data to be updated (e.g., Dart source code) using Hypertext Markup Language (HTML) to obtain the corresponding object model. The original data to be updated consists of many tags; for example, the tags may include <html>, <body>, <img ...img>, , , , , , , , , , , , , , , <img 、 wait.
[0074] 2) Traverse the child elements of each node in the object model to obtain the label array corresponding to each node. The label array can include the child elements of each node, the labels of the child elements of each node, and the attributes of the child elements of each node.
[0075] 3) Perform semantic analysis on the label array of each layer of nodes. This semantic analysis includes performing regular expression matching on the label array of each layer of nodes to obtain the object array of each layer of nodes.
[0076] 4) Determine the corresponding object arrays for multi-level nodes based on the object arrays corresponding to each level node, thereby converting the original data to be updated into an AST.
[0077] Optionally, in step S1033 above, the compilation device can further compile and link the abstract syntax tree using a pseudo-instruction compilation tool to obtain the target pseudo-instruction object.
[0078] In this embodiment of the application, the original data to be updated is compiled into an abstract syntax tree. Since the abstract syntax tree can represent the syntax structure of a programming language in a tree-like form, each node in the tree can represent a structure in the source code. By further compiling and linking the abstract syntax tree, the generation accuracy and efficiency of the target pseudo-instruction object can be improved, thereby improving the accuracy and efficiency of page updates.
[0079] Figure 4 This is a flowchart illustrating a compilation abstract syntax tree to obtain a target pseudo-instruction object, as shown in an exemplary embodiment. Figure 4 As shown, in a feasible embodiment, the abstract syntax tree includes multiple nodes, each node representing a data structure in the original data to be updated. In step S1033, the compilation device compiles the abstract syntax tree to obtain a target pseudo-instruction object, which may include:
[0080] S10331. The compilation device creates object processing modules for each of the multiple nodes according to their respective types.
[0081] S10333. The compilation device processes the data structures represented by each of the multiple nodes based on the object processing modules of each node, and obtains the objects corresponding to each node.
[0082] S10335. The compilation device assigns a pseudo-instruction to the object processing module of each of the multiple nodes, thereby obtaining the pseudo-instructions corresponding to each of the multiple nodes; the pseudo-instructions are obtained by abstracting the syntactic features of the preset programming language.
[0083] S10337. The compiler device determines the pseudo-instructions and objects corresponding to each of the multiple nodes as pseudo-instruction objects corresponding to each of the multiple nodes.
[0084] S10339. The compiler generates a target pseudo-instruction object based on the pseudo-instruction objects corresponding to multiple nodes.
[0085] Optionally, if the abstract syntax tree includes multiple nodes, each node representing the data structure in the original data to be updated, then in step S10331 above, the pseudo-instruction compilation tool in the compilation device can create object handlers for each node according to the type of each node.
[0086] Optionally, in step S10333 above, the compilation device can process the data structure represented by each node according to the object processing module of each node to obtain the object corresponding to each node.
[0087] In a specific embodiment, in S10333 above, the compilation device processes the data structures represented by each of the multiple nodes based on the object processing modules of each node to obtain the objects corresponding to each node, which may include:
[0088] The compilation device obtains the hierarchical structure of each node in the abstract syntax tree.
[0089] The compiler determines the order in which objects are generated for each of the multiple nodes based on the hierarchical structure.
[0090] The compilation device processes the data structures represented by each node according to the object generation order, based on the object processing modules of each node, to obtain the objects corresponding to each node.
[0091] Figure 5 This is a schematic diagram of an abstract syntax tree according to an exemplary embodiment. For example... Figure 5 As shown, the abstract syntax tree can include the following nodes: first node (Class), second node (Constructor), third node (procedure), fourth node (field), fifth node (Initializer), sixth node (function node), seventh node (variable declaration), eighth node (statement), and ninth node (expression).
[0092] During compilation, the pseudo-instruction compiler in the compilation device can determine the object generation order based on the hierarchical structure of each node in the abstract syntax tree. For example, if the first node is the root node, then the object generation order of the first node is first; if the second, third, and fourth nodes are children of the first node, then the object generation order of the second, third, and fourth nodes is second; if the sixth node is a child of the second and third nodes and the fifth node is a child of the second node, then the object generation order of the sixth and fifth nodes is third; if the seventh node is a child of the sixth node, then the object generation order of the seventh node is fourth; the object generation order of the eighth node is fifth; and the object generation order of the ninth node is sixth.
[0093] According to the object generation order described above, the object processing modules of each node in the compilation device process the data structure represented by each node sequentially to obtain the corresponding object for each node. For example, according to the object processor corresponding to the first node, the data represented by the first node is processed to obtain a class object (TClass object), which is used to record class information. Through the object processor corresponding to the second node, the data represented by the second node is processed to obtain a method object (TMethod), which is used to record constructor information. Through the object processor corresponding to the fourth node, the data represented by the fourth node is processed to obtain a field object (TField object), which is used to record corresponding variable information, etc. By using the object generation order determined by the hierarchical structure, the objects corresponding to multiple nodes are generated sequentially according to the object processing modules of multiple nodes. This eliminates the need to consider node depth and branching complexity, improving the accuracy and efficiency of object generation, thereby improving the accuracy and efficiency of determining the target pseudo-instruction object, and ultimately improving the speed and efficiency of page updates.
[0094] Optionally, in step S10335 above, the compilation device can assign a pseudo-instruction to the object processing module of each of the multiple nodes, thus obtaining the pseudo-instructions corresponding to each of the multiple nodes. For example, for Figure 5 The object processing module of the first node in the process assigns a pseudo-instruction, obtains the pseudo-instruction corresponding to the first node, and then... Figure 5 The object processing module of the second node in the process is given a pseudo-instruction, and the pseudo-instruction corresponding to the second node is obtained.
[0095] It should be noted that these pseudo-instructions can be pre-abstracted by the account corresponding to the compilation device, utilizing the dynamic features of the syntax of a preset programming language. As an example, the preset programming language could be Dart. By leveraging the dynamic features of Dart and exposing these dynamic features in the Flutter engine and Dart VM, a set of Dart pseudo-instructions can be abstracted. Accordingly, these pseudo-instructions can include, but are not limited to:
[0096] TNewOperator: Object creation instructions that cover all Dart object building scenarios.
[0097] TCallOperator: Method invocation instruction, covering all method invocation scenarios in Dart.
[0098] TInitParamOperator: Initialization parameter instruction, corresponding to the Dart variable initialization scenario.
[0099] TInitTypeOperator: Initialize type instructions.
[0100] TInitFunctionOperator: Initialization method instruction, which constructs the corresponding method.
[0101] TGetFieldOperator: A command to retrieve variables, covering all variable retrieval scenarios in Dart.
[0102] TSetFieldOperator: A variable setting instruction that covers all variable setting scenarios in Dart.
[0103] TJumpOperator: A conditional jump instruction that jumps to the nth instruction if the result is true.
[0104] TConditionOperator: Conditional operation instruction, corresponding to the if and ternary operators in Dart.
[0105] TLogicalOperator: Logical expression instructions, corresponding to all logical calculations in Dart, such as &&, ||, ==, etc.
[0106] TISOperator: Lists instructions (IS instructions) to adapt to the is keyword in Dart syntax.
[0107] TConcatOperator: A string concatenation instruction used to match the ${} syntax in Dart strings.
[0108] TTryCatchFinallyOperator: Exception handling instruction (try catch instruction), corresponding to Darttrycatch syntax.
[0109] TCatchOperator: Specifies the signal catch instruction (Catch instruction).
[0110] TThrowOperator: Exception throwing instruction (Throw instruction), corresponding to the Dart throw keyword.
[0111] TReturnOperator: Return instruction (Return instruction), corresponding to the Dart return keyword.
[0112] TBlockOperator: Creates block instructions, corresponding to the {} keyword in Dart.
[0113] TLabelOperator: A variable or symbol type definition instruction (Label instruction) used to jump to a specified code scene.
[0114] TBreakOperator: The command to exit the loop (Break command), corresponding to the Dart Break jump scene.
[0115] TForOperator: A For loop instruction used in For loop scenarios.
[0116] TForInOperator: A ForIn loop instruction used in ForIn loop scenarios.
[0117] TLoopOperator: A while loop instruction used in while loop scenarios.
[0118] TSwitchOperator: Hostname / system name setting command (Switch command), used in Switch keyword scenarios.
[0119] TAwaitOperator: Await instruction, used in Await call scenarios.
[0120] Optionally, in step S10337 above, since the pseudo-instructions and objects corresponding to each node have already been obtained in the previous steps, the pseudo-instructions and objects corresponding to each node of the compilation device are used as the pseudo-instruction objects corresponding to each node. In step S10339 above, the compilation device can merge and summarize the pseudo-instruction objects corresponding to each node to obtain the target pseudo-instruction object. Continuing with... Figure 4 For example, the pseudo-instruction and class object corresponding to the first node can be used as the pseudo-instruction object corresponding to the first node. The method for determining the pseudo-instruction objects of other nodes is similar to that of the first node. Finally, the pseudo-instruction objects of the first node and other nodes are merged and summarized to obtain the target pseudo-instruction object.
[0121] In this embodiment, the object processing module based on node type creates the objects and pseudo-instructions for each node, eliminating the need to consider node depth and forking complexity. This solves the problem of complex syntax, improves the accuracy and efficiency of determining the pseudo-instruction objects corresponding to multiple nodes, thereby improving the accuracy and efficiency of determining the target pseudo-instruction object, and ultimately improving the speed and efficiency of page updates.
[0122] S105. The above-mentioned compilation device sends the target pseudo-instruction object to the client.
[0123] Optionally, the compilation device can send the target pseudo-instruction object to the client via wired or wireless means, and this application embodiment does not specifically limit this.
[0124] Figure 6 This is a schematic diagram of a page update process according to an exemplary embodiment. Figure 2 ,like Figure 6 As shown, in a feasible embodiment, in step S105 above, the compilation device sends the target pseudo-instruction object to the client, which may include:
[0125] S1051. The compiler serializes the target pseudo-instruction object to obtain a memory snapshot file corresponding to the target pseudo-instruction object.
[0126] S1053. The compilation device sends a memory snapshot file to the client.
[0127] Optionally, serialization refers to the process of converting the state information of an object into a form that can be stored or transmitted. During serialization, the object writes its current state to a temporary or persistent storage area. In step S1051 above, the compilation device may be equipped with a memory snapshot tool, which can be used to serialize the pseudo-instructions and objects represented by the target pseudo-instruction object into a memory snapshot file, that is, to convert the pseudo-instructions and objects into a form that can be stored or transmitted.
[0128] Optionally, in step S1053 above, the compilation device can send the memory snapshot file to the client wirelessly or via wired connection. This embodiment of the application does not specifically limit this.
[0129] In this embodiment, the target pseudo-instruction object is serialized to obtain a memory snapshot file, thereby converting the target pseudo-instruction object into data that can be transmitted and stored. This facilitates the compilation device in sending the target pseudo-instruction object to the client, improving the transmission convenience and security of the target pseudo-instruction object.
[0130] Optionally, continue as follows Figure 6 As shown, after step S105 and before step S107, the method may further include:
[0131] S106. The client deserializes the memory snapshot file to obtain the target pseudo-instruction object.
[0132] Deserialization refers to the process of reconstructing an object from the serialized result.
[0133] For example, after the client receives the memory snapshot file, the client can be equipped with a deserialization tool. The client uses this deserialization tool to deserialize the memory snapshot file into a target pseudo-instruction object, thereby accurately loading the target pseudo-instruction object into the target application.
[0134] S107. The client runs the target pseudo-instruction object based on the preset runtime environment and obtains the execution result of the target pseudo-instruction object; the preset runtime environment is set in the target application, and the target application with the preset runtime environment is compiled by the compilation device and then published to the client.
[0135] First, the deployment process of the target application will be introduced:
[0136] In this embodiment, a preset runtime environment can be predefined. This preset runtime environment and the FlutterFramework are released with the App version, thereby providing a basic runtime environment for dynamic page updates. As an example, a preset runtime environment for the Dart language can be abstracted by leveraging the dynamic features of the Dart language and exposing these dynamic features in the Flutter engine and Dart VM.
[0137] During the app release phase, the app first requires a Flutter runtime environment, which includes DartVm and the Flutter engine environment (FlutterEngine) as the basic runtime environment. Flutter itself does not provide dynamic update capabilities; dynamic update capabilities are implemented by the Conch framework. Therefore, a preset runtime environment (i.e., the Conch runtime environment) can be predefined and integrated into the app. Figure 7 This is a schematic diagram illustrating the integration of a preset operating environment with a target application according to an exemplary embodiment, such as... Figure 7 As shown, FlutterEngine, Dart VM, and the default runtime environment all need to be integrated during the App release phase and released and updated in the app store along with the App version. The pages and their business logic in the App can be dynamically distributed without needing to be released with the App.
[0138] Optionally, in step S107 above, after the client receives the target pseudo-instruction object sent by the compilation device, it can run the target pseudo-instruction object according to the preset runtime environment integrated in the target application to obtain the running result of the target pseudo-instruction object.
[0139] Optionally, the client can use various methods to run the target pseudo-instruction object and obtain the running result of the target pseudo-instruction object. This application embodiment does not make specific limitations here.
[0140] Figure 8 This is a flowchart illustrating, according to an exemplary embodiment, a method for running a target pseudo-instruction object based on a preset runtime environment and obtaining the execution result of the target pseudo-instruction object, such as... Figure 8 As shown, in a feasible embodiment, the aforementioned preset operating environment includes an operating environment class. Therefore, in step S107, the client runs the target pseudo-instruction object based on the preset operating environment to obtain the running result of the target pseudo-instruction object, which may include:
[0141] S1071. The client stores the parameter information of the pseudo-instructions corresponding to each of the multiple nodes and the objects corresponding to each of the multiple nodes in the runtime environment class; the objects corresponding to each of the multiple nodes include method objects.
[0142] Optionally, the preset runtime environment can be predefined by the account corresponding to the test device, and it may include a runtime environment class. Figure 9 This is a schematic diagram of a runtime environment class according to an exemplary embodiment, such as... Figure 9 As shown, this runtime environment class can include, but is not limited to:
[0143] TClass: Description information for dynamic classes.
[0144] TMethod: Descriptive information for the dynamic method Conch; the method body will be compiled into a pseudo-instruction set (operator_list).
[0145] TField: Conch variable description information.
[0146] TOperator: The base class for Conch pseudo-instructions, used to record runtime information for each instruction.
[0147] TParam: Conch parameter description information, used to record the parameters used in each pseudo-instruction.
[0148] Optionally, the client can map and associate the target pseudo-instruction object with the runtime environment class in the preset runtime environment, so as to store the parameter information of the pseudo-instruction corresponding to multiple nodes and the objects corresponding to multiple nodes in the above-mentioned runtime environment class, that is, to establish a one-to-one correspondence between the target pseudo-instruction object and the runtime environment class in the preset runtime environment.
[0149] For example, classes in Dart are compiled into corresponding TClass objects, methods within those classes are compiled into TMethod objects and stored in the method list (method_liest), and variables declared within the class are compiled into TField objects and stored in the variable list (field_list). The TMethod object contains all the instructions compiled from the corresponding Dart method body and can be stored in the operation list (operate_list) array. The parameters used by each pseudo-instruction can be recorded in TParam. This establishes a one-to-one correspondence between the target pseudo-instruction object and the runtime environment class in the preset runtime environment.
[0150] S1073. Based on the pseudo-instructions corresponding to each of the multiple nodes, the client calls the method objects in the objects corresponding to each of the multiple nodes from the runtime environment class to obtain the execution results of the pseudo-instruction objects corresponding to each of the multiple nodes.
[0151] Optionally, since the objects corresponding to each of the multiple nodes include method objects (i.e., TMethod objects), and the objects corresponding to each of the multiple nodes are stored in the runtime environment class, after establishing the association storage with the runtime environment class, the client can call the method objects in the objects corresponding to each of the multiple nodes from the runtime environment class through the pseudo-instructions corresponding to each of the multiple nodes, and obtain the execution results of the pseudo-instruction objects corresponding to each of the multiple nodes.
[0152] Figure 10 This is a flowchart illustrating, according to an exemplary embodiment, how to obtain the execution results of pseudo-instruction objects corresponding to multiple nodes, such as... Figure 10 As shown, in step S1073 above, the client, based on the pseudo-instructions corresponding to each of the multiple nodes, calls the method objects in the objects corresponding to each of the multiple nodes from the runtime environment class to obtain the execution results of the pseudo-instruction objects corresponding to each of the multiple nodes, which may include:
[0153] S10731. The client obtains the preset instructions included in the method objects corresponding to each of the multiple nodes from the runtime environment class; the preset instructions are obtained by compiling the method objects.
[0154] S10733. The client executes the above-mentioned preset instructions based on the pseudo-instructions corresponding to each of the multiple nodes, and obtains the execution results of the pseudo-instruction objects corresponding to each of the multiple nodes.
[0155] Optionally, since all the pre-compiled Dart method bodies contained in the method objects corresponding to each of the multiple nodes are stored in the operation list array, in step S10731 above, the client can obtain the pre-compiled instructions included in the method objects corresponding to each of the multiple nodes from the operation_list in the runtime environment class. In step S10733 above, the client can run the pre-compiled instructions included in the method objects corresponding to each of the multiple nodes based on the pseudo-instructions corresponding to each of the multiple nodes, and obtain the execution results of the pseudo-instruction objects corresponding to each of the multiple nodes. Thus, the pseudo-instructions corresponding to each of the multiple nodes obtain the execution results of the corresponding method objects, completing the invocation of the corresponding method objects.
[0156] In this embodiment, based on the pseudo-instructions corresponding to each of multiple nodes, the preset instructions included in the corresponding method object are executed to obtain the execution result of the corresponding pseudo-instruction object. This realizes the use of the dynamic features of the Dart language and the opening of dynamic features in the Flutter engine and Dart VM. By abstracting a set of Dart language pseudo-instructions and its execution environment, the page can be dynamically updated. This not only avoids the bridging performance bottleneck problem of using JS solutions, but also avoids the disadvantage that the front-end products cannot support all Dart syntax features. This reduces the difficulty and cost of page updates and improves the efficiency and coverage of page updates.
[0157] Figure 11 This is a flowchart illustrating an exemplary embodiment of a process for executing preset instructions based on pseudo-instructions corresponding to multiple nodes, and obtaining the execution results of pseudo-instruction objects corresponding to multiple nodes. Figure 11 As shown, in an exemplary embodiment, in step S10733 above, the number of preset instructions is multiple, and the multiple preset instructions are arranged in sequence. The client runs the preset instructions based on the pseudo-instructions corresponding to each of the multiple nodes to obtain the running results of the pseudo-instruction objects corresponding to each of the multiple nodes, which may include:
[0158] S107331. The client takes the first preset instruction among the above preset instructions as the current instruction corresponding to each of the multiple nodes, and removes the current instruction from the multiple preset instructions.
[0159] S107333. The client executes the current instruction based on the pseudo-instructions corresponding to multiple nodes, and obtains the execution result of the current instruction.
[0160] S107335. The client repeats the above operation of taking the first preset instruction among multiple preset instructions as the current instruction corresponding to each of the multiple nodes, removing the current instruction from the multiple preset instructions, and running the current instruction based on the pseudo instructions corresponding to each of the multiple nodes to obtain the running result of the current instruction, until the running results of the multiple preset instructions corresponding to each of the multiple nodes are obtained.
[0161] S107337. The client generates the execution results of pseudo-instruction objects corresponding to multiple nodes based on the execution results of multiple preset instructions corresponding to multiple nodes.
[0162] Optionally, in step S107331 above, when the method objects corresponding to multiple nodes are called, a temporary variable map can be created. This temporary variable map can be used to record variables generated during instruction execution. When there are multiple preset instructions, a special pointer can be defined to record the currently running instruction. For example, if the multiple nodes each correspond to preset instructions, which are instructions in a preset instruction set (this preset instruction set can be operaotr_list), the pointer can point to the first instruction in the operaotr_list recorded by the method object. That is, the terminal can take the first preset instruction in the preset instruction set as the current instruction and remove the current instruction from the preset instruction set.
[0163] Optionally, in step S107333 above, the client executes the corresponding current instruction based on the pseudo-instructions of multiple nodes to obtain the execution result of the current instruction. Variables generated during the execution of the current instruction can be recorded in a temporary variable Map.
[0164] Optionally, in step S107335 above, the client can repeat steps S107331-S107333 until the execution results of multiple preset instructions corresponding to each of the multiple nodes are obtained. As an example, when the preset instructions corresponding to each of the multiple nodes are instructions in a preset instruction set (which can be operatr_list), the above repetition process can be stopped when the execution result corresponding to each preset instruction in the preset instruction set corresponding to each of the multiple nodes is obtained.
[0165] Optionally, in step S107337 above, the client can merge and summarize the execution results of multiple preset instructions corresponding to multiple nodes to obtain the execution results of pseudo-instruction objects corresponding to multiple nodes.
[0166] The following examples illustrate steps S107331 to S107337:
[0167] Continue as Figure 6 As shown, assuming multiple nodes include a first node, the method body of the method object corresponding to the first node is compiled into `operator_list1`. `operator_list1` includes instructions 1, 2, and 3 arranged in sequence. When the pseudo-instruction corresponding to the first node calls the method object corresponding to the first node, the pointer first points to instruction 1, making instruction 1 the current instruction, and removes instruction 1 from `operator_list1`. The client runs instruction 1 based on the pseudo-instruction corresponding to the first node, obtaining the result of instruction 1. At this point, instruction 2 is at the top of the sorted list in `operator_list1`, so the pointer can then point to instruction 2, making instruction 2 the current instruction, and remove instruction 2 from `operator_list1`. The client runs instruction 2 based on the pseudo-instruction corresponding to the first node, obtaining the result of instruction 2. Similarly, instruction 3 is at the top of the sorted list in `operator_list1`, so the pointer can then point to instruction 3, making instruction 3 the current instruction, and remove instruction 3 from `operator_list1`. The client runs instruction 3 based on the pseudo-instruction corresponding to the first node, obtaining the result of instruction 3. Finally, the execution results of instruction 1, instruction 2, and instruction 3 are used as the execution results of the pseudo-instruction object corresponding to the first node.
[0168] In this embodiment, when there are multiple preset instructions, each preset instruction can be executed sequentially according to its sorting order, which improves the accuracy and efficiency of preset instruction execution, thereby improving the efficiency and accuracy of determining the running results of the pseudo-instruction objects corresponding to each node, and further improving the efficiency and accuracy of page updates.
[0169] In a specific embodiment, in step S107333 above, the client executes the current instruction based on the pseudo-instructions corresponding to multiple nodes to obtain the execution result of the current instruction, which may include:
[0170] When the current instruction includes the target instruction set, the client executes the instructions in the target instruction set in a preset order based on the pseudo-instructions corresponding to multiple nodes, and obtains the execution result of the current instruction.
[0171] Optionally, if the current instruction includes the target instruction set, it indicates that the current instruction itself contains multiple other instructions, meaning the current instruction is nested with other instructions. The client can execute the instructions in the target instruction set sequentially according to a preset order based on the pseudo-instructions corresponding to multiple nodes to obtain the execution result of the current instruction. After the client has executed all the instructions in the target instruction set, it returns to execute other instructions from among multiple preset instructions.
[0172] Optionally, the target instruction set can also be an operator_list, meaning that the current instruction set contains nested operator_list instructions. Correspondingly, the preset order can be top-down, meaning that the instructions in the target instruction set are executed sequentially from top to bottom.
[0173] The following example illustrates step S107333 above. Figure 12 This is a schematic diagram illustrating the execution of instructions according to an exemplary embodiment. For example... Figure 12 As shown, instruction 5 includes a target instruction set. When the current instruction is instruction 5, the pointer will point to the target instruction set corresponding to instruction 5. Then, the instructions in the target instruction set will be executed sequentially from top to bottom. After all the instructions in the target instruction set have been executed, the pc pointer will return to the method object and continue to execute the subsequent preset instructions in the method object. Thus, the pseudo-instruction obtains the execution result of the method and completes the method call.
[0174] In this embodiment, when the current instruction includes a target instruction set, it can point to the instructions in the target instruction set. After all the instructions in the target instruction set have been executed, it returns to the method object to continue executing subsequent preset instructions, thus avoiding the omission of instructions and further improving the accuracy and efficiency of instruction execution. This improves the efficiency and accuracy of determining the execution results of the pseudo-instruction objects corresponding to each node, thereby improving the efficiency and accuracy of page updates.
[0175] S1075. The client generates the execution result of the target pseudo-instruction object based on the execution results of the pseudo-instruction objects corresponding to multiple nodes.
[0176] Optionally, after obtaining the execution results of the pseudo-instruction objects corresponding to multiple nodes, the execution results of the pseudo-instruction objects corresponding to multiple nodes can be merged and summarized to obtain the execution result of the target pseudo-instruction object.
[0177] S109. The above client updates the target page based on the above operation results, and obtains the updated target page.
[0178] Optionally, the client can update the original data to be updated in the target page based on the execution results to obtain the updated target page. As an example, after each preset instruction is executed logically, a corresponding Widget tree can be constructed and displayed based on the execution results of the pseudo-instruction objects corresponding to multiple nodes, thereby updating the target page and obtaining the updated target page. Here, the Widget tree is a tree-like structure used to create UI elements.
[0179] For example, in step S109 above, the client updates the target page based on the above running result to obtain the updated target page, which may include:
[0180] The corresponding Widget tree is constructed based on the execution results of the pseudo-instruction objects corresponding to multiple nodes. An Element tree is generated based on the Widget tree. An Element refers to an instantiated object of a Widget at a specific position in the UI tree. Finally, a rendering tree is generated based on the Element tree to complete the update of the target page.
[0181] The page update method provided in this application utilizes the dynamic features of the Dart language and exposes these dynamic features in the Flutter engine and Dart VM. It abstracts a set of pseudo-instructions and their runtime environment for the Dart language, compiles the Dart source code to obtain the pseudo-instruction set, and distributes and runs these pseudo-instructions to solve the problem of dynamically updating pages in Flutter using custom pseudo-instructions. Using the solution in this application for dynamic page updates allows updating the target page in the target application without updating the target application itself. This avoids the bridging problems associated with using JS solutions and the limitation that front-end artifacts cannot support all Dart syntax features, thus achieving both performance and completeness in page updates. Using the solution in this application for page updates reduces the size of dynamic page artifacts by 20%-30% and improves page loading speed by approximately 30%.
[0182] Figure 13 This is a schematic diagram illustrating an example of updating a page, according to an exemplary embodiment. Figure 13 As shown, the page update method of this application embodiment can dynamically update the target page in the target application without updating the target application version, thereby reducing the difficulty and cost of page updates and improving the efficiency and coverage of page updates.
[0183] The following describes the page update method in the embodiments of this application, with the client as the execution subject:
[0184] Figure 14 This is a flowchart illustrating a page update method according to an exemplary embodiment. Figure 3 .like Figure 14 As shown, the page update method may include:
[0185] S201. Receive the target pseudo-instruction object sent by the compilation device; the target pseudo-instruction object is obtained by the compilation device compiling the original data to be updated, and the target pseudo-instruction object is used to represent the pseudo-instructions and objects generated during the compilation process of the original data to be updated, and the original data to be updated is the data corresponding to the target page in the target application.
[0186] S203. Run the target pseudo-instruction object based on the preset runtime environment to obtain the execution result of the target pseudo-instruction object; the preset runtime environment is set in the target application, and the target application with the preset runtime environment is compiled by the compilation device and then published to the local client.
[0187] S205. Update the target page based on the above operation results to obtain the updated target page.
[0188] In an optional embodiment, the target pseudo-instruction object is obtained by compiling an abstract syntax tree using the compilation device. The abstract syntax tree includes multiple nodes, each node representing a data structure in the original data to be updated. The preset runtime environment includes a runtime environment class. The execution result of the target pseudo-instruction object based on the preset runtime environment includes:
[0189] The parameter information of the pseudo-instructions corresponding to each of the above-mentioned nodes and the objects corresponding to each of the above-mentioned nodes are stored in the above-mentioned runtime environment class; the objects corresponding to each of the above-mentioned nodes include method objects.
[0190] Based on the pseudo-instructions corresponding to each of the above nodes, the method objects in the objects corresponding to each of the above nodes are called from the above runtime environment class to obtain the execution results of the pseudo-instruction objects corresponding to each of the above nodes.
[0191] Based on the execution results of the pseudo-instruction objects corresponding to the above multiple nodes, the execution result of the above target pseudo-instruction object is generated.
[0192] Specifically, the pseudo-instructions corresponding to each of the aforementioned nodes are obtained by the compilation device assigning pseudo-instructions to the object processing modules of the aforementioned nodes; the objects corresponding to each of the aforementioned nodes are obtained by the compilation device processing the data structures represented by the aforementioned nodes based on the object processing modules of the aforementioned nodes; the object processing modules of the aforementioned nodes are created by the compilation device according to the types corresponding to the aforementioned nodes; and the pseudo-instruction objects corresponding to the aforementioned nodes are determined by the compilation device based on the pseudo-instructions and objects corresponding to the aforementioned nodes.
[0193] In an optional embodiment, the above-mentioned method object in the object corresponding to each of the plurality of nodes is called from the runtime environment class based on the pseudo-instructions corresponding to each of the plurality of nodes to obtain the execution result of the pseudo-instruction object corresponding to each of the plurality of nodes, including:
[0194] From the above runtime environment class, obtain the preset instructions included in the method objects corresponding to each of the above nodes; the preset instructions are obtained by compiling the above method objects.
[0195] The preset instructions are executed based on the pseudo-instructions corresponding to each of the multiple nodes, and the execution results of the pseudo-instruction objects corresponding to each of the multiple nodes are obtained.
[0196] In an optional embodiment, the number of preset instructions is multiple, and the multiple preset instructions are arranged in sequence. The execution of the preset instructions based on the pseudo-instructions corresponding to each of the multiple nodes to obtain the execution results of the pseudo-instruction objects corresponding to each of the multiple nodes includes:
[0197] The first preset instruction among the above preset instructions is taken as the current instruction corresponding to each of the above nodes, and the current instruction is removed from the above preset instructions.
[0198] The current instruction is executed based on the pseudo-instructions corresponding to each of the above nodes, and the execution result of the current instruction is obtained.
[0199] Repeat the above operation of taking the first preset instruction in the multiple preset instructions as the current instruction corresponding to each of the multiple nodes, and removing the current instruction from the multiple preset instructions, until the execution result of the current instruction is obtained, until the execution result of the multiple preset instructions corresponding to each of the multiple nodes is obtained.
[0200] Based on the execution results of the multiple preset instructions corresponding to each of the above nodes, the execution results of the pseudo-instruction objects corresponding to each of the above nodes are generated.
[0201] In an optional embodiment, the above-mentioned execution of the current instruction based on the pseudo-instructions corresponding to each of the plurality of nodes to obtain the execution result of the current instruction includes:
[0202] When the current instruction includes the target instruction set, the instructions in the target instruction set are executed sequentially according to a preset order based on the pseudo-instructions corresponding to the multiple nodes, and the execution result of the current instruction is obtained.
[0203] In an optional embodiment, the target pseudo-instruction object sent by the receiving compilation device includes:
[0204] Receive the memory snapshot file sent by the aforementioned compilation device; the aforementioned memory snapshot file is obtained by the aforementioned compilation device through serialization processing of the aforementioned target pseudo-instruction object.
[0205] Before running the target pseudo-instruction object based on the preset runtime environment, the method further includes:
[0206] The memory snapshot file is deserialized to obtain the target pseudo-instruction object.
[0207] The following describes the page update method in the embodiments of this application, taking the compilation device as the execution subject:
[0208] Figure 15 This is a flowchart illustrating a page update method according to an exemplary embodiment. Figure 4 .like Figure 15 As shown, the page update method may include:
[0209] S301. Obtain the original data to be updated corresponding to the target page in the target application.
[0210] S303. Compile the above-mentioned original data to be updated to obtain the target pseudo-instruction object corresponding to the above-mentioned original data to be updated; the above-mentioned target pseudo-instruction object is used to represent the pseudo-instructions and objects generated during the compilation process of the above-mentioned original data to be updated.
[0211] S305. Send the aforementioned target pseudo-instruction object to the client; so that the client runs the aforementioned target pseudo-instruction object based on a preset runtime environment and obtains the execution result of the aforementioned target pseudo-instruction object; the aforementioned preset runtime environment is set in the aforementioned target application, and the aforementioned target application with the aforementioned preset runtime environment is compiled by the aforementioned compilation device and then published to the aforementioned client; and so that the aforementioned client updates the aforementioned target page based on the aforementioned execution result and obtains the updated target page.
[0212] In an optional embodiment, compiling the original data to be updated to obtain the target pseudo-instruction object corresponding to the original data to be updated includes:
[0213] Compile the above original data to be updated to obtain the abstract syntax tree corresponding to the above original data to be updated.
[0214] Compile the above abstract syntax tree to obtain the target pseudo-instruction object.
[0215] In an optional embodiment, the abstract syntax tree includes multiple nodes, each node representing a data structure in the original data to be updated. Compiling the abstract syntax tree yields the target pseudo-instruction object, including:
[0216] Based on the types of the aforementioned nodes, create object processing modules for each of the aforementioned nodes.
[0217] Based on the object processing modules of each of the above nodes, the data structures represented by each of the above nodes are processed to obtain the objects corresponding to each of the above nodes.
[0218] Assign a pseudo-instruction to the object processing module of each of the above nodes to obtain the pseudo-instructions corresponding to each node; the above pseudo-instructions are obtained by abstracting the syntax features of the preset programming language.
[0219] The pseudo-instructions and objects corresponding to the aforementioned nodes are determined as the pseudo-instruction objects corresponding to the aforementioned nodes.
[0220] Based on the pseudo-instruction objects corresponding to the aforementioned nodes, the target pseudo-instruction object is generated.
[0221] In an optional embodiment, the above-mentioned object processing module based on each of the plurality of nodes processes the data structure represented by each of the plurality of nodes to obtain the object corresponding to each of the plurality of nodes, including:
[0222] Obtain the hierarchical structure of each of the above nodes in the above abstract syntax tree.
[0223] Based on the above hierarchical structure, the order in which the objects corresponding to the above nodes are generated is determined.
[0224] Based on the above object generation order, the data structures represented by each of the above nodes are processed sequentially according to the object processing modules of each of the above nodes to obtain the objects corresponding to each of the above nodes.
[0225] In an optional embodiment, sending the target pseudo-instruction object to the client includes:
[0226] The target pseudo-instruction object is serialized to obtain the memory snapshot file corresponding to the target pseudo-instruction object.
[0227] Send the aforementioned memory snapshot file to the aforementioned client; so that the aforementioned client can deserialize the aforementioned memory snapshot file to obtain the aforementioned target pseudo-instruction object.
[0228] Figure 16 This is a block diagram illustrating a page update apparatus according to an exemplary embodiment, such as... Figure 16 As shown, the page update device may include:
[0229] The receiving module 401 is used to receive the target pseudo-instruction object sent by the compilation device. The target pseudo-instruction object is obtained by the compilation device compiling the original data to be updated. The target pseudo-instruction object is used to represent the pseudo-instructions and objects generated during the compilation process of the original data to be updated. The original data to be updated is the data corresponding to the target page in the target application.
[0230] The execution module 403 is used to run the target pseudo-instruction object based on a preset execution environment and obtain the execution result of the target pseudo-instruction object; the preset execution environment is set in the target application, and the target application with the preset execution environment is compiled by the compilation device and then published to the local client.
[0231] The update module 405 is used to update the target page based on the above running results, so as to obtain the updated target page.
[0232] In an optional embodiment, the target pseudo-instruction object is obtained by compiling an abstract syntax tree using the compilation device. The abstract syntax tree includes multiple nodes, each node representing a data structure in the original data to be updated. The execution module 403 includes:
[0233] The storage submodule is used to store the parameter information of the pseudo-instructions corresponding to the above-mentioned multiple nodes and the objects corresponding to the above-mentioned multiple nodes into the above-mentioned runtime environment class; the objects corresponding to the above-mentioned multiple nodes include method objects.
[0234] The submodule is invoked, and based on the pseudo-instructions corresponding to each of the above nodes, the method objects in the objects corresponding to each of the above nodes are called from the above runtime environment class to obtain the execution results of the pseudo-instruction objects corresponding to each of the above nodes.
[0235] The execution result generation submodule is used to generate the execution result of the target pseudo-instruction object based on the execution results of the pseudo-instruction objects corresponding to the above multiple nodes.
[0236] The pseudo-instructions corresponding to each of the aforementioned nodes are obtained by the compilation device assigning pseudo-instructions to the object processing modules of the aforementioned nodes; the objects corresponding to each of the aforementioned nodes are obtained by the compilation device processing the data structures represented by the aforementioned nodes based on the object processing modules of the aforementioned nodes; and the object processing modules of the aforementioned nodes are created by the compilation device according to the types corresponding to the aforementioned nodes.
[0237] In an optional embodiment, the submodule is invoked, including:
[0238] The preset instruction acquisition unit is used to acquire preset instructions included in the method objects corresponding to the above-mentioned multiple nodes from the above-mentioned runtime environment class; the preset instructions are obtained by compiling the above-mentioned method objects.
[0239] The preset instruction execution unit is used to execute the preset instructions based on the pseudo-instructions corresponding to the above-mentioned multiple nodes, and obtain the execution results of the pseudo-instruction objects corresponding to the multiple nodes.
[0240] In an optional embodiment, the number of preset instructions is multiple, and the multiple preset instructions are arranged in sequence. The preset instruction execution unit includes:
[0241] The current instruction determination subunit is used to take the first preset instruction among the multiple preset instructions as the current instruction corresponding to each of the multiple nodes, and remove the current instruction from the multiple preset instructions.
[0242] The current execution result determination subunit is used to execute the current instruction based on the pseudo-instructions corresponding to the above multiple nodes, and obtain the execution result of the current instruction.
[0243] The repeating subunit is used to repeat the above operations of taking the first preset instruction among the multiple preset instructions as the current instruction corresponding to each of the multiple nodes, removing the current instruction from the multiple preset instructions, and obtaining the running result of the current instruction, until the running results of the multiple preset instructions corresponding to each of the multiple nodes are obtained.
[0244] The execution result generation subunit is used to generate the execution result of the pseudo-instruction object corresponding to each of the above-mentioned nodes based on the execution results of the multiple preset instructions corresponding to each of the above-mentioned nodes.
[0245] In an optional embodiment, the current execution result determination subunit can be used to execute the instructions in the target instruction set in a preset order based on the pseudo-instructions corresponding to the multiple nodes, when the current instruction includes a target instruction set, to obtain the execution result of the current instruction.
[0246] In an optional embodiment, the receiving module includes:
[0247] The memory snapshot file receiving unit is used to receive the memory snapshot file sent by the compilation device; the memory snapshot file is obtained by the compilation device through serialization processing of the target pseudo-instruction object.
[0248] Accordingly, the above-mentioned device may further include:
[0249] The deserialization module is used to deserialize the memory snapshot file to obtain the target pseudo-instruction object.
[0250] Figure 17 This is a block diagram illustrating another page update apparatus according to an exemplary embodiment, such as... Figure 17 As shown, the page update device may include:
[0251] The acquisition module 501 is used to acquire the original data to be updated corresponding to the target page in the target application.
[0252] The compilation module 503 is used to compile the above-mentioned original data to be updated to obtain the target pseudo-instruction object corresponding to the above-mentioned original data to be updated; the above-mentioned target pseudo-instruction object is used to represent the pseudo-instructions and objects generated during the compilation process of the above-mentioned original data to be updated.
[0253] The sending module 505 is used to send the target pseudo-instruction object to the client; to enable the client to run the target pseudo-instruction object based on a preset runtime environment, and obtain the running result of the target pseudo-instruction object; the preset runtime environment is set in the target application, and the target application with the preset runtime environment is compiled by the compilation device and then published to the client; and to enable the client to update the target page based on the running result, and obtain the updated target page.
[0254] In an optional embodiment, the above-mentioned compilation module 503 includes:
[0255] The raw data to be updated compilation submodule is used to compile the raw data to be updated to obtain the abstract syntax tree corresponding to the raw data to be updated.
[0256] The target pseudo-instruction object determination submodule is used to compile the above abstract syntax tree to obtain the above target pseudo-instruction object.
[0257] In an optional embodiment, the abstract syntax tree includes multiple nodes, each node representing a data structure in the original data to be updated, and the target pseudo-instruction object determination submodule includes:
[0258] The object processing module creation unit is used to create object processing modules for each of the above nodes according to their respective types.
[0259] The object generation unit is used to process the data structures represented by the aforementioned nodes based on the object processing modules of the aforementioned nodes, and to obtain the objects corresponding to the aforementioned nodes.
[0260] The instruction generation unit is used to assign a pseudo-instruction to the object processing module of each of the above-mentioned nodes, thereby obtaining the pseudo-instructions corresponding to each of the nodes; the pseudo-instructions are obtained by abstracting the syntax features of the preset programming language.
[0261] The pseudo-instruction object determination unit is used to determine the pseudo-instructions corresponding to each of the above-mentioned multiple nodes and the objects corresponding to each of the above-mentioned multiple nodes as pseudo-instruction objects corresponding to each of the above-mentioned multiple nodes.
[0262] The target pseudo-instruction object generation unit is used to generate the target pseudo-instruction object based on the pseudo-instruction objects corresponding to the multiple nodes.
[0263] In an optional embodiment, the object generation unit includes:
[0264] The hierarchical structure acquisition sub-unit is used to obtain the hierarchical structure of each of the above nodes in the above abstract syntax tree.
[0265] The object generation order determination subunit is used to determine the object generation order corresponding to each of the above-mentioned nodes based on the above hierarchical structure.
[0266] The processing subunit is used to process the data structure represented by each of the multiple nodes according to the object processing module of each node in the order of object generation, so as to obtain the object corresponding to each of the multiple nodes.
[0267] In an optional embodiment, the above-mentioned sending module includes:
[0268] The serialization processing unit is used to serialize the target pseudo-instruction object to obtain a memory snapshot file corresponding to the target pseudo-instruction object.
[0269] The memory snapshot file sending unit is used to send the memory snapshot file to the client so that the client can deserialize the memory snapshot file to obtain the target pseudo-instruction object.
[0270] It is understood that in the specific embodiments of this application, data such as user information are involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0271] It should be noted that the device embodiments provided in this application are based on the same inventive concept as the method embodiments described above.
[0272] This application also provides a page update system, including a compilation device and a client:
[0273] The compilation device is used to obtain the raw data to be updated corresponding to the target page in the target application; to compile the raw data to be updated to obtain the target pseudo-instruction object corresponding to the raw data to be updated; the target pseudo-instruction object is used to represent the pseudo-instructions and objects generated during the compilation of the raw data to be updated; and to send the target pseudo-instruction object to the client.
[0274] The client is used to run the target pseudo-instruction object based on a preset runtime environment and obtain the execution result of the target pseudo-instruction object; the preset runtime environment is set in the target application, and the target application with the preset runtime environment is compiled by the compilation device and then published to the client; and it is used to update the target page based on the execution result and obtain the updated target page.
[0275] This application also provides an electronic device for page updating, which includes a processor and a memory. The memory stores at least one instruction or at least one program, which is loaded and executed by the processor to implement the page updating method provided in any of the above embodiments.
[0276] Embodiments of this application also provide a computer-readable storage medium that can be disposed in a terminal to store at least one instruction or at least one program related to implementing a page update method in the method embodiments. The at least one instruction or at least one program is loaded and executed by a processor to implement the page update method provided in the above method embodiments.
[0277] Optionally, in the embodiments of this specification, the storage medium may be located at at least one of the multiple network servers in a computer network. Optionally, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0278] The memory described in this specification can be used to store software programs and modules. The processor runs various functional applications and performs data processing by executing the software programs and modules stored in the memory. The memory may primarily include a program storage area and a data storage area. The program storage area may store the operating system, applications required for functions, etc.; the data storage area may store data created based on the use of the device, etc. Furthermore, the memory may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory may also include a memory controller to provide the processor with access to the memory.
[0279] This application also provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the page update method provided in the above-described method embodiments.
[0280] The page update method embodiments provided in this application can be run on a terminal, computer terminal, server, or similar computing device. Taking running on a server as an example, Figure 18 This is a hardware structure block diagram of a page update server according to an exemplary embodiment. For example... Figure 18 As shown, the server 600 can vary significantly due to different configurations or performance. It may include one or more Central Processing Units (GPUs) 610 (CPUs 610 may include, but are not limited to, microprocessors (MCUs) or programmable logic devices (FPGAs), a memory 630 for storing data, and one or more storage media 620 (e.g., one or more mass storage devices) for storing application programs 623 or data 622. The memory 630 and storage media 620 may be temporary or persistent storage. The program stored in the storage media 620 may include one or more modules, each module may include a series of instruction operations on the server. Furthermore, the CPU 610 may be configured to communicate with the storage media 620 and execute the series of instruction operations stored in the storage media 620 on the server 600. Server 600 may also include one or more power supplies 660, one or more wired or wireless network interfaces 650, one or more input / output interfaces 640, and / or one or more operating systems 621, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.
[0281] The input / output interface 640 can be used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of server 600. In one example, the input / output interface 640 includes a network interface controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the input / output interface 640 may be a radio frequency (RF) module for wireless communication with the Internet.
[0282] Those skilled in the art will understand that Figure 18 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, server 600 may also include... Figure 18 The more or fewer components shown, or having the same Figure 18 The different configurations shown.
[0283] It should be noted that the order of the embodiments described above is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. Furthermore, the above description focuses on specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims can be performed in a different order than those shown in the embodiments and still achieve the desired results. Additionally, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired results. In some implementations, multitasking and parallel processing are also possible or may be advantageous.
[0284] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the device and server embodiments are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0285] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware, or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0286] The above are merely preferred embodiments of this application and are not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A page update method, characterized in that, The method includes: The compiler receives a target pseudo-instruction object sent by the compiler. The target pseudo-instruction object is obtained by the compiler compiling the original data to be updated. The target pseudo-instruction object is used to represent the pseudo-instructions and objects generated during the compilation process of the original data to be updated. The original data to be updated is the data corresponding to the target page in the target application. The target pseudo-instruction object is obtained by the compiler compiling an abstract syntax tree. The abstract syntax tree includes multiple nodes, and each node represents the data structure in the original data to be updated. The parameter information of the pseudo-instructions corresponding to each of the multiple nodes and the objects corresponding to each of the multiple nodes are stored in the runtime environment class included in the preset runtime environment; the objects corresponding to each of the multiple nodes include method objects; based on the pseudo-instructions corresponding to each of the multiple nodes, the method objects in the objects corresponding to each of the multiple nodes are called from the runtime environment class to obtain the execution results of the pseudo-instruction objects corresponding to each of the multiple nodes; based on the execution results of the pseudo-instruction objects corresponding to each of the multiple nodes, the execution result of the target pseudo-instruction object is generated; the preset runtime environment is set in the target application, and the target application with the preset runtime environment is compiled by the compilation device and then published to the local client; the pseudo-instructions corresponding to each of the multiple nodes are obtained by the compilation device assigning pseudo-instructions to the object processing modules of each of the multiple nodes; the objects corresponding to each of the multiple nodes are obtained by the compilation device processing the data structures represented by each of the multiple nodes based on the object processing modules of each of the multiple nodes; the object processing modules of each of the multiple nodes are created by the compilation device according to the types corresponding to each of the multiple nodes; the pseudo-instruction objects corresponding to each of the multiple nodes are determined by the compilation device based on the pseudo-instructions and the objects corresponding to each of the multiple nodes. The target page is updated based on the execution results to obtain the updated target page.
2. The page update method according to claim 1, characterized in that, The step of calling the method objects of the objects corresponding to the multiple nodes from the runtime environment class based on the pseudo-instructions corresponding to each of the multiple nodes to obtain the execution results of the pseudo-instruction objects corresponding to the multiple nodes includes: From the runtime environment class, obtain the preset instructions included in the method objects corresponding to each of the plurality of nodes; the preset instructions are obtained by compiling the method objects; The preset instructions are executed based on the pseudo-instructions corresponding to each of the multiple nodes, and the execution results of the pseudo-instruction objects corresponding to each of the multiple nodes are obtained.
3. The page update method according to claim 2, characterized in that, The number of preset instructions is multiple, and the multiple preset instructions are arranged in sequence. The step of running the preset instructions based on the pseudo-instructions corresponding to each of the multiple nodes to obtain the running results of the pseudo-instruction objects corresponding to each of the multiple nodes includes: The preset instruction that appears first among the multiple preset instructions is taken as the current instruction corresponding to each of the multiple nodes, and the current instruction is removed from the multiple preset instructions; The current instruction is executed based on the pseudo-instructions corresponding to each of the multiple nodes to obtain the execution result of the current instruction; Repeat the process of taking the first preset instruction among the multiple preset instructions as the current instruction corresponding to each of the multiple nodes, and removing the current instruction from the multiple preset instructions, until the execution result of the current instruction is obtained, until the execution result of the multiple preset instructions corresponding to each of the multiple nodes is obtained; Based on the execution results of the multiple preset instructions corresponding to each of the multiple nodes, the execution results of the pseudo-instruction objects corresponding to each of the multiple nodes are generated.
4. The page update method according to claim 3, characterized in that, The step of executing the current instruction based on the pseudo-instructions corresponding to each of the multiple nodes to obtain the execution result of the current instruction includes: When the current instruction includes a target instruction set, the instructions in the target instruction set are executed sequentially according to a preset order based on the pseudo-instructions corresponding to each of the multiple nodes to obtain the execution result of the current instruction.
5. The page update method according to any one of claims 1 to 4, characterized in that, The target pseudo-instruction object sent by the receiving compilation device includes: The compiler receives a memory snapshot file sent by the compiler; the memory snapshot file is obtained by the compiler serializing the target pseudo-instruction object. Before running the target pseudo-instruction object based on a preset runtime environment, the method further includes: The memory snapshot file is deserialized to obtain the target pseudo-instruction object.
6. A page update method, characterized in that, The method includes: Retrieve the original data to be updated corresponding to the target page in the target application; The process involves compiling the original data to be updated to obtain an abstract syntax tree (AST). The AST includes multiple nodes, each representing a data structure within the original data. Based on the types corresponding to each node, object processing modules are created for each node. These modules process the data structures represented by each node to obtain corresponding objects. A pseudo-instruction is assigned to each node's object processing module to obtain corresponding pseudo-instructions. These pseudo-instructions are abstracted from the syntax features of a preset programming language. The pseudo-instructions and corresponding objects of each node are then defined as pseudo-instruction objects. Based on these pseudo-instruction objects, a target pseudo-instruction object is generated for the original data to be updated. This target pseudo-instruction object represents the pseudo-instructions and objects generated during the compilation process of the original data. The target pseudo-instruction object is sent to the client; the client stores the parameter information of the pseudo-instructions corresponding to each of the plurality of nodes and the objects corresponding to each of the plurality of nodes in a runtime environment class included in a preset runtime environment; the objects corresponding to each of the plurality of nodes include method objects; the client calls the method objects in the objects corresponding to each of the plurality of nodes from the runtime environment class based on the pseudo-instructions corresponding to each of the plurality of nodes, and obtains the execution results of the pseudo-instruction objects corresponding to each of the plurality of nodes; the client generates the execution result of the target pseudo-instruction object based on the execution results of the pseudo-instruction objects corresponding to each of the plurality of nodes; the preset runtime environment is set in the target application, the target application with the preset runtime environment is compiled by a compilation device and then published to the client; and the client updates the target page based on the execution result, and obtains the updated target page.
7. The page update method according to claim 6, characterized in that, The object processing module based on each of the multiple nodes processes the data structure represented by each of the multiple nodes to obtain the object corresponding to each of the multiple nodes, including: Obtain the hierarchical structure of each of the plurality of nodes in the abstract syntax tree; Based on the hierarchical structure, determine the object generation order corresponding to each of the multiple nodes; Based on the object generation order, the data structures represented by each of the multiple nodes are processed sequentially according to their respective object processing modules to obtain the objects corresponding to each of the multiple nodes.
8. The page update method according to claim 6 or 7, characterized in that, Sending the target pseudo-instruction object to the client includes: The target pseudo-instruction object is serialized to obtain a memory snapshot file corresponding to the target pseudo-instruction object; The memory snapshot file is sent to the client, so that the client can deserialize the memory snapshot file to obtain the target pseudo-instruction object.
9. A page updating device, characterized in that, The device includes: The receiving module is used to receive a target pseudo-instruction object sent by the compilation device. The target pseudo-instruction object is obtained by the compilation device compiling the original data to be updated. The target pseudo-instruction object is used to represent the pseudo-instructions and objects generated during the compilation process of the original data to be updated. The original data to be updated is the data corresponding to the target page in the target application. The target pseudo-instruction object is obtained by the compilation device compiling an abstract syntax tree. The abstract syntax tree includes multiple nodes, and each node represents the data structure in the original data to be updated. The execution module is used to run the target pseudo-instruction object based on a preset execution environment to obtain the execution result of the target pseudo-instruction object. The preset execution environment is set in the target application, and the target application with the preset execution environment is compiled by the compilation device and then released to the local client. The execution module includes: a storage submodule, used to store the parameter information of the pseudo-instructions corresponding to each of the multiple nodes and the objects corresponding to each of the multiple nodes in the execution environment class included in the preset execution environment; the objects corresponding to each of the multiple nodes include method objects; and a calling submodule, used to call the method objects in the objects corresponding to each of the multiple nodes from the execution environment class based on the pseudo-instructions corresponding to each of the multiple nodes to obtain the pseudo-instruction objects corresponding to each of the multiple nodes. The execution result generation submodule is used to generate the execution result of the target pseudo-instruction object based on the execution results of the pseudo-instruction objects corresponding to each of the multiple nodes. The pseudo-instructions corresponding to each of the multiple nodes are obtained by the compilation device assigning pseudo-instructions to the object processing modules of each of the multiple nodes. The objects corresponding to each of the multiple nodes are obtained by the compilation device processing the data structures represented by each of the multiple nodes based on the object processing modules of each of the multiple nodes. The object processing modules of each of the multiple nodes are created by the compilation device according to the types corresponding to each of the multiple nodes. The pseudo-instruction objects corresponding to each of the multiple nodes are determined by the compilation device based on the pseudo-instructions and the objects corresponding to each of the multiple nodes. The update module is used to update the target page based on the running results, so as to obtain the updated target page.
10. The page updating apparatus according to claim 9, characterized in that, The calling submodule includes: The preset instruction acquisition unit is used to acquire preset instructions included in the method objects corresponding to each of the plurality of nodes from the runtime environment class; the preset instructions are obtained by compiling the method objects; The preset instruction execution unit is used to execute the preset instruction based on the pseudo-instructions corresponding to each of the multiple nodes, and obtain the execution results of the pseudo-instruction objects corresponding to each of the multiple nodes.
11. The page update apparatus according to claim 10, characterized in that, The number of preset instructions is multiple, and the multiple preset instructions are arranged in sequence. The preset instruction execution unit includes: The current instruction determination subunit is used to take the first preset instruction among the plurality of preset instructions as the current instruction corresponding to each of the plurality of nodes, and remove the current instruction from the plurality of preset instructions; The current execution result determination subunit is used to execute the current instruction based on the pseudo-instructions corresponding to each of the multiple nodes, and obtain the execution result of the current instruction; The repeating subunit is used to repeat the operation of taking the first preset instruction among the plurality of preset instructions as the current instruction corresponding to each of the plurality of nodes, removing the current instruction from the plurality of preset instructions, until the running result of the current instruction is obtained, until the running result of the plurality of preset instructions corresponding to each of the plurality of nodes is obtained; The execution result generation subunit is used to generate the execution result of the pseudo-instruction object corresponding to each of the multiple nodes based on the execution results of the multiple preset instructions corresponding to each of the multiple nodes.
12. The page update apparatus according to claim 11, characterized in that, The current execution result determination subunit is further configured to, when the current instruction includes a target instruction set, execute the instructions in the target instruction set sequentially according to a preset order based on the pseudo-instructions corresponding to each of the multiple nodes, to obtain the execution result of the current instruction.
13. The page updating apparatus according to any one of claims 9 to 12, characterized in that, The receiving module includes: A memory snapshot file receiving unit is used to receive a memory snapshot file sent by the compilation device; the memory snapshot file is obtained by the compilation device through serialization processing of the target pseudo-instruction object; The page updating device further includes: The deserialization processing module deserializes the memory snapshot file to obtain the target pseudo-instruction object.
14. A page updating device, characterized in that, The device includes: The acquisition module is used to acquire the original data to be updated corresponding to the target page in the target application. A compilation module is used to compile the original data to be updated to obtain a target pseudo-instruction object corresponding to the original data to be updated. The target pseudo-instruction object is used to represent the pseudo-instructions and objects generated during the compilation process of the original data to be updated. The compilation module includes: an original data compilation submodule, used to compile the original data to be updated to obtain an abstract syntax tree corresponding to the original data to be updated; and a target pseudo-instruction object determination submodule, used to compile the abstract syntax tree to obtain the target pseudo-instruction object. The abstract syntax tree includes multiple nodes, each node representing a data structure in the original data to be updated. The target pseudo-instruction object determination submodule includes: an object processing module creation unit, used to create the object according to the type corresponding to each of the multiple nodes. The system includes: an object processing module for each of the multiple nodes; an object generation unit for processing the data structures represented by each of the multiple nodes based on their respective object processing modules to obtain objects corresponding to each of the multiple nodes; an instruction generation unit for assigning a pseudo-instruction to each of the multiple nodes' object processing modules to obtain pseudo-instructions corresponding to each of the multiple nodes; the pseudo-instruction is obtained by abstracting the syntax features of a preset programming language; a pseudo-instruction object determination unit for determining the pseudo-instruction objects corresponding to each of the multiple nodes and the objects corresponding to each of the multiple nodes; and a target pseudo-instruction object generation unit for generating the target pseudo-instruction object based on the pseudo-instruction objects corresponding to each of the multiple nodes. A sending module is configured to send the target pseudo-instruction object to the client; to enable the client to store the parameter information of the pseudo-instructions corresponding to each of the plurality of nodes and the objects corresponding to each of the plurality of nodes in a runtime environment class included in a preset runtime environment; the objects corresponding to each of the plurality of nodes include method objects; and to enable the client to call the method objects in the objects corresponding to each of the plurality of nodes from the runtime environment class based on the pseudo-instructions corresponding to each of the plurality of nodes, to obtain the execution results of the pseudo-instruction objects corresponding to each of the plurality of nodes; and to enable the client to generate the execution result of the target pseudo-instruction object based on the execution results of the pseudo-instruction objects corresponding to each of the plurality of nodes; the preset runtime environment is set in the target application, the target application with the preset runtime environment is compiled by a compilation device and then published to the client; and to enable the client to update the target page based on the execution result, to obtain the updated target page.
15. The page updating apparatus according to claim 14, characterized in that, The object generation unit includes: Hierarchical structure acquisition subunit, used to acquire the hierarchical structure of each of the plurality of nodes in the abstract syntax tree; The object generation order determination subunit is used to determine the object generation order corresponding to each of the multiple nodes according to the hierarchical structure. The processing subunit is used to process the data structure represented by each of the multiple nodes according to the object processing module of each node in turn, based on the object generation order, to obtain the object corresponding to each of the multiple nodes.
16. The page update apparatus according to claim 15, characterized in that, The sending module includes: A serialization processing unit is used to serialize the target pseudo-instruction object to obtain a memory snapshot file corresponding to the target pseudo-instruction object; A memory snapshot file sending unit is used to send the memory snapshot file to the client, so that the client can perform deserialization processing on the memory snapshot file to obtain the target pseudo-instruction object.
17. An electronic device for page updating, characterized in that, The electronic device includes a processor and a memory, the memory storing at least one instruction or at least one program, the at least one instruction or at least one program being loaded and executed by the processor to implement the page update method as described in any one of claims 1 to 8.
18. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one instruction or at least one program, which is loaded and executed by a processor to implement the page update method as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Program file compiling method and device and computer readable storage medium
CN111209005A