CN115982491A - Page updating method and device, electronic equipment and computer readable storage medium - Google Patents

Page updating method and device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN115982491A
CN115982491A CN202310264539.7A CN202310264539A CN115982491A CN 115982491 A CN115982491 A CN 115982491A CN 202310264539 A CN202310264539 A CN 202310264539A CN 115982491 A CN115982491 A CN 115982491A
Authority
CN
China
Prior art keywords
resource
page
file information
information
target
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
CN202310264539.7A
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.)
CCB Finetech Co Ltd
Original Assignee
CCB Finetech 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 CCB Finetech Co Ltd filed Critical CCB Finetech Co Ltd
Priority to CN202310264539.7A priority Critical patent/CN115982491A/en
Publication of CN115982491A publication Critical patent/CN115982491A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a page updating method and device, electronic equipment and a computer readable storage medium, which can be applied to the fields of computer technology, information technology and financial science and technology. The method comprises the following steps: responding to the detection of page updating operation aiming at an original page file, and generating a resource dependency relationship graph according to page updating information corresponding to the page updating operation, wherein the resource dependency relationship graph comprises at least one resource node and at least one directed edge, the at least one resource node is respectively corresponding to a resource type, and the directed edge is used for representing the resource dependency relationship between every two resource nodes; determining a first resource packet according to at least one resource node, at least one directed edge and at least one resource type; processing the first resource packets according to a preset splitting rule to obtain at least one second resource packet, wherein the number of the second resource packets is greater than or equal to that of the first resource packets; and rendering to obtain an updated target page according to the at least one second resource packet.

Description

Page updating method and device, electronic equipment and computer readable storage medium
Technical Field
The present invention relates to the field of computer technologies, information technologies, and financial technologies, and in particular, to a page updating method and apparatus, an electronic device, and a computer-readable storage medium.
Background
With the development of computer technology, the page content of a Website (i.e. Website) becomes more and more complex. A web site may refer to a collection of pages made on the Internet (i.e., the Internet) according to certain rules, using tools such as standard universal markup languages, etc., for presenting specific content.
A page may refer to a basic element constituting a website, and is a platform that carries various website applications. Pages are typically in hypertext Markup Language (HTML) format.
In the process of implementing the concept of the present invention, the inventors found that at least the following problems exist in the related art: because the page contains more resources, the efficiency of page development and the page performance cannot be guaranteed.
Disclosure of Invention
In view of the above, the present invention provides a page updating method and apparatus, an electronic device, a computer-readable storage medium, and a computer program product.
According to an aspect of the present invention, there is provided a page update method, including:
responding to the detection of page updating operation aiming at an original page file, and generating a resource dependency graph according to page updating information corresponding to the page updating operation, wherein the resource dependency graph comprises at least one resource node and at least one directed edge, the at least one resource node is respectively corresponding to a resource type, and the directed edge is used for representing the resource dependency between every two resource nodes;
determining a first resource packet according to the at least one resource node, the at least one directed edge and the at least one resource type;
processing the first resource packet according to a preset splitting rule to obtain at least one second resource packet, wherein the number of the second resource packets is greater than or equal to that of the first resource packets; and
and rendering to obtain an updated target page according to the at least one second resource packet.
According to an embodiment of the present invention, the determining the first resource package according to the at least one resource node, the at least one directed edge, and the at least one resource type includes:
determining a file conversion tool corresponding to each of the at least one resource type according to the at least one resource type, wherein the file conversion tool is used for converting resource file information corresponding to the resource node into a target resource type;
determining a global resource dependency relationship between the at least one resource node according to the at least one directed edge;
determining at least one target resource file information according to the global resource dependency relationship and the file conversion tool corresponding to the at least one resource type; and
and determining the first resource package according to the at least one target resource file information.
According to an embodiment of the present invention, the determining at least one target resource file information according to the global resource dependency and the file conversion tool corresponding to each of the at least one resource type includes:
sequentially aiming at each resource node in the at least one resource node according to the global resource dependency relationship,
determining the resource type and the resource file information corresponding to the resource node; and
and converting the resource file information by using a file conversion tool corresponding to the resource type to obtain target resource file information, wherein the target resource file information belongs to the target resource type.
According to an embodiment of the present invention, the determining the first resource package according to the at least one target resource file information includes:
for each target resource file information in the at least one target resource file information, compressing the target resource file information to obtain compressed resource file information;
optimizing the compressed resource file information to obtain optimized resource file information; and
and packaging at least one optimized resource file information to obtain the first resource package.
According to an embodiment of the present invention, the optimizing the compressed resource file information to obtain optimized resource file information includes:
based on the target field, carrying out field detection on the compressed resource file information to obtain a field detection result;
deleting the compressed resource file information under the condition that the field detection result represents that the compressed resource file information does not belong to the target file information type; and
and under the condition that the field detection result represents that the compressed resource file information belongs to the target file information type, determining the compressed resource file information as the optimized resource file information.
According to an embodiment of the present invention, the preset splitting rule includes at least one of: the page updating method comprises a first preset splitting rule and a second preset splitting rule corresponding to the page updating operation.
According to an embodiment of the present invention, the first preset splitting rule includes at least one of: initializing a parallel request quantity threshold, an asynchronous parallel request quantity threshold, a cache set quantity threshold, and a storage capacity threshold.
According to an embodiment of the present invention, the second preset splitting rule includes at least one of: the method comprises the steps of presetting splitting rules related to pages and presetting splitting rules related to functions.
According to an embodiment of the present invention, the processing the first resource packet according to a preset splitting rule to obtain at least one second resource packet includes:
processing the first resource packet according to at least one of the threshold of the number of the initialized parallel requests, the threshold of the number of the asynchronous parallel requests, the threshold of the number of the cache groups and the threshold of the storage capacity to obtain at least one intermediate resource packet; and
and respectively processing the at least one intermediate resource packet according to the preset splitting rule related to the page and the preset splitting rule related to the function to obtain the at least one second resource packet.
According to an embodiment of the present invention, the generating a resource dependency graph according to page update information corresponding to the page update operation in response to detecting the page update operation for the original pagefile includes:
in response to detecting a page updating operation for the original page file, acquiring original page information corresponding to the original page file and the page updating information corresponding to the page updating operation;
updating the original page information according to the page updating information to obtain page configuration information; and
and generating the resource dependency relationship graph according to the page configuration information.
According to an embodiment of the present invention, the page configuration information includes at least one piece of resource file information and association relationship information between the at least one piece of resource file information.
According to an embodiment of the present invention, the generating the resource dependency graph according to the page configuration information includes:
aiming at each resource file information in the at least one resource file information, constructing a resource node corresponding to the resource file information according to the resource file information;
constructing a directed edge according to the incidence relation information among the at least one resource file information; and
and generating the resource dependency relationship graph according to the at least one resource node and the directed edge.
According to an embodiment of the present invention, the page configuration information further includes storage path information.
According to an embodiment of the present invention, the method further includes, after the processing the first resource packet according to a preset splitting rule to obtain at least one second resource packet:
and storing the at least one second resource packet according to the storage path information.
According to the embodiment of the present invention, before the generating the resource dependency graph according to the page update information corresponding to the page update operation in response to the detection of the page update operation for the original pagefile, the method further includes:
creating a plug-in management tool based on the running environment;
creating configuration information corresponding to the packaging tool by using the plug-in management tool; and
and calling the packaging tool according to the configuration information corresponding to the packaging tool.
According to another aspect of the present invention, there is provided a page update apparatus, including:
the generation module is used for responding to the detection of page updating operation aiming at an original page file and generating a resource dependency relationship graph according to page updating information corresponding to the page updating operation, wherein the resource dependency relationship graph comprises at least one resource node and at least one directed edge, the at least one resource node is respectively corresponding to a resource type, and the directed edge is used for representing the resource dependency relationship between every two resource nodes;
a determining module, configured to determine a first resource packet according to the at least one resource node, the at least one directed edge, and the at least one resource type;
the processing module is used for processing the first resource packet according to a preset splitting rule to obtain at least one second resource packet, wherein the number of the second resource packets is greater than or equal to that of the first resource packets; and
and the rendering module is used for rendering to obtain an updated target page according to the at least one second resource packet.
According to another aspect of the present invention, there is provided an electronic apparatus comprising:
one or more processors;
a memory to store one or more instructions that,
wherein the one or more instructions, when executed by the one or more processors, cause the one or more processors to implement a method according to the present invention.
According to another aspect of the invention, there is provided a computer readable storage medium having stored thereon executable instructions which, when executed by a processor, cause the processor to carry out a method according to the invention.
According to another aspect of the invention, there is provided a computer program product comprising computer executable instructions for implementing a method according to the invention when executed.
According to the embodiment of the invention, the resource dependency graph is generated according to the page updating information corresponding to the page updating operation, and the directed edges in the resource dependency graph can represent the resource dependency between every two resource nodes, so that the resources can be used according to the required resource dependency. On the basis, the first resource package is determined according to the resource dependency graph, and the at least one second resource package is obtained by processing the first resource package according to the preset splitting rule, so that the technical problem that the page development efficiency and the page performance cannot be guaranteed due to the fact that the page contains more resources in the related technology is solved, and the updated target page is obtained by rendering according to the at least one second resource package, so that the page development efficiency and the page updating efficiency are improved, and the updated page performance is guaranteed.
Drawings
The above and other objects, features and advantages of the present invention will become more apparent from the following description of embodiments of the present invention with reference to the accompanying drawings, in which:
FIG. 1 schematically illustrates a system architecture to which a page update method may be applied, according to an embodiment of the invention;
FIG. 2 schematically illustrates a flow diagram of a page update method according to an embodiment of the invention;
FIG. 3A schematically illustrates an example diagram of generating a resource dependency graph from page update information corresponding to a page update operation according to an embodiment of the present invention;
FIG. 3B schematically illustrates an example diagram of generating a resource dependency graph from page update information corresponding to a page update operation according to another embodiment of the present invention;
FIG. 3C schematically illustrates an example diagram of a resource dependency graph, according to an embodiment of the invention;
FIG. 4 is a flow diagram that schematically illustrates a method for determining a first resource package based on at least one resource node, at least one directed edge, and at least one resource type, in accordance with an embodiment of the present invention;
FIG. 5A is a schematic diagram illustrating an example of determining a first resource package based on at least one target resource file information according to an embodiment of the invention;
FIG. 5B is a schematic diagram illustrating an example of optimizing the compressed resource file information to obtain optimized resource file information according to an embodiment of the present invention;
FIG. 6 schematically illustrates an example diagram of a page update method according to an embodiment of the invention;
FIG. 7 schematically shows a block diagram of a page update apparatus according to an embodiment of the present invention; and
FIG. 8 schematically illustrates a block diagram of an electronic device suitable for implementing a page update method according to an embodiment of the present invention.
Detailed Description
Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. It is to be understood that such description is merely illustrative and not intended to limit the scope of the present invention. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the invention. It may be evident, however, that one or more embodiments may be practiced without these specific details. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present invention.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The terms "comprises," "comprising," and the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs, unless otherwise defined. It is noted that the terms used herein should be interpreted as having a meaning that is consistent with the context of this specification and should not be interpreted in an idealized or overly formal sense.
In those instances where a convention analogous to "at least one of A, B, and C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B, and C" would include but not be limited to systems that have A alone, B alone, C alone, A and B together, A and C together, B and C together, and/or A, B, and C together, etc.). Where a convention analogous to "at least one of A, B, or C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B, or C" would include but not be limited to systems that have A alone, B alone, C alone, A and B together, A and C together, B and C together, and/or A, B, and C together, etc.).
In the technical scheme of the invention, the acquisition, storage, application and the like of the personal information of the related user all accord with the regulations of related laws and regulations, necessary security measures are taken, and the customs of the public order is not violated.
In the technical scheme of the invention, before the personal information of the user is acquired or collected, the authorization or the consent of the user is acquired.
With the development of internet technology, the page content of a webpage becomes more and more complex. The method for developing the front-end page by adopting the native JavaScript mode has the following problems:
1. because the CSS, javaScript and picture resources contained in the page are usually required to be loaded synchronously, multiple requests and loads are required during rendering; in addition, because the CSS and the JavaScript resources are required to be displayed in a source code form and are not compressed, the page performance is reduced;
2. the development mode is backward, so that the code logic and the structure are not clear enough.
The above problem is usually solved by modifying the native JavaScript project. However, since the modification method in the related art has more configuration items, the difficulty of modifying the original JavaScript project by using the related modification method is high for developers, and thus the efficiency and accuracy of modifying the original JavaScript project cannot be guaranteed, and the efficiency and accuracy of page development cannot be guaranteed
In order to at least partially solve the technical problems in the related art, the present invention provides a page updating method and apparatus, an electronic device, and a computer-readable storage medium, which can be applied to the fields of computer technology, information technology, and financial technology. The page updating method comprises the following steps: responding to the detected page updating operation aiming at the original page file, and generating a resource dependency relationship graph according to page updating information corresponding to the page updating operation, wherein the resource dependency relationship graph comprises at least one resource node and at least one directed edge, the at least one resource node is respectively corresponding to a resource type, and the directed edge is used for representing the resource dependency relationship between every two resource nodes; determining a first resource packet according to at least one resource node, at least one directed edge and at least one resource type; processing the first resource packet according to a preset splitting rule to obtain at least one second resource packet, wherein the number of the second resource packets is greater than or equal to that of the first resource packets; and rendering according to the at least one second resource packet to obtain an updated target page.
It should be noted that the page updating method and apparatus provided by the embodiment of the present invention can be used in the fields of computer technology, information technology, and financial technology, for example, in the field of development. The page updating method and device provided by the embodiment of the invention can also be used in any fields except the technical field of computers, the technical field of information and the technical field of finance, such as the technical field of Internet. The application fields of the page updating method and the page updating device provided by the embodiment of the invention are not limited.
Fig. 1 schematically shows a system architecture to which a page update method may be applied according to an embodiment of the present invention. It should be noted that fig. 1 is only an example of a system architecture to which the embodiment of the present invention may be applied to help those skilled in the art understand the technical content of the present invention, and does not mean that the embodiment of the present invention may not be applied to other devices, systems, environments or scenarios.
As shown in fig. 1, the system architecture 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 is used to provide a medium of communication links between the first terminal device 101, the second terminal device 102, the third terminal device 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may interact with the server 105 via the network 104 using at least one of the first terminal device 101, the second terminal device 102, the third terminal device 103, to receive or send messages or the like. Various communication client applications, such as a shopping application, a web browser application, a search application, an instant messaging tool, a mailbox client, social platform software, etc. (for example only), may be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103.
The first terminal device 101, the second terminal device 102, and the third terminal device 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to a smart phone, a tablet computer, a laptop portable computer, a desktop computer, and the like.
The server 105 may be a server providing various services, such as a background management server (for example only) providing support for websites browsed by the user using the first terminal device 101, the second terminal device 102, and the third terminal device 103. The background management server may analyze and perform other processing on the received data such as the user request, and feed back a processing result (e.g., a webpage, information, or data obtained or generated according to the user request) to the terminal device.
It should be noted that the page update method provided by the embodiment of the present invention may be generally executed by the server 105. Accordingly, the page update apparatus provided by the embodiment of the present invention may be generally disposed in the server 105. The page updating method provided by the embodiment of the present invention may also be executed by a server or a server cluster that is different from the server 105 and is capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103 and/or the server 105. Correspondingly, the page updating apparatus provided in the embodiment of the present invention may also be disposed in a server or a server cluster that is different from the server 105 and is capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103 and/or the server 105.
Alternatively, the page updating method provided by the embodiment of the present invention may also be executed by the first terminal device 101, the second terminal device 102, or the third terminal device 103, or may also be executed by another terminal device different from the first terminal device 101, the second terminal device 102, or the third terminal device 103. Correspondingly, the page updating apparatus provided in the embodiment of the present invention may also be disposed in the first terminal device 101, the second terminal device 102, or the third terminal device 103, or disposed in another terminal device different from the first terminal device 101, the second terminal device 102, or the third terminal device 103.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for an implementation.
It should be noted that the sequence numbers of the respective operations in the following methods are merely used as representations of the operations for description, and should not be construed as representing the execution order of the respective operations. The method need not be performed in the exact order shown, unless explicitly stated.
Fig. 2 schematically shows a flow chart of a page update method according to an embodiment of the present invention.
As shown in FIG. 2, the page update method 200 includes operations S210-S240.
In operation S210, in response to detecting a page update operation for an original page file, a resource dependency graph is generated according to page update information corresponding to the page update operation, where the resource dependency graph includes at least one resource node and at least one directed edge, at least one resource node corresponds to a resource type, and the directed edge is used to represent a resource dependency relationship between every two resource nodes.
In operation S220, a first resource package is determined according to at least one resource node, at least one directed edge, and at least one resource type.
In operation S230, the first resource package is processed according to a preset splitting rule to obtain at least one second resource package, where the number of the second resource packages is greater than or equal to the number of the first resource packages.
In operation S240, an updated target page is rendered according to the at least one second resource package.
According to an embodiment of the present invention, the original pagefile may include at least one original resource information. The at least one original resource information may each correspond to an original resource type. The raw resource type may include at least one of: static resource types and dynamic resource types. The static resource type may include at least one of: HTML (Hyper Text Markup Language) resources, JS (JavaScript) resources, CSS (Cascading Style Sheets) resources, TXT (Text document) resources, picture resources, and video resources. The dynamic resource type may include at least one of: servlet (Servlet Applet) resources and JSP (Java Server Pages) resources. The page update operation may include at least one of: a page Add (i.e., add) operation, a page Update (i.e., update), a page Delete (i.e., delete) operation, and a page Reload (i.e., reload) operation.
According to the embodiment of the invention, after the page updating operation aiming at the original page file is detected, the page updating information corresponding to the page updating operation can be determined according to the page updating operation. The obtaining mode of the page update information may be set according to actual service requirements, and is not limited herein. For example, the page update information may be acquired by real-time acquisition, that is, the page original information corresponding to the original page file may be acquired, and the page original information may be processed according to the page update operation to obtain the page update information. Alternatively, the page update information may be obtained from a data source. The data source may include at least one of: a local database, a cloud database, and network resources. For example, a data interface may be invoked, and page update information may be obtained from a data source using the data interface. Alternatively, the page update information may be received from other terminal devices.
According to an embodiment of the present invention, the page update information may include first association relationship information between the at least one first resource file information and the at least one first resource file information with each other. The at least one first resource file information may each correspond to a first resource type. After obtaining the page update information, a resource node corresponding to each of the at least one first resource file information may be constructed. After obtaining the resource node corresponding to the first resource file information, the first resource type corresponding to the first resource file information may be determined as the resource type of the resource node.
According to the embodiment of the invention, after the resource nodes corresponding to the at least one first resource file information are obtained, the directed edge can be constructed according to the first association relation information between the at least one first resource file information and each other. Directed edges may be used to characterize resource dependencies between every two resource nodes. On the basis, a resource Dependency Graph (i.e., dependency Graph) can be generated according to at least one resource node and at least one directed edge.
According to the embodiment of the invention, after the resource dependency graph is obtained, the first global resource dependency relationship between at least one resource node can be determined according to at least one directed edge. The first global resource dependency may be used to characterize a dependency between any two resource nodes in the resource dependency graph. A first file transformation tool corresponding to each of the at least one resource type may be determined based on the at least one resource type. The first file conversion tool may be configured to convert first resource file information corresponding to the resource node into a target resource type. The target resource type may be set according to actual business requirements, and is not limited herein. For example, the target resource type may be a JS resource.
According to the embodiment of the present invention, after obtaining the first global resource dependency relationship and the first file conversion tool, for each resource node in at least one resource node, the first file conversion tool corresponding to the resource type of the resource node may be utilized to perform type conversion processing on the first resource file information corresponding to the resource node, so as to obtain the first target resource file information corresponding to the resource node. After the first target resource file information corresponding to each resource node is obtained, the first target resource file information corresponding to each resource node may be packaged to obtain a first resource package.
According to an embodiment of the present invention, the preset splitting rule may refer to a rule for splitting a resource packet. The preset splitting rule may be set according to actual service requirements, and is not limited herein. After obtaining the first resource package, a preset splitting rule may be determined. And splitting the first resource packet based on a preset splitting rule to obtain at least one second resource packet. The at least one second resource package may be used to characterize a module that partitions the pagefile from top to bottom layer by layer.
According to the embodiment of the present invention, after obtaining at least one second resource package, unit information of at least one UI (User Interface) unit in a target page may be determined according to the at least one second resource package. And determining the primitive information of at least one primitive according to the respective unit information of at least one UI unit. And redrawing the updated target page according to the primitive information of at least one primitive. After obtaining the updated target page, the updated target page may be presented to the user.
According to the embodiment of the invention, the resource dependency graph is generated according to the page updating information corresponding to the page updating operation, and the directed edges in the resource dependency graph can represent the resource dependency between every two resource nodes, so that the resources can be used according to the required resource dependency. On the basis, the first resource package is determined according to the resource dependency graph, and the at least one second resource package is obtained by processing the first resource package according to the preset splitting rule, so that the technical problem that the page development efficiency and the page performance cannot be guaranteed due to the fact that the page contains more resources in the related technology is solved, and the updated target page is obtained by rendering according to the at least one second resource package, so that the page development efficiency and the page updating efficiency are improved, and the updated page performance is guaranteed.
The page update method 200 according to the embodiment of the present invention is further explained with reference to fig. 3A, fig. 3B, fig. 3C, fig. 4, fig. 5A, fig. 5B, and fig. 6.
According to an embodiment of the present invention, the page update method 200 may further include the following operations.
Based on the operating environment, a plug-in management tool is created. Configuration information corresponding to the packaging tool is created using a plug-in management tool. And calling the packaging tool according to the configuration information corresponding to the packaging tool.
According to an embodiment of the present invention, a Runtime environment (i.e., runtime environment) may refer to an environment in which semi-compiled Runtime code is run on a target machine. The operating environment may include at least one of: JRE (Java Runtime Environment) Environment, CLR (Common Language Runtime) Environment, and node. A plug-in management tool may refer to a package manager in a runtime environment. The plugin management tool may be used for node plugin management, e.g., install, uninstall, manage dependencies, etc. Js environment, the plug-in management tool may include NPM (Node Package Manager).
According to the embodiment of the invention, the JavaScript file downloaded by the plug-in management tool is provided with a Source Map file. The Source Map file may store a location corresponding to each of the at least one original resource file information.
According to the embodiment of the invention, after the plug-in management tool is created, the configuration information corresponding to the packaging tool can be created by using the plug-in management tool. The packaging tool may include a code compilation tool (e.g., webpack). The packaging tool may include an entry, an exit, a file conversion tool (i.e., loader), and a plug-in. The packaging tool can package and integrate the files to reduce the volume of the project and improve the loading speed of the page.
According to the embodiment of the invention, the packaging tool can be called according to the page updating information corresponding to the page updating operation. The page update information is processed using a packaging tool to recursively build a resource dependency graph. After obtaining the resource dependency graph, the packaging tool may package the at least one resource file information into at least one resource package according to the resource dependency graph.
According to the embodiment of the invention, because the configuration information corresponding to the packaging tool is created by using the plug-in management tool, and the plug-in management tool is created based on the running environment, the packaging tool can be called according to the configuration information corresponding to the packaging tool, so that the efficiency of page updating is improved.
According to an embodiment of the present invention, operation S210 may include the following operations.
And in response to detecting the page updating operation aiming at the original page file, acquiring page original information corresponding to the original page file and page updating information corresponding to the page updating operation. And updating the original information of the page according to the page updating information to obtain page configuration information. And generating a resource dependency relationship graph according to the page configuration information.
According to the embodiment of the present invention, the obtaining manner of the page original information and the page update information may be set according to the actual service requirement, which is not limited herein. For example, the page update information may be acquired by real-time acquisition, that is, the page update information corresponding to the page update operation may be directly acquired. The page origin information may also be obtained from a data source. For example, a data interface may be invoked, and the data interface may be utilized to obtain page origin information from a data source. Alternatively, the page original information may be received from other terminal devices.
According to an embodiment of the present invention, the page original information may include second association relationship information between the at least one second resource file information and the at least one second resource file information. The page update information may include third association information between the at least one third resource file information and the at least one third resource file information with each other. After the page original information and the page update information are obtained, at least one second resource file information can be updated according to at least one third resource file information to obtain at least one resource file information. And updating second association relation information between the at least one second resource file information according to third association relation information between the at least one third resource file information to obtain the association relation information between the at least one resource file information.
According to the embodiment of the invention, after the at least one piece of resource file information and the association relationship information between the at least one piece of resource file information are obtained, the page configuration information can be determined according to the association relationship information between the at least one piece of resource file information and the at least one piece of resource file information. On the basis, a resource dependency graph can be generated according to the page configuration information.
According to the embodiment of the invention, the page configuration information is obtained by updating the page original information according to the page updating information, so that the page configuration information can represent the association relationship information between at least one resource file information and at least one resource file information after the page updating operation. On the basis, the resource dependency relationship graph is generated according to the page configuration information, so that the resource dependency relationship graph can visually represent the incidence relationship among the resource file information, the resource file processing efficiency and the page updating efficiency are improved, and the updated page performance is further guaranteed.
FIG. 3A schematically shows an example diagram of generating a resource dependency graph according to page update information corresponding to a page update operation according to an embodiment of the present invention.
As shown in fig. 3A, in 300A, in response to detecting a page update operation for an original pagefile, page original information 301 corresponding to the original pagefile and page update information 302 corresponding to the page update operation may be acquired. According to the page update information 302, the page original information 301 is updated to obtain page configuration information 303. According to the page configuration information 303, a resource dependency graph 304 is generated.
According to an embodiment of the present invention, generating the resource dependency graph according to the page configuration information may include the following operations.
And aiming at each resource file information in at least one resource file information, constructing a resource node corresponding to the resource file information according to the resource file information. And constructing a directed edge according to the incidence relation information among the at least one resource file information. And generating a resource dependency relationship graph according to at least one resource node and the directed edge.
According to an embodiment of the present invention, the page configuration information may include at least one resource file information and association relationship information between the at least one resource file information and each other.
According to the embodiment of the invention, before the resource dependency graph is generated according to the page configuration information, an initial network graph can be constructed by using a NetworkX library in the Python language. For example, a DiGraph base class in the NetworkX library may be called to create an initial network graph without nodes and edges.
According to the embodiment of the invention, the entry resource file information can be determined in the at least one resource file information according to the page configuration information. And determining incidence relation information corresponding to the entry resource file information according to the entry resource file information. And determining first associated resource file information corresponding to the entry resource file information according to the associated relation information corresponding to the entry resource file information.
According to the embodiment of the invention, the portal resource node corresponding to the portal resource file information can be constructed according to the portal resource file information. And constructing a first associated resource node corresponding to the first associated resource file information according to the first associated resource file information corresponding to the entry resource file information. After the entry resource node and the first associated resource node are obtained, a directed edge between the entry resource node and the first associated resource node may be constructed according to the association relationship information corresponding to the entry resource file information.
According to the embodiment of the invention, the association relation information corresponding to the first associated resource file information can be determined according to the first associated resource file information. And determining second associated resource file information corresponding to the first associated resource file information according to the association relation information corresponding to the first associated resource file information.
According to the embodiment of the invention, the first associated resource node corresponding to the first associated resource file information can be constructed according to the first associated resource file information. And constructing a second associated resource node corresponding to the second associated resource file information according to the second associated resource file information corresponding to the first associated resource file information. After the first associated resource node and the second associated resource node are obtained, a directed edge between the first associated resource node and the second associated resource node may be constructed according to the association relationship information corresponding to the first associated resource file information.
According to the embodiment of the invention, the steps of constructing the first associated resource node, the second associated resource node and the directed edge can be repeatedly executed until at least one resource file information is added into the initial directed graph to obtain the resource dependency relationship graph.
FIG. 3B schematically shows an example schematic diagram of generating a resource dependency graph from page update information corresponding to a page update operation according to another embodiment of the present invention.
As shown in fig. 3B, in 300B, in response to detecting a page update operation for an original pagefile, page original information 305 corresponding to the original pagefile and page update information 306 corresponding to the page update operation are acquired. According to the page update information 306, the page original information 305 is updated to obtain page configuration information 307. The page configuration information 307 may include at least one resource file information 307_1 and association relationship information 307_2 of the at least one resource file information 307_1 with each other.
Resource node 308 corresponding to resource file information 307_1 may be constructed from resource file information 307_1. The directed edge 309 is constructed according to the association relationship information 307_2 between at least one resource file information 307 _u1 each other. From at least one resource node 308 and a directed edge 309, a resource dependency graph 310 is generated.
FIG. 3C schematically shows an example diagram of a resource dependency graph according to an embodiment of the present invention.
As shown in fig. 3C, in 300C, a generation process of the resource dependency graph will be described by taking an example that at least one resource file information includes resource file information 1, resource file information 2, resource file information 3, resource file information 4, resource file information 5, resource file information 6, and resource file information 7.
According to the resource file information 1, a resource node n _311 corresponding to the resource file information 1 is constructed. According to the resource file information 2 corresponding to the resource file information 1, a resource node n _312 corresponding to the resource file information 2 is constructed. And constructing a directed edge e _311 between the resource node n _311 and the resource node n _312 according to the incidence relation information corresponding to the resource file information 1.
From the resource file information 3 and the resource file information 4 corresponding to the resource file information 2, a resource node n _313 corresponding to the resource file information 3 and a resource node n _314 corresponding to the resource file information 4 are constructed. And constructing a directed edge e _312 between the resource node n _312 and the resource node n _313 and a directed edge e _313 between the resource node n _312 and the resource node n _314 according to the incidence relation information corresponding to the resource file information 2.
According to the resource file information 5 and the resource file information 6 corresponding to the resource file information 3, a resource node n _315 corresponding to the resource file information 5 and a resource node n _316 corresponding to the resource file information 6 are constructed. And constructing a directed edge e _314 between the resource node n _313 and the resource node n _315 and a directed edge e _315 between the resource node n _313 and the resource node n _316 according to the incidence relation information corresponding to the resource file information 3.
And constructing a directed edge e _316 between the resource node n _314 and the resource node n _316 according to the incidence relation information corresponding to the resource file information 4.
Fig. 4 schematically shows a flow chart of a method for determining a first resource package based on at least one resource node, at least one directed edge and at least one resource type according to an embodiment of the present invention.
As shown in FIG. 4, operation S220 may include operations S421-S424.
In operation S421, file transformation tools respectively corresponding to at least one resource type are determined according to the at least one resource type, where the file transformation tools are configured to transform resource file information corresponding to the resource node into a target resource type.
In operation S422, a global resource dependency relationship between at least one resource node is determined according to at least one directed edge.
In operation S423, at least one target resource file information is determined according to the global resource dependency and a file transformation tool corresponding to each of the at least one resource type.
In operation S424, a first resource package is determined according to at least one target resource file information.
According to the embodiment of the invention, after the resource dependency graph is obtained, the global resource dependency between at least one resource node can be determined according to at least one directed edge. The global resource dependency may be used to characterize the dependency between any two resource nodes in the resource dependency graph. A file transformation tool corresponding to each of the at least one resource type may be determined according to a resource type corresponding to each of the at least one resource node. The file conversion tool may be used to convert resource file information corresponding to a resource node into a target resource type.
According to embodiments of the invention, the file transformation tool may include at least one of: static resource transformation tools and dynamic resource transformation tools. The static resource translation tool may include at least one of: HTML conversion tool, JS conversion tool, CSS conversion tool, TXT conversion tool, picture conversion tool, and video conversion tool. The dynamic resource conversion tool may include at least one of: servlet translation tools and JSP translation tools.
According to the embodiment of the invention, after the global resource dependency relationship and the file conversion tool respectively corresponding to at least one resource type are obtained, the target resource nodes can be sequentially determined according to the global resource dependency relationship. And processing the resource file information corresponding to the target resource node by using a file conversion tool corresponding to the resource type of the target resource node to obtain the target resource file information. After the at least one piece of target resource file information is obtained, a packaging tool can be used for packaging the at least one piece of target resource file information to obtain a first resource package.
According to the embodiment of the invention, the global resource dependency relationship is determined according to at least one directed edge, the file conversion tool is determined according to at least one resource type, and the target resource file information is determined according to the global resource dependency relationship and the file conversion tool respectively corresponding to at least one resource type, so that the target resource file information can be ensured to belong to the target resource type. On the basis, the first resource packet is determined according to the at least one target resource file information, so that the occupied volume of resources can be reduced, and the efficiency of page updating is improved.
Operation 423 may include the following operations, in accordance with an embodiment of the present invention.
And according to the global resource dependency relationship, sequentially aiming at each resource node in at least one resource node, determining the resource type and the resource file information corresponding to the resource node. And converting the resource file information by using a file conversion tool corresponding to the resource type to obtain target resource file information, wherein the target resource file information belongs to the target resource type.
According to the embodiment of the invention, after the global resource dependency relationship and the file conversion tool respectively corresponding to at least one resource type are obtained, the resource nodes can be sequentially determined according to the global resource dependency relationship, and the type conversion processing is performed on the resource file information corresponding to the resource nodes by using the file conversion tool corresponding to the resource type of the resource nodes, so that the target resource file information belonging to the target resource type is obtained. The target resource type may be set according to actual business requirements, and is not limited herein. For example, the target resource type may be a JS resource.
Operation 424 may include the following operations, in accordance with an embodiment of the present invention.
And compressing the target resource file information aiming at each target resource file information in at least one piece of target resource file information to obtain compressed resource file information. And optimizing the compressed resource file information to obtain optimized resource file information. And packaging the at least one optimized resource file information to obtain a first resource package.
According to the embodiment of the invention, after at least one piece of target resource file information is obtained, the target resource file information can be compressed based on a preset compression processing mode, so that the compressed resource file information is obtained. The preset compression processing mode may be set according to actual service requirements, and is not limited herein. For example, for the JS resource, a preset compression processing mode based on the uglifyjs-webpack-plugin plug-in can be adopted. Alternatively, for CSS resources, a preset compression processing mode based on an option-CSS-assets-webpack plug-in may be adopted.
According to the embodiment of the invention, after the compressed resource file information is obtained, the compressed resource file information can be optimized based on a preset optimization processing mode to obtain the optimized resource file information. The preset optimization processing mode may be set according to actual service requirements, and is not limited herein. For example, the preset optimization processing mode may include at least one of the following: a time optimization processing mode and a volume optimization processing mode. The time optimization processing mode may include at least one of: optimizing the Loader search range, caching the Loader processing result by the cache-Loader, and using a multithread processing packaging and packaging file analysis tool. The volume optimization processing mode may include at least one of the following: compressing and optimizing the picture, deleting useless CSS patterns, loading resources in a CDN (content delivery network) mode, starting Tree Shaking, starting Scope hosting and loading as required.
Fig. 5A schematically illustrates an example of determining a first resource package according to at least one target resource file information according to an embodiment of the present invention.
As shown in FIG. 5A, in 500A, a global resource dependency 503 between at least one resource node 502 can be determined based on at least one directed edge 501. And according to the global resource dependency 503, sequentially aiming at each resource node 502 in at least one resource node, determining a resource type 504 and resource file information 505 corresponding to the resource node 502.
From the at least one resource type 504, a file transformation tool 506 is determined that corresponds to each of the at least one resource type 504. The resource file information 505 is converted by a file conversion tool 506 corresponding to the resource type 504, and target resource file information 507 is obtained. At least one target resource file information 507 is determined based on the global resource dependencies 503 and file transformation tools 506 that each correspond to at least one resource type 504.
And compressing the target resource file information 507 to obtain compressed resource file information 508 aiming at each target resource file information 507 in at least one target resource file information 507. The compressed resource file information 508 is optimized to obtain optimized resource file information 509. And packaging the at least one optimized resource file information 509 to obtain a first resource package 510.
According to an embodiment of the present invention, optimizing the compressed resource file information to obtain the optimized resource file information may include the following operations.
And based on the target field, carrying out field detection on the compressed resource file information to obtain a field detection result. And deleting the compressed resource file information under the condition that the field detection result represents that the compressed resource file information does not belong to the target file information type. And under the condition that the field detection result represents that the compressed resource file information belongs to the target file information type, determining the compressed resource file information as the optimized resource file information.
According to the embodiment of the invention, taking the preset optimization processing mode of starting Tree Shaking as an example, the field detection can be carried out on the compressed resource file information according to the target field so as to complete the optimization processing. The target field may be set according to actual service requirements, and is not limited herein. For example, the target field may be set to "sideEffects". In the case that the compressed resource file information does not belong to the target file information type, the value corresponding to the target field may be false. In the case that the compressed resource file information belongs to the target file information type, the value corresponding to the target field may be true.
According to the embodiment of the invention, the compressed resource file information can be subjected to field detection according to the target field, and a field detection result is obtained. The 'sideEffects' is included in the resource file information after compression: in the case of false, a field detection result that the compressed resource file information does not belong to the target file information type can be obtained. The 'sideEffects' are included in the determined compressed resource file information: under true, the field detection result that the compressed resource file information belongs to the target file information type can be obtained.
Fig. 5B is a schematic diagram illustrating an example of optimizing the compressed resource file information to obtain optimized resource file information according to an embodiment of the present invention.
As shown in fig. 5B, in 500B, field detection may be performed on the compressed resource file information 512 based on the target field 511, resulting in a field detection result 513. After the field detection result 513 is obtained, operation S510 may be performed.
In operation S510, a field detection result indicates that the compressed resource file information belongs to the target file information type?
If so, the compressed resource file information may be determined to be optimized resource file information 514. If not, the compressed resource file information can be deleted.
According to an embodiment of the present invention, operation S230 may include the following operations.
And processing the first resource packet according to at least one of the initial parallel request quantity threshold value, the asynchronous parallel request quantity threshold value, the cache group quantity threshold value and the storage capacity threshold value to obtain at least one intermediate resource packet. And respectively processing the at least one intermediate resource packet according to a preset splitting rule related to the page and a preset splitting rule related to the function to obtain at least one second resource packet.
According to an embodiment of the present invention, the preset splitting rule includes at least one of: the method comprises a first preset splitting rule and a second preset splitting rule corresponding to page updating operation. The first preset splitting rule comprises at least one of the following: initializing a parallel request quantity threshold, an asynchronous parallel request quantity threshold, a cache set quantity threshold, and a storage capacity threshold. The second preset splitting rule comprises at least one of the following: the method comprises the steps of presetting splitting rules related to pages and presetting splitting rules related to functions.
According to an embodiment of the present invention, a Code Splitting (Code Splitting) manner based on a packaging tool may include at least one of: an Entry configuration-based code splitting mode, a dynamic loading-based code splitting mode and a split mode based on split Chunks configuration. The code splitting mode based on Entry configuration can realize code splitting by configuring a plurality of Entry files. The code splitting mode based on dynamic loading can realize code splitting by actively using import or require. The code splitting manner based on the splittchunks configuration may extract common codes by using the splittchunks configuration to implement code splitting.
According to the embodiment of the present invention, after the first resource packet is obtained, the first resource packet may be processed according to a preset splitting rule to obtain at least one second resource packet. For example, a SplitChunks plug-in the packing tool may be called, a preset splitting rule may be configured by using the SplitChunks plug-in, and the first resource packet may be split based on the preset splitting rule. The preset splitting rule may include a first preset splitting rule and a second preset splitting rule corresponding to a page update operation. Preset splitting rules associated with a page may be used to define the number of splits associated with the performance of the page. Preset splitting rules associated with functions may be used to define the number of splits associated with a page function.
According to embodiments of the invention, an initialization parallel request number threshold (i.e., maxInitialRequests) may be used to define the maximum number of parallel requests for an original page load. For example, the initialization parallel request number threshold may be set to 3. An asynchronous parallel request number threshold (i.e., maxAsyncRequests) may be used to define the maximum number of parallel requests to load chunks on demand. For example, the asynchronous parallel request number threshold may be set to 5. A cache group number threshold (i.e., cacheGroups) may be used to define the number of splits for a cache group. A storage capacity threshold (i.e., minSize) may be used to define the storage capacity of each cache set. For example, the storage capacity threshold may be set to 30KB or more.
According to the embodiment of the invention, at least one second resource packet is obtained by processing the first resource packet according to the first preset splitting rule and the second preset splitting rule corresponding to the page updating operation, and the number of the files in the split resource packet is less than that of the files before splitting, so that the loading speed of the page can be increased, and the page updating efficiency is improved.
According to an embodiment of the present invention, the page update method 200 may further include the following operations.
And storing the at least one second resource packet according to the storage path information.
According to an embodiment of the present invention, the page configuration information may further include storage path information.
According to an embodiment of the present invention, the page update method 200 may be set based on an MVVM (Model View Model) framework. The MVVM framework can separate the development of graphical user interfaces from the development of business logic or back-end logic or data models. Js may provide a JavaScript library for bi-directional data binding based on the MVVM framework. Bidirectional data binding of View and ViewModel can be realized through the Vue item based on the MVVM framework, namely the ViewModel can be connected with the View and the Model, so that the state change of the ViewModel can be automatically transmitted to the View, and the consistency of the View and the data is ensured.
Fig. 6 schematically shows an example schematic diagram of a page updating method according to an embodiment of the present invention.
As shown in fig. 6, in 600, a plug-in management tool 602 may be created based on a runtime environment 601. With the plug-in management tool 602, configuration information 603 corresponding to the packaging tool is created. The packaging tool 604 is invoked according to the configuration information 603 corresponding to the packaging tool.
In response to detecting a page update operation for the original pagefile, page original information 605 corresponding to the original pagefile and page update information 606 corresponding to the page update operation may be obtained. According to the page update information 606, the page original information 605 is updated to obtain page configuration information 607. From the page configuration information 607, a resource dependency graph 608 is generated.
The resource dependency graph 608 may include at least one resource node 608_2 and at least one directed edge 608_1. At least one resource node 608 _2each corresponds to a resource type 608_3. The first resource package 609 may be determined based on at least one resource node 608_2, at least one directed edge 608_1, and at least one resource type 608_3.
The first resource packet 609 may be processed according to a first preset splitting rule 610 to obtain at least one intermediate resource packet 611. According to a second preset splitting rule 612, the at least one intermediate resource packet 611 is processed respectively, so as to obtain at least one second resource packet 613. At least one second resource package 613 may be stored according to the storage path information 607_1 and rendered to obtain an updated target page 614.
The above is only an exemplary embodiment, but is not limited thereto, and other page updating methods known in the art may be included as long as the efficiency of page development and page updating can be improved.
Fig. 7 schematically shows a block diagram of a page updating apparatus according to an embodiment of the present invention.
As shown in fig. 7, the page updating apparatus 700 may include a generation module 710, a determination module 720, a processing module 730, and a rendering module 740.
The generating module 710 is configured to generate a resource dependency graph according to page update information corresponding to a page update operation in response to detecting the page update operation for an original page file, where the resource dependency graph includes at least one resource node and at least one directed edge, at least one resource node corresponds to a resource type, and the directed edge is used to represent a resource dependency relationship between every two resource nodes.
A determining module 720, configured to determine the first resource package according to the at least one resource node, the at least one directed edge, and the at least one resource type.
The processing module 730 is configured to process the first resource packet according to a preset splitting rule to obtain at least one second resource packet, where the number of the second resource packets is greater than or equal to the number of the first resource packets.
And a rendering module 740, configured to render the updated target page according to the at least one second resource package.
According to an embodiment of the present invention, the determination module 720 may include a first determination sub-module, a second determination sub-module, a third determination sub-module, and a fourth determination sub-module.
The first determining sub-module is configured to determine, according to at least one resource type, a file conversion tool corresponding to each of the at least one resource type, where the file conversion tool is configured to convert resource file information corresponding to a resource node into a target resource type.
And the second determining submodule is used for determining the global resource dependency relationship between at least one resource node according to at least one directed edge.
And the third determining submodule is used for determining at least one target resource file information according to the global resource dependency relationship and the file conversion tool respectively corresponding to at least one resource type.
And the fourth determining submodule is used for determining the first resource package according to the at least one target resource file information.
According to an embodiment of the present invention, the third determination submodule may include a determination unit and a conversion unit.
And the determining unit is used for sequentially determining the resource type and the resource file information corresponding to the resource node aiming at each resource node in at least one resource node according to the global resource dependency relationship.
And the conversion unit is used for converting the resource file information by using a file conversion tool corresponding to the resource type to obtain target resource file information, wherein the target resource file information belongs to the target resource type.
According to an embodiment of the present invention, the fourth determination submodule may include a first processing unit, a second processing unit, and a third processing unit.
The first processing unit is used for compressing the target resource file information aiming at each target resource file information in at least one target resource file information to obtain the compressed resource file information.
And the second processing unit is used for optimizing the compressed resource file information to obtain the optimized resource file information.
And the third processing unit is used for packaging the at least one optimized resource file information to obtain a first resource package.
According to an embodiment of the present invention, the second processing unit may include a detection subunit, a deletion subunit, and a determination subunit.
And the detection subunit is used for carrying out field detection on the compressed resource file information based on the target field to obtain a field detection result.
And the deleting subunit is used for deleting the compressed resource file information under the condition that the field detection result represents that the compressed resource file information does not belong to the target file information type.
And the determining subunit is used for determining the compressed resource file information as the optimized resource file information under the condition that the field detection result represents that the compressed resource file information belongs to the target file information type.
According to an embodiment of the present invention, the preset splitting rule includes at least one of: the method comprises the steps of obtaining a first preset splitting rule and a second preset splitting rule corresponding to the page updating operation.
According to an embodiment of the present invention, the first preset splitting rule includes at least one of: initializing a parallel request quantity threshold, an asynchronous parallel request quantity threshold, a cache set quantity threshold, and a storage capacity threshold.
According to an embodiment of the present invention, the second preset splitting rule includes at least one of: a preset splitting rule related to a page and a preset splitting rule related to a function.
According to an embodiment of the present invention, the processing module 730 may include a first processing sub-module and a second processing sub-module.
And the first processing submodule is used for processing the first resource packet according to at least one of the initialized parallel request quantity threshold, the asynchronous parallel request quantity threshold, the cache group quantity threshold and the storage capacity threshold to obtain at least one intermediate resource packet.
And the second processing submodule is used for respectively processing the at least one intermediate resource packet according to the preset splitting rule related to the page and the preset splitting rule related to the function to obtain at least one second resource packet.
According to an embodiment of the present invention, the generating module 710 may include an obtaining sub-module, an updating sub-module, and a generating sub-module.
And the obtaining sub-module is used for responding to the detection of the page updating operation aiming at the original page file, and obtaining the page original information corresponding to the original page file and the page updating information corresponding to the page updating operation.
And the updating submodule is used for updating the original page information according to the page updating information to obtain page configuration information.
And the generation submodule is used for generating a resource dependency relationship graph according to the page configuration information.
According to the embodiment of the invention, the page configuration information comprises at least one resource file information and the association relation information of the at least one resource file information.
According to an embodiment of the present invention, the generation submodule may include a first construction unit, a second construction unit, and a generation unit.
The first construction unit is used for constructing a resource node corresponding to the resource file information according to the resource file information aiming at each resource file information in the at least one resource file information.
And the second construction unit is used for constructing the directed edge according to the incidence relation information among the at least one resource file information.
And the generating unit is used for generating a resource dependency relationship graph according to the at least one resource node and the directed edge.
According to an embodiment of the present invention, the page configuration information further includes storage path information.
According to an embodiment of the present invention, the page updating apparatus 700 may further include a storage module.
And the storage module is used for storing the at least one second resource packet according to the storage path information.
According to an embodiment of the present invention, the page updating apparatus 700 may further include a first creating module, a second creating module, and a calling module.
The first creating module is used for creating the plug-in management tool based on the running environment.
And the second creating module is used for creating the configuration information corresponding to the packaging tool by using the plug-in management tool.
And the calling module is used for calling the packaging tool according to the configuration information corresponding to the packaging tool.
Any number of modules, sub-modules, units, sub-units, or at least part of the functionality of any number thereof according to embodiments of the invention may be implemented in one module. Any one or more of the modules, sub-modules, units, and sub-units according to the embodiments of the present invention may be implemented by being divided into a plurality of modules. Any one or more of the modules, sub-modules, units, sub-units according to embodiments of the present invention may be implemented at least in part as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented in any other reasonable manner of hardware or firmware by integrating or packaging a circuit, or in any one of or a suitable combination of software, hardware, and firmware implementations. Alternatively, one or more of the modules, sub-modules, units, sub-units according to embodiments of the present invention may be at least partially implemented as computer program modules, which, when executed, may perform the corresponding functions.
For example, any number of the generating module 710, the determining module 720, the processing module 730, and the rendering module 740 may be combined in one module/unit/sub-unit to be implemented, or any one of the modules/units/sub-units may be split into a plurality of modules/units/sub-units. Alternatively, at least part of the functionality of one or more of these modules/units/sub-units may be combined with at least part of the functionality of other modules/units/sub-units and implemented in one module/unit/sub-unit. According to an embodiment of the present invention, at least one of the generating module 710, the determining module 720, the processing module 730, and the rendering module 740 may be implemented at least in part as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented in hardware or firmware in any other reasonable manner of integrating or packaging a circuit, or in any one of three implementations of software, hardware, and firmware, or in any suitable combination of any of them. Alternatively, at least one of the generating module 710, the determining module 720, the processing module 730 and the rendering module 740 may be at least partially implemented as a computer program module, which when executed, may perform a corresponding function.
It should be noted that the page updating apparatus portion in the embodiment of the present invention corresponds to the page updating method portion in the embodiment of the present invention, and the description of the page updating apparatus portion specifically refers to the page updating method portion, which is not described herein again.
FIG. 8 schematically shows a block diagram of an electronic device adapted to implement a page update method according to an embodiment of the present invention. The electronic device shown in fig. 8 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 8, a computer electronic device 800 according to an embodiment of the present invention includes a processor 801 which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 802 or a program loaded from a storage section 809 into a Random Access Memory (RAM) 803. The processor 801 may include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or associated chipset, and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), among others. The processor 801 may also include onboard memory for caching purposes. The processor 801 may comprise a single processing unit or a plurality of processing units for performing the different actions of the method flows according to embodiments of the present invention.
In the RAM 803, various programs and data necessary for the operation of the electronic apparatus 800 are stored. The processor 801, the ROM 802, and the RAM 803 are connected to each other by a bus 804. The processor 801 performs various operations of the method flow according to the embodiment of the present invention by executing programs in the ROM 802 and/or the RAM 803. Note that the programs may also be stored in one or more memories other than the ROM 802 and the RAM 803. The processor 801 may also perform various operations of method flows according to embodiments of the present invention by executing programs stored in the one or more memories.
Electronic device 800 may also include input/output (I/O) interface 805, input/output (I/O) interface 805 also connected to bus 804, according to an embodiment of the invention. The electronic device 800 may also include one or more of the following components connected to an input/output (I/O) interface 805: an input portion 806 including a keyboard, a mouse, and the like; an output section 807 including components such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and a speaker; a storage portion 808 including a hard disk and the like; and a communication section 809 including a network interface card such as a LAN card, a modem, or the like. The communication section 809 performs communication processing via a network such as the internet. The drive 810 is also connected to an input/output (I/O) interface 805 as necessary. A removable medium 811 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 810 as necessary, so that a computer program read out therefrom is mounted on the storage section 808 as necessary.
According to an embodiment of the invention, the method flow according to an embodiment of the invention may be implemented as a computer software program. For example, embodiments of the invention include a computer program product comprising a computer program embodied on a computer-readable storage medium, the computer program comprising program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 809 and/or installed from the removable medium 811. The computer program, when executed by the processor 801, performs the above-described functions defined in the system of the embodiment of the present invention. The above described systems, devices, apparatuses, modules, units, etc. may be implemented by computer program modules according to embodiments of the present invention.
The present invention also provides a computer-readable storage medium, which may be contained in the apparatus/device/system described in the above embodiments; or may exist separately and not be assembled into the device/apparatus/system. The computer-readable storage medium carries one or more programs which, when executed, implement the method according to an embodiment of the present invention.
According to an embodiment of the present invention, the computer readable storage medium may be a non-volatile computer readable storage medium. Examples may include, but are not limited to: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), 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 present invention, 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.
For example, according to an embodiment of the present invention, a computer-readable storage medium may include the above-described ROM 802 and/or RAM 803 and/or one or more memories other than the ROM 802 and RAM 803.
Embodiments of the present invention also include a computer program product comprising a computer program comprising program code for performing the method provided by the embodiments of the present invention, when the computer program product is run on an electronic device, for causing the electronic device to implement the page updating method provided by the embodiments of the present invention.
The computer program, when executed by the processor 801, performs the above-described functions defined in the system/apparatus of an embodiment of the present invention. The above described systems, devices, modules, units, etc. may be implemented by computer program modules according to embodiments of the invention.
In one embodiment, the computer program may be hosted on a tangible storage medium such as an optical storage device, a magnetic storage device, and the like. In another embodiment, the computer program may also be transmitted in the form of a signal on a network medium, distributed, downloaded and installed via communication section 809, and/or installed from removable media 811. The computer program containing program code may be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
According to embodiments of the present invention, program code for executing a computer program provided by embodiments of the present invention may be written in any combination of one or more programming languages, and in particular, the computer program may be implemented using a high level procedural and/or object oriented programming language, and/or assembly/machine language. The programming language includes, but is not limited to, programming languages such as Java, C + +, python, the "C" language, or the like. The program code may execute entirely on the user computing device, partly on the user device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
The flowchart 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 invention. In this regard, 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. It will be appreciated by a person skilled in the art that various combinations and/or combinations of features recited in the various embodiments of the invention and/or in the claims may be made, even if such combinations or combinations are not explicitly recited in the present invention. In particular, various combinations and/or combinations of the features recited in the various embodiments and/or claims of the present invention may be made without departing from the spirit or teaching of the invention. All such combinations and/or associations fall within the scope of the present invention.
The embodiments of the present invention have been described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present invention. Although the embodiments are described separately above, this does not mean that the measures in the embodiments cannot be used in advantageous combination. The scope of the invention is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be devised by those skilled in the art without departing from the scope of the invention, and these alternatives and modifications are intended to fall within the scope of the invention.

Claims (13)

1. A page updating method comprises the following steps:
responding to the detection of page updating operation aiming at an original page file, and generating a resource dependency graph according to page updating information corresponding to the page updating operation, wherein the resource dependency graph comprises at least one resource node and at least one directed edge, the at least one resource node is respectively corresponding to a resource type, and the directed edge is used for representing the resource dependency between every two resource nodes;
determining a first resource packet according to the at least one resource node, the at least one directed edge and the at least one resource type;
processing the first resource packet according to a preset splitting rule to obtain at least one second resource packet, wherein the number of the second resource packets is greater than or equal to that of the first resource packets; and
and rendering to obtain an updated target page according to the at least one second resource packet.
2. The method of claim 1, wherein the determining a first resource bundle according to the at least one resource node, the at least one directed edge, and at least one resource type comprises:
determining a file conversion tool corresponding to each of the at least one resource type according to the at least one resource type, wherein the file conversion tool is used for converting resource file information corresponding to the resource node into a target resource type;
determining a global resource dependency relationship between the at least one resource node according to the at least one directed edge;
determining at least one target resource file information according to the global resource dependency relationship and the file conversion tool respectively corresponding to at least one resource type; and
and determining the first resource packet according to the at least one target resource file information.
3. The method of claim 2, wherein said determining at least one target resource file information from the global resource dependencies and the file transformation tools each corresponding to at least one resource type comprises:
according to the global resource dependency relationship, sequentially aiming at each resource node in the at least one resource node, determining the resource type and the resource file information corresponding to the resource node; and
and converting the resource file information by using a file conversion tool corresponding to the resource type to obtain target resource file information, wherein the target resource file information belongs to the target resource type.
4. The method of claim 2, wherein said determining the first resource package from the at least one target resource file information comprises:
compressing the target resource file information aiming at each target resource file information in the at least one target resource file information to obtain compressed resource file information;
optimizing the compressed resource file information to obtain optimized resource file information; and
and packaging at least one optimized resource file information to obtain the first resource package.
5. The method of claim 4, wherein the optimizing the compressed resource file information to obtain optimized resource file information comprises:
based on the target field, carrying out field detection on the compressed resource file information to obtain a field detection result;
deleting the compressed resource file information under the condition that the field detection result represents that the compressed resource file information does not belong to the target file information type; and
and under the condition that the field detection result represents that the compressed resource file information belongs to the target file information type, determining the compressed resource file information as the optimized resource file information.
6. The method according to any one of claims 1 to 5, wherein the preset splitting rule comprises at least one of: the method comprises the steps that a first preset splitting rule and a second preset splitting rule corresponding to the page updating operation are obtained;
wherein the first preset splitting rule comprises at least one of: initializing a parallel request quantity threshold, an asynchronous parallel request quantity threshold, a cache group quantity threshold and a storage capacity threshold;
wherein the second preset splitting rule comprises at least one of: a preset splitting rule related to a page and a preset splitting rule related to a function;
wherein the processing the first resource package according to a preset splitting rule to obtain at least one second resource package comprises:
processing the first resource packet according to at least one of the threshold of the number of the initialized parallel requests, the threshold of the number of the asynchronous parallel requests, the threshold of the number of the cache groups and the threshold of the storage capacity to obtain at least one intermediate resource packet; and
and respectively processing the at least one intermediate resource packet according to the preset splitting rule related to the page and the preset splitting rule related to the function to obtain the at least one second resource packet.
7. The method of any of claims 1-5, wherein the generating a resource dependency graph from page update information corresponding to a page update operation in response to detecting the page update operation for an original pagefile comprises:
in response to detecting a page updating operation for the original page file, acquiring original page information corresponding to the original page file and the page updating information corresponding to the page updating operation;
updating the original page information according to the page updating information to obtain page configuration information; and
and generating the resource dependency relationship graph according to the page configuration information.
8. The method of claim 7, wherein the page configuration information comprises at least one resource file information and association relationship information of the at least one resource file information with each other;
the generating the resource dependency graph according to the page configuration information includes:
aiming at each resource file information in the at least one resource file information, constructing a resource node corresponding to the resource file information according to the resource file information;
constructing a directed edge according to the incidence relation information among the at least one resource file information; and
and generating the resource dependency relationship graph according to the at least one resource node and the directed edge.
9. The method of claim 7, wherein the page configuration information further includes storage path information;
the method further comprises, after processing the first resource packet according to a preset splitting rule to obtain at least one second resource packet:
and storing the at least one second resource packet according to the storage path information.
10. The method of any of claims 1-5, further comprising, prior to the generating, in response to detecting a page update operation for an original pagefile, a resource dependency graph from page update information corresponding to the page update operation:
creating a plug-in management tool based on the operating environment;
creating configuration information corresponding to a packaging tool by using the plug-in management tool; and
and calling the packaging tool according to the configuration information corresponding to the packaging tool.
11. A page update apparatus, comprising:
the generating module is used for responding to the detection of page updating operation aiming at an original page file and generating a resource dependency graph according to page updating information corresponding to the page updating operation, wherein the resource dependency graph comprises at least one resource node and at least one directed edge, the at least one resource node is respectively corresponding to a resource type, and the directed edge is used for representing the resource dependency between every two resource nodes;
a determining module, configured to determine a first resource package according to the at least one resource node, the at least one directed edge, and the at least one resource type;
the processing module is used for processing the first resource packet according to a preset splitting rule to obtain at least one second resource packet, wherein the number of the second resource packets is greater than or equal to that of the first resource packets; and
and the rendering module is used for rendering to obtain an updated target page according to the at least one second resource packet.
12. An electronic device, comprising:
one or more processors;
a memory to store one or more instructions that,
wherein the one or more instructions, when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-10.
13. A computer readable storage medium having stored thereon executable instructions which, when executed by a processor, cause the processor to carry out the method of any one of claims 1 to 10.
CN202310264539.7A 2023-03-20 2023-03-20 Page updating method and device, electronic equipment and computer readable storage medium Pending CN115982491A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310264539.7A CN115982491A (en) 2023-03-20 2023-03-20 Page updating method and device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310264539.7A CN115982491A (en) 2023-03-20 2023-03-20 Page updating method and device, electronic equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN115982491A true CN115982491A (en) 2023-04-18

Family

ID=85963479

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310264539.7A Pending CN115982491A (en) 2023-03-20 2023-03-20 Page updating method and device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN115982491A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116257719A (en) * 2023-05-16 2023-06-13 建信金融科技有限责任公司 Page updating method, page updating device, computer equipment and storage medium
CN117931093A (en) * 2024-03-20 2024-04-26 深圳鸿芯微纳技术有限公司 Global I/O distribution method and device and electronic equipment
CN117931093B (en) * 2024-03-20 2024-05-24 深圳鸿芯微纳技术有限公司 Global I/O distribution method and device and electronic equipment

Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140331117A1 (en) * 2013-05-06 2014-11-06 Qualcomm Innovation Center, Inc. Application-based dependency graph
CN108280216A (en) * 2018-02-06 2018-07-13 曙光信息产业(北京)有限公司 A kind of page performance optimization method and device
CN109344348A (en) * 2018-09-20 2019-02-15 阿里巴巴集团控股有限公司 A kind of resource regeneration method and device
CN109634654A (en) * 2018-12-04 2019-04-16 北京马上慧科技术有限公司 A kind of page packaging method, device, system, computer equipment and storage medium
US20190324989A1 (en) * 2018-04-18 2019-10-24 Palantir Technologies Inc. Resource dependency system and graphical user interface
CN111209022A (en) * 2020-01-03 2020-05-29 支付宝(杭州)信息技术有限公司 Resource publishing and acquiring method, device and equipment
CN112287267A (en) * 2019-07-23 2021-01-29 北京京东尚科信息技术有限公司 Method and device for loading channel static resources
CN112764806A (en) * 2021-02-27 2021-05-07 中电万维信息技术有限责任公司 Front-end resource modular management and resource packaging configuration method
CN113312032A (en) * 2021-06-25 2021-08-27 深圳集智数字科技有限公司 Front-end project resource updating method and device, electronic equipment and storage medium
CN114064032A (en) * 2021-11-12 2022-02-18 中国建设银行股份有限公司 Source code processing method and device, electronic equipment and storage medium
WO2022057663A1 (en) * 2020-09-18 2022-03-24 华为技术有限公司 File generation method and electronic device
CN114329297A (en) * 2021-12-29 2022-04-12 深圳晶泰科技有限公司 Content management system, static page management method, device and storage medium
CN114489622A (en) * 2022-02-15 2022-05-13 携程旅游网络技术(上海)有限公司 Js application, electronic device, and storage medium
CN114510231A (en) * 2020-11-17 2022-05-17 腾讯科技(深圳)有限公司 Application construction method, device, equipment and computer readable storage medium
US11356532B1 (en) * 2018-08-10 2022-06-07 Meta Platforms, Inc. Systems and methods for packaging web resources

Patent Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140331117A1 (en) * 2013-05-06 2014-11-06 Qualcomm Innovation Center, Inc. Application-based dependency graph
CN108280216A (en) * 2018-02-06 2018-07-13 曙光信息产业(北京)有限公司 A kind of page performance optimization method and device
US20190324989A1 (en) * 2018-04-18 2019-10-24 Palantir Technologies Inc. Resource dependency system and graphical user interface
US11356532B1 (en) * 2018-08-10 2022-06-07 Meta Platforms, Inc. Systems and methods for packaging web resources
CN109344348A (en) * 2018-09-20 2019-02-15 阿里巴巴集团控股有限公司 A kind of resource regeneration method and device
CN109634654A (en) * 2018-12-04 2019-04-16 北京马上慧科技术有限公司 A kind of page packaging method, device, system, computer equipment and storage medium
CN112287267A (en) * 2019-07-23 2021-01-29 北京京东尚科信息技术有限公司 Method and device for loading channel static resources
CN111209022A (en) * 2020-01-03 2020-05-29 支付宝(杭州)信息技术有限公司 Resource publishing and acquiring method, device and equipment
WO2022057663A1 (en) * 2020-09-18 2022-03-24 华为技术有限公司 File generation method and electronic device
CN114510231A (en) * 2020-11-17 2022-05-17 腾讯科技(深圳)有限公司 Application construction method, device, equipment and computer readable storage medium
CN112764806A (en) * 2021-02-27 2021-05-07 中电万维信息技术有限责任公司 Front-end resource modular management and resource packaging configuration method
CN113312032A (en) * 2021-06-25 2021-08-27 深圳集智数字科技有限公司 Front-end project resource updating method and device, electronic equipment and storage medium
CN114064032A (en) * 2021-11-12 2022-02-18 中国建设银行股份有限公司 Source code processing method and device, electronic equipment and storage medium
CN114329297A (en) * 2021-12-29 2022-04-12 深圳晶泰科技有限公司 Content management system, static page management method, device and storage medium
CN114489622A (en) * 2022-02-15 2022-05-13 携程旅游网络技术(上海)有限公司 Js application, electronic device, and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
王媛媛 等: "《Web全栈开发项目实战 Vue+Spring Boot》", vol. 1, 华中科技大学出版社, pages: 005 - 007 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116257719A (en) * 2023-05-16 2023-06-13 建信金融科技有限责任公司 Page updating method, page updating device, computer equipment and storage medium
CN116257719B (en) * 2023-05-16 2023-07-21 建信金融科技有限责任公司 Page updating method, page updating device, computer equipment and storage medium
CN117931093A (en) * 2024-03-20 2024-04-26 深圳鸿芯微纳技术有限公司 Global I/O distribution method and device and electronic equipment
CN117931093B (en) * 2024-03-20 2024-05-24 深圳鸿芯微纳技术有限公司 Global I/O distribution method and device and electronic equipment

Similar Documents

Publication Publication Date Title
CN108984714B (en) Page rendering method and device, electronic equipment and computer readable medium
JP6813152B2 (en) Methods, systems, and programs for determining the identification of software in a software container
CN111221521B (en) Method, device, computer system and readable storage medium for generating log code
US10185558B2 (en) Language-independent program composition using containers
US9952835B2 (en) Generation of hybrid enterprise mobile applications in cloud environment
CN111680253B (en) Page application data packet generation method and device, computer equipment and storage medium
CN111338623B (en) Method, device, medium and electronic equipment for developing user interface
US11023558B1 (en) Executing functions on-demand on a server utilizing web browsers
CN110795649A (en) Target page display method, device and system and electronic equipment
CN113505302A (en) Method, device and system for supporting dynamic acquisition of buried point data and electronic equipment
CN115982491A (en) Page updating method and device, electronic equipment and computer readable storage medium
CN114237651A (en) Installation method and device of cloud native application, electronic equipment and medium
CN113419740A (en) Program data stream analysis method and device, electronic device and readable storage medium
CN113535565B (en) Interface use case generation method, device, equipment and medium
CN113377376A (en) Data packet generation method, data packet generation device, electronic device, and storage medium
CN113656041A (en) Data processing method, device, equipment and storage medium
CN113326079A (en) Service version switching method, switching device, electronic equipment and storage medium
CN114254232A (en) Cloud product page generation method and device, computer equipment and storage medium
CN112068814A (en) Method, device, system and medium for generating executable file
CN116382703B (en) Software package generation method, code development method and device, electronic equipment and medium
CN115016827A (en) Method, device, electronic equipment and medium for deploying JAVA application
CN114237624A (en) Go language-based error processing method, device, equipment, medium and product
CN113535153A (en) Method, device, equipment and medium for encoding custom label
CN113778942A (en) File management method, file management device, computer system and computer-readable storage medium
CN115421873A (en) Dictionary construction method, and file evaluation method, device and equipment based on dictionary

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20230418

RJ01 Rejection of invention patent application after publication