CN116821541A - Page updating method and device based on data layer and storage medium - Google Patents

Page updating method and device based on data layer and storage medium Download PDF

Info

Publication number
CN116821541A
CN116821541A CN202310889787.0A CN202310889787A CN116821541A CN 116821541 A CN116821541 A CN 116821541A CN 202310889787 A CN202310889787 A CN 202310889787A CN 116821541 A CN116821541 A CN 116821541A
Authority
CN
China
Prior art keywords
data
target
file
file node
updating
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310889787.0A
Other languages
Chinese (zh)
Inventor
陈洋
熊勇
叶松林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Thalys Automobile Co ltd
Original Assignee
Thalys Automobile Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Thalys Automobile Co ltd filed Critical Thalys Automobile Co ltd
Priority to CN202310889787.0A priority Critical patent/CN116821541A/en
Publication of CN116821541A publication Critical patent/CN116821541A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the application relates to the technical field of vehicles, and discloses a page updating method, a device and a storage medium based on a data layer, wherein the method comprises the following steps: if the target page is detected to receive the trigger request, virtual update data for updating the target page in response to the trigger request is obtained; matching the virtual updated data with the transformed original data to obtain target data which is failed to be matched in the original data; the original data after transformation is data corresponding to the file nodes stored in the hash table; updating the target data according to the virtual updating data to obtain updated target data; and carrying out updating operation on the target page based on the updated target data so as to obtain the updated target page. According to the method and the device, the whole original data is not required to be updated, only the local area of the target page is required to be updated according to the updated target data, and the whole target page is not required to be rendered again, so that the updating speed of the target page is improved.

Description

Page updating method and device based on data layer and storage medium
Technical Field
The embodiment of the application relates to the field of page updating, in particular to a page updating method, device and storage medium based on a data layer.
Background
At present, for updating a target page, even if a user triggers a non-page jump request on the target page, for example, a trigger request for opening a local page change such as a sliding list of a target file, the whole target page needs to be re-rendered so as to complete updating of the target page, thereby displaying the sliding list of the target file. The whole target page updating process needs to process repeated data, and the whole target page needs to be re-rendered according to the data in the whole data layer, so that the target page updating is slow.
Disclosure of Invention
In view of the above problems, embodiments of the present application provide a data plane based page update method, apparatus, and storage medium, which are used to increase the update speed of a target page.
According to an aspect of the embodiment of the present application, there is provided a page update method based on a data plane, the page update method including: if the target page is detected to receive the trigger request, virtual update data for updating the target page in response to the trigger request is obtained; matching the virtual updated data with the original data after transformation to obtain target data which is failed to be matched in the original data after transformation; wherein, the original data after transformation is the data corresponding to the file node stored in the hash table; updating the target data according to the virtual updating data to obtain updated target data; and carrying out updating operation on the local area of the target page based on the updated target data so as to obtain the updated target page.
In an optional manner, the original data includes data corresponding to a plurality of file nodes; the page updating method further comprises the following steps: traversing file nodes in the original data, and taking the traversed file nodes as target file nodes; carrying out data transformation on the data corresponding to the target file node to obtain data corresponding to the transformed target file node so as to obtain data corresponding to a plurality of transformed file nodes; and storing the data corresponding to the reconstructed plurality of file nodes in the hash table to obtain the reconstructed original data.
In an optional manner, the modifying the data corresponding to the target file node to obtain the data corresponding to the modified target file node further includes: detecting whether the subordinate of the target file node comprises a sub-file node or not, and determining the file type corresponding to the target file node according to a detection result; and generating data corresponding to the modified target file node according to the file type corresponding to the target file node, the target identifier representing the sequence of the target file node, the parent node identifier corresponding to the parent file node to which the target file node belongs, and the sequence number of the target file node in the brother node.
In an optional manner, the determining, according to the detection result, the folder type corresponding to the target file node further includes: if the detection result represents that the object file node subordinate includes a sub-file node, determining that the file type corresponding to the object file node is a folder type; and if the detection result indicates that the subordinate of the target file node does not include the sub-file node, determining that the file type corresponding to the target file node is a non-folder type.
In an alternative manner, the file nodes include a root file node and a child file node; the matching operation is performed on the virtual update data and original data in the modified data layer to obtain target data with failed matching in the modified original data, and the method further comprises the following steps: traversing the root file node in the hash table, and taking the traversed root file node as a target root file node; detecting whether the target root file node is the same as the root file node at the corresponding position in the virtual update data; if the root file nodes are not identical, confirming that the target root file node is the target root file node with failed matching so as to obtain the root file node with failed matching in the hash table, and taking the root file node with failed matching and the sub-file node subordinate to the root file node with failed matching as target data with failed matching in the transformed original data.
In an optional manner, the detecting whether the target root file node is the same as the root file node at the corresponding position in the virtual update data includes: if the sub-file nodes are the same, traversing sub-file nodes subordinate to the target root file node, and taking the traversed sub-file nodes as target sub-file nodes; detecting whether the target sub-file node is the same as a sub-file node at a corresponding position in the virtual update data; if the target sub-file nodes are not the same, confirming that the target sub-file nodes are target sub-file nodes with failed matching so as to obtain sub-file nodes with failed matching subordinate to the target root file node, and taking the sub-file nodes with failed matching as target data with failed matching in the original data after transformation.
In an optional manner, the updating the target data according to the virtual update data to obtain updated target data further includes: acquiring target virtual update data corresponding to the position of the target data in the virtual update data; and carrying out updating operation on the target data according to the target virtual updating data to obtain updated target data.
According to another aspect of the embodiment of the present application, there is provided a data plane based page updating apparatus, including: the acquisition module is used for acquiring virtual update data for responding to the trigger request and updating the target page if the trigger request is received by the target page; the matching module is used for carrying out matching operation on the virtual update data and the transformed original data to obtain target data which is failed to be matched in the transformed original data; wherein, the original data after transformation is the data corresponding to the file node stored in the hash table; the target data updating module is used for updating the target data according to the virtual updating data to obtain updated target data; and the target page updating module is used for updating the local area of the target page based on the updated target data so as to obtain the updated target page.
According to an aspect of an embodiment of the present application, there is provided an electronic apparatus including: a controller; and a memory for storing one or more programs which, when executed by the controller, perform the page update method described above.
According to an aspect of the embodiments of the present application, there is also provided a computer-readable storage medium having stored thereon computer-readable instructions which, when executed by a processor of a computer, cause the computer to perform the above-described page updating method.
According to an aspect of embodiments of the present application, there is also provided a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the page update method described above.
According to the embodiment of the application, the virtual update data of the target page is obtained for responding to the trigger request, and the hash table is introduced to modify the original data, so that the data can be conveniently classified and positioned, the target data which is not matched with the virtual update data in the modified original data can be rapidly determined, the data layer only needs to update the target data, the whole original data does not need to be updated, the local area of the target page is further updated according to the updated target data, and the whole target page does not need to be rendered again, so that the update speed of the target page is improved.
The foregoing description is only an overview of the technical solutions of the embodiments of the present application, and may be implemented according to the content of the specification, so that the technical means of the embodiments of the present application can be more clearly understood, and the following specific embodiments of the present application are given for clarity and understanding.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application. It is evident that the drawings in the following description are only some embodiments of the present application and that other drawings may be obtained from these drawings without inventive effort for a person of ordinary skill in the art.
Fig. 1 is a flow chart illustrating a data plane based page updating method according to an exemplary embodiment of the present application.
Fig. 2 is a flow diagram of another data plane based page update method shown based on the exemplary embodiment shown in fig. 1.
Fig. 3 is a flow diagram of another data plane based page update method, shown based on the exemplary embodiment of fig. 2.
Fig. 4 is a schematic diagram illustrating a structure of a plurality of file nodes according to an exemplary embodiment of the present application.
Fig. 5 is a flow diagram of another data plane based page update method shown based on the exemplary embodiment shown in fig. 1.
Fig. 6 is a flow diagram of another data plane based page update method shown based on the exemplary embodiment shown in fig. 5.
Fig. 7 is a schematic diagram of the structure of a first dom tree and a second dom tree according to an exemplary embodiment of the present application.
Fig. 8 is a flow chart of another page update method based on the data plane according to any of the above embodiments.
Fig. 9 is a schematic diagram of an application scenario of the data plane based page update method of the present application.
Fig. 10 is a schematic structural diagram of a data plane based page updating apparatus according to an exemplary embodiment of the present application.
Fig. 11 is a schematic diagram of a computer system of an electronic device according to an exemplary embodiment of the present application.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples do not represent all implementations consistent with the application. Rather, they are merely examples of apparatus and methods consistent with aspects of the application as detailed in the accompanying claims.
The block diagrams depicted in the figures are merely functional entities and do not necessarily correspond to physically separate entities. That is, the functional entities may be implemented in software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
The flow diagrams depicted in the figures are exemplary only, and do not necessarily include all of the elements and operations/steps, nor must they be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the order of actual execution may be changed according to actual situations.
In the present application, the term "plurality" means two or more. "and/or" describes an association relationship of an association object, meaning that there may be three relationships, e.g., a and/or B may represent: a exists alone, A and B exist together, and B exists alone. The character "/" generally indicates that the context-dependent object is an "or" relationship.
The data layer is the layer of processing and managing data for the Web application. It typically includes logic and algorithms related to retrieving data from a server or other source, caching the data locally, updating the data, and so forth. The data layer ensures that the data is used correctly, reliably and efficiently in the application.
The view layer is the interface that the user sees in the Web application and can interact with. It typically includes HTML, CSS, and JavaScript code for rendering the page and handling the user's trigger request. The view layer can provide the user with a target page for interaction with the application.
In Web applications, the data layer and the view layer are typically tightly integrated. For example, when a user requests a Web page, the data layer retrieves data from the server and the view layer presents the page content based on the data. When the user operates in the view layer, the data layer also updates the corresponding data and reflects the corresponding data through the view layer again.
However, the user needs to process the trigger request with smaller trigger page variation in the target page of the view layer according to the repeated data in the data layer, and re-render the whole target page according to the data in the whole data layer, so that the target page is updated slowly.
Therefore, in one aspect of the present application, a data-plane-based page update method is provided to increase the update speed of a target page. Referring to fig. 1 specifically, fig. 1 is a flow chart illustrating a data plane based page updating method according to an exemplary embodiment of the application. The page updating method at least comprises S110 to S140, and is described in detail as follows:
S110: and if the target page is detected to receive the trigger request, virtual update data for updating the target page in response to the trigger request is obtained.
The target page is used for a page that interacts with a user, who may click, drag, or otherwise slide the object in the target page to generate a trigger request. Wherein the trigger request is a request to update the target page; for example, when the user clicks to open the list information of the a folder in the target page, the trigger request is a request for displaying the list information of the a folder in the target page, that is, the current target page needs to be updated, so that the updated target page displays the list information of the a folder.
The virtual update data is similar to an update copy, such as a virtual dom tree, and after the page layer receives the trigger request, the data layer is changed, and the framework generates a virtual dom tree and performs subsequent matching operation with the original dom tree generated according to the original data.
S120: matching the virtual updated data with the original data after transformation to obtain target data which is failed to be matched in the original data after transformation; the original data after transformation is the data corresponding to the file nodes stored in the hash table.
In order to facilitate the matching operation between the data, in the preferred embodiment, the virtual update data has the same structure as the original data after modification, so as to speed up the matching process between the two.
The original data is data corresponding to a plurality of objects in a target page in a view layer in a data layer, wherein the objects can be files or folders. The original data is reformed, namely, the data corresponding to a plurality of files or folders in a data layer is reformed into the data corresponding to the file nodes stored in the hash table, for example, the data such as the codes of the file nodes, the names of the files or folders, the sizes and the like. In the embodiment, the hash table is introduced to reform the original data, so that the data can be conveniently classified and positioned, and the matching process in the step S120 can be quickened.
For example, if matching between the a data and the virtual update data in the modified original data fails, the matching is characterized in that the a data needs to be updated in response to the trigger request, and the a data is used as the target data in the embodiment and is updated.
S130: and carrying out updating operation on the target data according to the virtual updating data to obtain updated target data.
For example, the matching of the a data in the changed original data and the virtual update data fails, the a data is the target data, and the a data is replaced by the update data a 'corresponding to the a data position in the virtual update data, i.e. the update data a' is the updated target data.
In another example, the data a is target data, the target area data corresponding to the data a in the virtual update data is determined, the update data a ' corresponding to the target area data is determined according to a preset corresponding relationship, and the data a is replaced by the update data a ', i.e. the update data a ' is used as updated target data.
S140: and carrying out updating operation on the local area of the target page based on the updated target data so as to obtain the updated target page.
In this embodiment, the entire target page is not updated, but the local area of the target page is updated based on the updated target data, so that the entire target page does not need to be re-rendered, and the update speed of the target page is improved.
In some embodiments, if the modified original data is updated comprehensively in the pre-step, or the update proportion reaches the preset update proportion, the entire target page needs to be updated to obtain the updated target page.
According to the method, the device and the system, the virtual update data of the target page is obtained for responding to the trigger request, the hash table is introduced to modify the original data, so that the data can be conveniently classified and positioned, the target data which is not matched with the virtual update data in the modified original data can be rapidly determined, the data layer only needs to update the target data, the whole original data does not need to be updated, the local area of the target page is further updated according to the updated target data, and the whole target page does not need to be rendered again, so that the updating speed of the target page is improved.
In another exemplary embodiment of the present application, how to perform data transformation on original data is described in detail, and referring specifically to fig. 2, fig. 2 is a flow chart of another data plane based page update method shown in the exemplary embodiment of fig. 1. The original data comprises data corresponding to a plurality of file nodes; the page updating method is based on S110 to S140 shown in fig. 1, and further includes S210 to S230, which are described in detail as follows:
s210: traversing file nodes in the original data, and taking the traversed file nodes as target file nodes.
S220, carrying out data transformation on the data corresponding to the target file node to obtain the data corresponding to the transformed target file node so as to obtain the data corresponding to the transformed plurality of file nodes.
And S230, storing the data corresponding to the plurality of reconstructed file nodes in a hash table to obtain reconstructed original data.
For example, constructing a JS hash table, performing ID encoding on each file node in the original data according to a preset sequence, that is, using the ID as a unique key, traversing each file node according to the ID sequence, if traversing to a second file node, using the second file node as a target file node, performing data transformation on the data corresponding to the second file node to obtain data corresponding to the transformed second file node, and storing the data corresponding to the transformed second file node in the JS hash table; and by analogy, storing the data corresponding to each file node in the JS hash table to finish the transformation of the original data, so as to obtain the transformed original data.
The embodiment provides a data transformation mode for original data, and data corresponding to each file node are transformed one by one to ensure that the data transformation process is omitted and the comprehensiveness of the data transformation. The obtained plurality of modified data are stored in the hash table to obtain modified original data, and the hash table is introduced to modify the original data, so that the data are conveniently classified and positioned, and target data which are not matched with virtual updated data in the modified original data are rapidly determined.
In another exemplary embodiment of the present application, how to reconstruct data corresponding to a target file node to obtain data corresponding to the reconstructed target file node is described in detail, and referring specifically to fig. 3, fig. 3 is a flow chart of another data-layer-based page updating method shown in the exemplary embodiment shown in fig. 2. The page update method further includes S310 to S320 in S220 shown in fig. 2, and is described in detail as follows:
s310: detecting whether the subordinate of the target file node comprises a sub-file node or not, and determining the file type corresponding to the target file node according to the detection result.
Illustratively, traversing to the second file node, then detecting whether the second file node subordinate includes a child file node. Wherein the file types include folder types and non-folder types.
S320: and generating data corresponding to the modified target file node according to the file type corresponding to the target file node, the target identifier representing the sequence of the target file node, the parent node identifier corresponding to the parent file node to which the target file node belongs, and the sequence number of the target file node in the brother node.
The target identifier characterizes the order of the target file node in all file nodes, as shown in fig. 4, and fig. 4 is a schematic diagram of the structure of a plurality of file nodes according to an exemplary embodiment of the present application. Wherein (1) to (6) are the order of each file node, i.e., the IDs stored into the hash table.
Sibling nodes are file nodes belonging to the same hierarchy, i.e., nodes with the same parent node. As shown in fig. 4, the file node (2), the file node (3) and the file node (4) are sibling nodes to each other; the sequence number of the file node (2) in the brother node is 1, the sequence number of the file node (3) in the brother node is 2, and the sequence number of the file node (4) in the brother node is 3. The file node (5) and the file node (6) are brother nodes; the sequence number of the file node (5) in the brother node is 1, and the sequence number of the file node (6) in the brother node is 2.
Illustratively, the data corresponding to the file node (3) stored in the hash table is as follows:
id 3// identification of token file node order
{
Type, 'folder',/File Type of File node: folder type or non-folder type
The parentId is '1',/father node identification corresponding to the father file node to which the file node belongs
Index 2,// sequence numbering of file nodes in siblings
}
The embodiment provides a data transformation mode corresponding to a target file node, and the data corresponding to the transformed target file node is generated through the file type, the target identifier, the father node identifier and the sequence number of the father node identifier in the brother node corresponding to the target file node. And a plurality of parameters are introduced to reform the target file node, so that the target file node can be quickly positioned in a hash table later, and the data can be conveniently classified and positioned.
In another exemplary embodiment of the present application, how to determine the file type corresponding to the target file node according to the detection result is described in detail. If the detection result indicates that the object file node belongs to the sub-file node, determining that the file type corresponding to the object file node is a folder type; if the detection result indicates that the object file node belongs to the sub-file node, determining that the file type corresponding to the object file node is a non-folder type.
As shown in fig. 4, the file node (2) includes the sub-file node (5), and the file type of the file node (2) is determined to be the folder type. And if the subordinate of the file node (6) does not comprise the sub-file node, determining the file type of the file node (6) as the file type.
In another exemplary embodiment of the present application, how to reconstruct data corresponding to a target file node to obtain data corresponding to the reconstructed target file node is described in detail, and referring specifically to fig. 5, fig. 5 is a schematic flow diagram of another data-layer-based page updating method shown in the exemplary embodiment of fig. 1. The page update method further includes S510 to S530 in S120 shown in fig. 1, and is described in detail as follows:
s510: traversing the root file node in the hash table, and taking the traversed root file node as a target root file node.
A root file node is a file node that includes at least two child file nodes.
S520: and detecting whether the target root file node is the same as the root file node at the corresponding position in the virtual update data.
S530: if the root file nodes are different, confirming that the target root file node is the target root file node with failed matching so as to obtain the root file node with failed matching in the hash table, and taking the root file node with failed matching and the sub-file node subordinate to the root file node with failed matching as target data with failed matching in the original data after transformation.
Illustratively, the modified original data and the virtual update data are two dom trees, the dom tree corresponding to the modified original data is a first dom tree, and the dom tree corresponding to the virtual update data is a second dom tree; and comparing and analyzing the two dom trees according to a diff algorithm, firstly comparing whether each root file node in the two dom trees is the same, and if detecting that the target root file node of the first dom tree is different from the root file node in the corresponding position in the second dom tree, taking the target root file node and the sub-file node subordinate to the target root file node as target data of failed matching in original data after transformation, thereby taking the root file node of failed matching of the first dom tree and the sub-file node subordinate to the root file node of failed matching as target data of failed matching in the original data after transformation. By using the virtual dom and diff algorithms, developers can realize faster page updating, and the performance and experience of Web application programs are improved.
The embodiment provides a method for determining target data failing to match in original data after transformation, which comprises the steps of respectively carrying out matching operation on root file nodes in original data and root file nodes in corresponding positions in virtual update data, and taking the root file nodes failing to match and sub-file nodes subordinate to the root file nodes failing to match as target data failing to match in original data after transformation.
In another exemplary embodiment of the present application, how to determine the target data is described in detail in the case that the target root file node is the same as the root file node at the corresponding location in the virtual update data, specifically referring to fig. 6, fig. 6 is a schematic flow chart of another data plane based page update method shown in the exemplary embodiment shown in fig. 5. The page update method further includes S610 to S630 in S520 shown in fig. 5, and is described in detail as follows:
s610: if the sub file nodes are the same, traversing sub file nodes subordinate to the target root file node, and taking the traversed sub file nodes as target sub file nodes.
S620: and detecting whether the target sub-file node is the same as the sub-file node at the corresponding position in the virtual update data.
S630: if the sub file nodes are different, confirming that the target sub file node is a target sub file node with failed matching so as to obtain a sub file node with failed matching, which belongs to the target root file node, and taking the sub file node with failed matching as target data with failed matching in original data after transformation.
Referring to fig. 7, fig. 7 is a schematic diagram illustrating the structure of a first dom tree and a second dom tree according to an exemplary embodiment of the present application. If the root file node (2) in the first dom tree is the same as the root file node (2) 'in the corresponding position in the second dom tree, detecting whether the sub-file node (5) is the same as the corresponding sub-file node (5)', whether the sub-file node (6) is the same as the corresponding sub-file node (6) 'or not, and whether the sub-file node (8) is the same as the corresponding sub-file node (8)' or not, and taking the sub-file node with failed matching as target data of failed matching in the transformed original data.
The embodiment provides another method for determining the target data which is failed to be matched in the original data after transformation, by respectively carrying out matching operation on the root file node in the original data and the root file node at the corresponding position in the virtual updating data, respectively carrying out matching operation on the sub-file node subordinate to the successfully matched root file node and the sub-file node at the corresponding position in the virtual updating data, and taking the sub-file node which is failed to be matched as the target data which is failed to be matched in the original data after transformation.
In another exemplary embodiment of the present application, how to update target data according to virtual update data to obtain updated target data is described in detail, with reference to fig. 8, where fig. 8 is a schematic flow diagram of another data-layer-based page updating method according to any one of the above embodiments. The page update method further includes S810 to S820 in S130, which are described in detail as follows:
s810: and acquiring target virtual update data corresponding to the position of the target data in the virtual update data.
The target virtual update data may be local data in the virtual update data, or may be whole virtual update data, that is, the whole virtual update data is completely different from the original data after modification.
S820: and updating the target data according to the target virtual update data to obtain updated target data.
The present embodiment is exemplarily described: and B data is target data, and corresponds to target virtual update data B 'in the virtual update data position, and the B data is replaced by the target virtual update data B', so that updated target data is obtained.
In another exemplary embodiment, the B data is target data, which corresponds to data B 'in the virtual update data location, the target virtual update data B "is determined according to the data B' and the preset correspondence, and the B data is replaced with the target virtual update data B", so as to obtain updated target data.
The embodiment provides a method for updating target data, which is to acquire target virtual update data corresponding to the position of the target data in the virtual update data so as to update the target data, thereby quickly and accurately obtaining the updated target data.
In another exemplary embodiment of the present application, an application scenario of the above-mentioned multiple page update method is illustrated, referring specifically to fig. 9, and fig. 9 is a schematic diagram of an application scenario of the page update method based on the data layer of the present application. Including a visual layer 100, a destination page 200, and a data layer 300.
A user types a trigger request in the target page 200, for example, the user generates the trigger request in the target page 200 by moving a mouse, moving the mouse upwards, moving the mouse downwards and the like, corresponding to the events mouseMove (events), mouseUp (events) and mouseDown (events) generated by the visual layer 100, and the data layer 300 is used for responding to the events generated by the visual layer 100, so as to acquire virtual update data of the target page 200 from a server or other sources, and perform matching operation on the virtual update data and the transformed original data to obtain target data with failed matching in the transformed original data; the original data after transformation is data corresponding to the file nodes stored in the hash table; updating the target data according to the virtual updating data to obtain updated target data; and carrying out updating operation on the local area of the target page 200 based on the updated target data to obtain the updated target page 200.
In another aspect of the present application, a page updating apparatus is provided, as shown in fig. 10, and fig. 10 is a schematic structural diagram of a data plane based page updating apparatus according to an exemplary embodiment of the present application.
The page updating apparatus 1000 includes:
And an obtaining module 1010, configured to obtain virtual update data for updating the target page in response to the trigger request if it is detected that the target page receives the trigger request.
The matching module 1030 is configured to perform a matching operation on the virtual update data and the modified original data, so as to obtain target data that fails to match in the modified original data; the original data after transformation is the data corresponding to the file nodes stored in the hash table.
The target data updating module 1050 is configured to perform an updating operation on the target data according to the virtual updating data, to obtain updated target data.
The target page updating module 1070 is configured to perform an updating operation on a local area of the target page based on the updated target data, so as to obtain an updated target page.
In an optional manner, the original data includes data corresponding to a plurality of file nodes; the page updating apparatus 1000 further includes:
the traversing module is used for traversing the file nodes in the original data and taking the traversed file nodes as target file nodes.
The transformation module is used for carrying out data transformation on the data corresponding to the target file node to obtain the data corresponding to the transformed target file node so as to obtain the data corresponding to the transformed plurality of file nodes.
And the storage module is used for storing the data corresponding to the plurality of reconstructed file nodes in the hash table to obtain the original reconstructed data.
In an alternative, the retrofit module includes:
the detection unit is used for detecting whether the subordinate of the target file node comprises a sub-file node or not and determining the file type corresponding to the target file node according to the detection result.
The transformation unit is used for generating data corresponding to the transformed target file node according to the file type corresponding to the target file node, the target identifier representing the sequence of the target file node, the parent node identifier corresponding to the parent file node to which the target file node belongs, and the sequence number of the target file node in the brother node.
In an alternative way, the detection unit comprises:
and the folder type plate is used for determining that the file type corresponding to the target file node is the folder type if the detection result indicates that the target file node belongs to the sub-file node.
And the non-folder type plate is used for determining that the file type corresponding to the target file node is a non-folder type if the detection result indicates that the target file node belongs to a sub-file node.
In an alternative manner, the file nodes include a root file node and a child file node; the matching module 1030 includes:
the root file node traversing unit is used for traversing the root file nodes in the hash table and taking the traversed root file nodes as target root file nodes.
And the root file node detection unit is used for detecting whether the target root file node is the same as the root file node at the corresponding position in the virtual update data.
And the target data determining unit is used for confirming that the target root file node is the target root file node with failed matching if the target root file node is different from the target root file node with failed matching so as to obtain the root file node with failed matching in the hash table, and taking the root file node with failed matching and the sub-file node subordinate to the root file node with failed matching as target data with failed matching in the original data after transformation.
In an alternative manner, the root file node detection unit includes:
and the sub-file node traversing plate is used for traversing sub-file nodes subordinate to the target root file node if the sub-file nodes are the same, and taking the traversed sub-file nodes as target sub-file nodes.
The sub-file node detection plate is used for detecting whether the target sub-file node is the same as the sub-file node at the corresponding position in the virtual update data.
And the target data determining plate is used for confirming that the target sub-file node is a target sub-file node with failed matching if the target sub-file nodes are different, so as to obtain the sub-file node with failed matching subordinate to the target root file node, and taking the sub-file node with failed matching as target data with failed matching in the original data after transformation.
In an alternative manner, the target data update module 1050 includes:
the virtual update data acquisition unit is used for acquiring the virtual update data of the target corresponding to the position of the target data in the virtual update data;
and the target data updating unit is used for updating the target data according to the target virtual updating data to obtain updated target data.
According to the page updating device, the virtual updating data of the target page is updated for responding to the trigger request, and the hash table is introduced to modify the original data, so that the data can be conveniently classified and positioned, the target data which is not matched with the virtual updating data in the modified original data can be rapidly determined, the data layer only needs to update the target data, the whole original data does not need to be updated, the local area of the target page is updated according to the updated target data, the whole target page does not need to be rendered again, and the updating speed of the target page is improved.
It should be noted that, the page updating apparatus provided in the foregoing embodiment and the page updating method provided in the foregoing embodiment belong to the same concept, and a specific manner in which each module and unit perform an operation has been described in detail in the method embodiment, which is not described herein again.
Another aspect of the present application also provides an electronic device, including: a controller; and a memory for storing one or more programs which, when executed by the controller, perform the page update method described above.
Referring to fig. 11, fig. 11 is a schematic diagram of a computer system of an electronic device according to an exemplary embodiment of the present application, which illustrates a schematic diagram of a computer system of an electronic device suitable for implementing an embodiment of the present application.
It should be noted that, the computer system 1100 of the electronic device shown in fig. 11 is only an example, and should not impose any limitation on the functions and the application scope of the embodiments of the present application.
As shown in fig. 11, the computer system 1100 includes a central processing unit (Central Processing Unit, CPU) 1101 that can perform various appropriate actions and processes, such as performing the methods in the above-described embodiments, according to a program stored in a Read-Only Memory (ROM) 1102 or a program loaded from a storage section 1108 into a random access Memory (Random Access Memory, RAM) 1103. In the RAM 1103, various programs and data required for system operation are also stored. The CPU 1101, ROM 1102, and RAM 1103 are connected to each other by a bus 1104. An Input/Output (I/O) interface 1105 is also connected to bus 1104.
The following components are connected to the I/O interface 1105: an input section 1106 including a keyboard, a mouse, and the like; an output portion 1107 including a Cathode Ray Tube (CRT), a liquid crystal display (Liquid Crystal Display, LCD), and a speaker; a storage section 1108 including a hard disk or the like; and a communication section 1109 including a network interface card such as a LAN (Local Area Network ) card, a modem, or the like. The communication section 1109 performs communication processing via a network such as the internet. The drive 1110 is also connected to the I/O interface 1105 as needed. Removable media 1111, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like, is installed as needed in drive 1110, so that a computer program read therefrom is installed as needed in storage section 1108.
In particular, according to embodiments of the present application, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising a computer program for performing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via the communication portion 1109, and/or installed from the removable media 1111. When executed by a Central Processing Unit (CPU) 1101, performs the various functions defined in the system of the present application.
It should be noted that, the computer readable medium shown in the embodiments of the present application may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium may be, for example, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-Only Memory (ROM), an erasable programmable read-Only Memory (Erasable Programmable Read Only Memory, EPROM), flash Memory, an optical fiber, a portable compact disc read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present application, however, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with a computer-readable computer program embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. A computer program embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. Where each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present application may be implemented by software, or may be implemented by hardware, and the described units may also be provided in a processor. Wherein the names of the units do not constitute a limitation of the units themselves in some cases.
Another aspect of the application also provides a computer readable storage medium having stored thereon a computer program which when executed by a processor implements a page updating method as before. The computer-readable storage medium may be included in the electronic device described in the above embodiment or may exist alone without being incorporated in the electronic device.
Another aspect of the application also provides a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the page update method provided in the above embodiments.
According to an aspect of the embodiment of the present application, there is also provided a computer system including a central processing unit (Central Processing Unit, CPU) which can perform various appropriate actions and processes, such as performing the method in the above-described embodiment, according to a program stored in a Read-Only Memory (ROM) or a program loaded from a storage section into a random access Memory (Random Access Memory, RAM). In the RAM, various programs and data required for the system operation are also stored. The CPU, ROM and RAM are connected to each other by a bus. An Input/Output (I/O) interface is also connected to the bus.
The following components are connected to the I/O interface: an input section including a keyboard, a mouse, etc.; an output section including a Cathode Ray Tube (CRT), a liquid crystal display (Liquid Crystal Display, LCD), and the like, and a speaker, and the like; a storage section including a hard disk or the like; and a communication section including a network interface card such as a LAN (Local Area Network ) card, a modem, or the like. The communication section performs communication processing via a network such as the internet. The drives are also connected to the I/O interfaces as needed. Removable media such as magnetic disks, optical disks, magneto-optical disks, semiconductor memories, and the like are mounted on the drive as needed so that a computer program read therefrom is mounted into the storage section as needed.
The foregoing is merely illustrative of the preferred embodiments of the present application and is not intended to limit the embodiments of the present application, and those skilled in the art can easily make corresponding variations or modifications according to the main concept and spirit of the present application, so that the protection scope of the present application shall be defined by the claims.

Claims (10)

1. The page updating method based on the data layer is characterized by comprising the following steps:
If the target page is detected to receive the trigger request, virtual update data for updating the target page in response to the trigger request is obtained;
matching the virtual updated data with the original data after transformation to obtain target data which is failed to be matched in the original data after transformation; wherein, the original data after transformation is the data corresponding to the file node stored in the hash table;
updating the target data according to the virtual updating data to obtain updated target data;
and carrying out updating operation on the local area of the target page based on the updated target data so as to obtain the updated target page.
2. The page updating method according to claim 1, wherein the original data includes data corresponding to a plurality of file nodes; the page updating method further comprises the following steps:
traversing file nodes in the original data, and taking the traversed file nodes as target file nodes;
carrying out data transformation on the data corresponding to the target file node to obtain data corresponding to the transformed target file node so as to obtain data corresponding to a plurality of transformed file nodes;
And storing the data corresponding to the reconstructed plurality of file nodes in the hash table to obtain the reconstructed original data.
3. The method for updating a page according to claim 2, wherein the modifying the data corresponding to the target file node to obtain the data corresponding to the modified target file node further comprises:
detecting whether the subordinate of the target file node comprises a sub-file node or not, and determining the file type corresponding to the target file node according to a detection result;
and generating data corresponding to the modified target file node according to the file type corresponding to the target file node, the target identifier representing the sequence of the target file node, the parent node identifier corresponding to the parent file node to which the target file node belongs, and the sequence number of the target file node in the brother node.
4. The method for updating a page according to claim 3, wherein determining the folder type corresponding to the target file node according to the detection result further comprises:
if the detection result represents that the object file node subordinate includes a sub-file node, determining that the file type corresponding to the object file node is a folder type;
And if the detection result indicates that the subordinate of the target file node does not include the sub-file node, determining that the file type corresponding to the target file node is a non-folder type.
5. The page updating method according to claim 1, wherein the file nodes include a root file node and a sub-file node; the matching operation is performed on the virtual update data and original data in the modified data layer to obtain target data with failed matching in the modified original data, and the method further comprises the following steps:
traversing the root file node in the hash table, and taking the traversed root file node as a target root file node;
detecting whether the target root file node is the same as the root file node at the corresponding position in the virtual update data;
if the root file nodes are not identical, confirming that the target root file node is the target root file node with failed matching so as to obtain the root file node with failed matching in the hash table, and taking the root file node with failed matching and the sub-file node subordinate to the root file node with failed matching as target data with failed matching in the transformed original data.
6. The method according to claim 5, wherein the detecting whether the target root file node is the same as the root file node at the corresponding position in the virtual update data comprises:
if the sub-file nodes are the same, traversing sub-file nodes subordinate to the target root file node, and taking the traversed sub-file nodes as target sub-file nodes;
detecting whether the target sub-file node is the same as a sub-file node at a corresponding position in the virtual update data;
if the target sub-file nodes are not the same, confirming that the target sub-file nodes are target sub-file nodes with failed matching so as to obtain sub-file nodes with failed matching subordinate to the target root file node, and taking the sub-file nodes with failed matching as target data with failed matching in the original data after transformation.
7. The method for updating a page according to any one of claims 1 to 6, wherein the updating the target data according to the virtual update data to obtain updated target data further comprises:
acquiring target virtual update data corresponding to the position of the target data in the virtual update data;
And carrying out updating operation on the target data according to the target virtual updating data to obtain updated target data.
8. A data plane based page updating apparatus, the page updating apparatus comprising:
the acquisition module is used for acquiring virtual update data for responding to the trigger request and updating the target page if the trigger request is received by the target page;
the matching module is used for carrying out matching operation on the virtual update data and the transformed original data to obtain target data which is failed to be matched in the transformed original data; wherein, the original data after transformation is the data corresponding to the file node stored in the hash table;
the target data updating module is used for updating the target data according to the virtual updating data to obtain updated target data;
and the target page updating module is used for updating the local area of the target page based on the updated target data so as to obtain the updated target page.
9. An electronic device, comprising:
a controller;
a memory for storing one or more programs that, when executed by the controller, cause the controller to implement the page updating method of any of claims 1 to 7.
10. A computer readable storage medium having stored thereon computer readable instructions which, when executed by a processor of a computer, cause the computer to perform the page updating method of any of claims 1 to 7.
CN202310889787.0A 2023-07-19 2023-07-19 Page updating method and device based on data layer and storage medium Pending CN116821541A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310889787.0A CN116821541A (en) 2023-07-19 2023-07-19 Page updating method and device based on data layer and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310889787.0A CN116821541A (en) 2023-07-19 2023-07-19 Page updating method and device based on data layer and storage medium

Publications (1)

Publication Number Publication Date
CN116821541A true CN116821541A (en) 2023-09-29

Family

ID=88112795

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310889787.0A Pending CN116821541A (en) 2023-07-19 2023-07-19 Page updating method and device based on data layer and storage medium

Country Status (1)

Country Link
CN (1) CN116821541A (en)

Similar Documents

Publication Publication Date Title
JP6463393B2 (en) Tenant data recovery across tenant migration
US8775923B1 (en) Web page restoration
US9807081B2 (en) Live tiles without application-code execution
US20120110437A1 (en) Style and layout caching of web content
US20100138477A1 (en) Crunching Dynamically Generated Script Files
CN107395784B (en) Method and device for importing internet protocol IP pools in batches
CN113076104A (en) Page generation method, device, equipment and storage medium
US11762822B2 (en) Determining when a change set was delivered to a workspace or stream and by whom
CN110781197A (en) Hive offline synchronous verification method and device and electronic equipment
US11418345B2 (en) Digest proofs in a journaled database
US11487819B2 (en) Threaded leaf nodes in database journal
US11487733B2 (en) Database journal redaction
US10877992B2 (en) Updating a database
US20170140009A1 (en) Caching linked queries for optimized compliance management
CN112738550B (en) Content data processing method and device, electronic equipment and medium
US20200160940A1 (en) Molecular structure editor with version control and simultaneous editing operations
CN116821541A (en) Page updating method and device based on data layer and storage medium
US9052906B2 (en) Modularized customization of a model in a model driven development environment
CN112463887A (en) Data processing method, device, equipment and storage medium
CN113743055A (en) Text information processing method and device, electronic equipment, server and storage medium
CN111125565A (en) Method and equipment for inputting information in application
US11785083B2 (en) System and method for offline-first application development
US20240177103A1 (en) Exploratory analysis of content package objects
CN115421785B (en) Method, device and medium for transplanting application program
CN113760860B (en) Data reading method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination