Movatterモバイル変換


[0]ホーム

URL:


CN117539564A - Page hot updating method and device, electronic equipment and readable storage medium - Google Patents

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

Info

Publication number
CN117539564A
CN117539564ACN202311304033.0ACN202311304033ACN117539564ACN 117539564 ACN117539564 ACN 117539564ACN 202311304033 ACN202311304033 ACN 202311304033ACN 117539564 ACN117539564 ACN 117539564A
Authority
CN
China
Prior art keywords
page
update
type
hot
static resource
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
CN202311304033.0A
Other languages
Chinese (zh)
Inventor
张星亮
吴剑文
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Workec Technology Co ltd
Original Assignee
Shenzhen Workec Technology 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 Shenzhen Workec Technology Co ltdfiledCriticalShenzhen Workec Technology Co ltd
Priority to CN202311304033.0ApriorityCriticalpatent/CN117539564A/en
Publication of CN117539564ApublicationCriticalpatent/CN117539564A/en
Pendinglegal-statusCriticalCurrent

Links

Classifications

Landscapes

Abstract

The invention is applicable to the field of computer application, and provides a page hot updating method, a page hot updating device, electronic equipment and a readable storage medium, wherein the page hot updating method comprises the following steps: when a server instruction is monitored, determining the update type of the target page; if the update type is a static resource type, performing hot update on the local static resource; and re-calling the local static resource subjected to the hot updating in a preset calling mode, and directly executing the updated target page. When a server command is monitored, the update type of the target page is determined, and according to the condition that the update type is the static resource type, the local static resource is subjected to hot update, the local static resource subjected to hot update is called again through a preset calling mode, the updated target page is directly executed, and the problem that APP needs to be restarted in the hot update of the current page is solved.

Description

Page hot updating method and device, electronic equipment and readable storage medium
Technical Field
The present invention relates to the field of computer applications, and in particular, to a method and apparatus for hot updating a page, an electronic device, and a readable storage medium.
Background
In mobile applications, data interaction with a server is often required to obtain up-to-date data and update the state of the application. The current network logic layer presents bug or responds to the adjustment of market privacy policy of each big application, and the current App terminal needs to be repackaged and issued. At present, repacking is generally carried out, even if a three-party thermal repair framework is provided, apple equipment (iPhone, iPad) is not supported at present, and general thermal repair needs to restart App. There is an urgent need for a page hot update method to solve the problem that the APP needs to be restarted for the page hot update.
Disclosure of Invention
The embodiment of the invention provides a page hot updating method, which aims to solve the problem that APP needs to be restarted in page hot updating in the prior art. When a server command is monitored, the update type of the target page is determined, and according to the condition that the update type is the static resource type, the local static resource is subjected to hot update, the local static resource subjected to hot update is called again through a preset calling mode, the updated target page is directly executed, and the problem that APP needs to be restarted when the page is hot updated at present is solved.
The embodiment of the invention is realized in such a way that a page hot updating method is provided, which comprises the following steps:
monitoring a server instruction type, and determining the update type of a target page;
if the update type of the target page is a static resource type, performing hot update on the local static resource;
and re-calling the local static resource subjected to the hot updating in a preset calling mode, and directly executing the updated target page.
Optionally, before the step of monitoring the server instruction type and determining the update type of the target page, the method further includes:
initializing a page when the APP is started, and obtaining the initialized page;
and loading the initialized page to an APP interface to obtain a target page.
Optionally, the step of loading the initialized page onto an APP interface to obtain a target page includes:
setting page starting time;
and loading the initialized page to an APP interface, and entering the page when the page starting time is responded to obtain a target page.
Optionally, when the server instruction is monitored, the step of determining the update type of the target page includes:
when a server command is monitored, judging whether the command is a hot update command;
and if the instruction is a hot update instruction, determining the update type of the target page.
Optionally, if the update type is a static resource type, the step of performing a hot update on the local static resource includes:
if the update type is a static resource type, acquiring a corresponding static resource;
and carrying out hot update on the local static resources by the corresponding static resources.
Optionally, before the step of recalling the local static resource completed by the hot update through a preset calling mode, the method further includes:
acquiring type parameters, method name parameters and format parameters;
and calling and setting the method name parameter and the format parameter based on the type parameter to obtain a preset calling mode.
Optionally, the step of directly executing the updated target page includes:
based on the type parameter, the method name parameter and the format parameter recall the local static resource completed by the hot update;
and directly executing the updated target page when the page starting time response is based on the recalled local static resource.
The embodiment of the invention also provides a page hot updating device, which comprises:
the determining module is used for monitoring the instruction type of the server and determining the update type of the target page;
the hot updating module is used for carrying out hot updating on the local static resource if the updating type of the target page is the static resource type;
and the execution module is used for recalling the local static resource subjected to the hot update in a preset calling mode and directly executing the updated target page.
The embodiment of the invention also provides electronic equipment, which comprises a memory, a processor and a computer program stored in the memory and capable of running on the processor, wherein the processor realizes the page hot updating method according to any embodiment when executing the computer program.
Embodiments of the present invention also provide a computer readable storage medium storing a computer program which, when executed by a processor, implements a page hot update method as described in any of the embodiments.
The method and the device have the beneficial effects that the update type of the target page is determined when the server side instruction is monitored; if the update type is a static resource type, performing hot update on the local static resource; and re-calling the local static resource subjected to the hot updating in a preset calling mode, and directly executing the updated target page. When a server command is monitored, the update type of the target page is determined, and according to the condition that the update type is the static resource type, the local static resource is subjected to hot update, the local static resource subjected to hot update is called again through a preset calling mode, the updated target page is directly executed, and the problem that APP needs to be restarted when the page is hot updated at present is solved.
Drawings
FIG. 1 is a flowchart of a page hot update method according to an embodiment of the present application
FIG. 2 is a flowchart of another page hot update method according to an embodiment of the present disclosure;
FIG. 3 is a flowchart of another page hot update method according to an embodiment of the present disclosure;
FIG. 4 is a schematic diagram of the method types of invocation provided by embodiments of the present application;
FIG. 5 is a flowchart of another page hot update method according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of a page layout according to an embodiment of the present application;
FIG. 7 is a schematic diagram of a device for implementing logic dynamics based on webview according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a page hot updating device according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of another page thermal updating apparatus according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of the loading module in fig. 9 according to an embodiment of the present application;
fig. 11 is a schematic structural diagram of the first update module in fig. 8 according to an embodiment of the present application;
FIG. 12 is a schematic diagram of a page hot update apparatus according to another embodiment of the present disclosure;
FIG. 13 is a schematic diagram of the execution module of FIG. 8 according to an embodiment of the present application
Fig. 14 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The present invention will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present invention more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
Example 1
In this embodiment, fig. 1 shows a flowchart of a page hot update method provided in the embodiment of the present application. As shown in fig. 1, the method includes steps S101 to S103. The specific implementation principle of each step is as follows:
s101, when a server instruction is monitored, determining the update type of the target page.
In the embodiment of the invention, when the websocket monitors the server command, the websocket is linked with the server in a long way. Specifically, the interface is initialized when the APP is started, and the websocket is initialized when the interface enters the onCreate lifecycle.
The onCreate lifecycle can be understood as a lifecycle method for initializing some necessary resources, such as WebSocket.
The websocket is a network communication protocol based on the TCP protocol. The websocket long link can be sdk of a third party, or tcp socket can be adopted.
The above-mentioned instruction refers to a command for executing a certain operation, and a task or operation to be completed includes a data transfer instruction, an update instruction, a control instruction, and the like.
The server may be understood as a server, which is a core device of a network and provides computing services.
The target page can be different types of web pages, such as static web pages, dynamic web pages and the like. Static web pages are typically composed of static files such as HTML, CSS, and JavaScript. The content of the static web page does not change when accessed because the static web page does not interact with the server. Typically, static web pages are used to display static content, such as corporate information, news articles, and the like. The content of the dynamic web page changes upon access. This is because the content of the dynamic web page is dynamically generated from the server, typically implemented using server-side scripting languages (e.g., PHP, asp. Net, etc.). Dynamic web pages are commonly used to display personalized content, such as social media, e-commerce websites, and the like.
The target page may be a web page browsed by a user in the application program, and specifically may be a specific page that the user wants to access.
The update type refers to the type that the content and the state of the page need to be updated, and the update type can be a dynamic resource type or a static resource type.
The dynamic resource type refers to resources, such as articles, comments, user information, etc., which need to be read from a database or other data sources in real time during the running process of the web page. The dynamic resource needs to be processed through a script or a database of the request server, and a response result is generated at the server and then returned to the browser.
The static resource type refers to a resource which is directly read from a file system, such as a picture, CSS, javaScript, a font and the like, without being read from a database in real time in the running process of a webpage.
In the embodiment of the present invention, the target page may be a webview page. The invention is specifically illustrated in the webview page. Webview is a technology that can embed a browser in an application. The webview page can enable the application program to display the webpage, and meanwhile interaction with the webpage can be achieved.
Specifically, webview may employ sdk of the system, or may use Tencent X5 kernels.
S102, if the update type is the static resource type, performing hot update on the local static resource.
In the embodiment of the invention, the update type refers to the type that the content and the state of the page need to be updated.
The hot update refers to a method that when an application program is updated, an update package is not required to be completely downloaded, but only a part of the application program which is changed is updated in an incremental update mode, so that the update time and the network traffic are saved. The hot update is typically implemented by using incremental update (incremental update) or online update (online update), which can avoid a short shutdown or restart at the time of update, thereby improving the user experience.
The above-mentioned local static resource refers to a file that is stored locally and does not change, such as HTML, CSS, javaScript, a picture, audio, video, etc. These resources are cached locally by the browser when the web page is accessed, so that they can be loaded faster the next time access is made.
It should be noted that if the update type is a static resource type, the local static resource is updated thermally to improve the performance and user experience of the application.
S103, the local static resource subjected to hot updating is called again through a preset calling mode, and the updated target page is directly executed.
In the embodiment of the invention, the preset calling mode can be a JS calling method, a JS file dynamic loading method, a JS dynamic calling method and a JS active callback local method, and static resources are called when webview is initialized, and the webview address is the local static resources.
The invoking js method comprises a calling method and a callback method. The calling method is getMetHod (Stringtype, stringname, stringjson), wherein type represents the method type, name represents the method name in js, json represents the parameter json; if no parameters can pass through the pass-through object json ().
Further, if the calling method is a synchronous calling method, the result set is directly returned.
Further, if the calling method is an asynchronous callback method, the js file is recalled to the webview through a defined onCallBack method.
Above-mentioned onCaslBack (Stringtype, stringname, stringjson), type represents the method type of calling, name represents the json method name of calling (one-to-one correspondence), json result set json is divided into code and data, the code tells apps whether succeeded or failed, data are the data that apps need.
Specifically, the onCallBack is a callback function, which is used for executing a specific operation when a certain event occurs, and is used for informing a calling party of a callback method to be executed.
The updated target page may be the latest service page.
It should be noted that, through a preset calling mode, the local static resource with the completed hot update can be recalled in the application program, so that the latest service page is executed, and the application program is not required to be restarted to update the page.
In the embodiment of the invention, when a server instruction is monitored, the update type of the target page is determined; if the update type is a static resource type, performing hot update on the local static resource; and re-calling the local static resource subjected to the hot updating in a preset calling mode, and directly executing the updated target page. When a server command is monitored, the update type of the target page is determined, and according to the condition that the update type is the static resource type, the local static resource is subjected to hot update, the local static resource subjected to hot update is called again through a preset calling mode, the updated target page is directly executed, and the problem that APP needs to be restarted when the page is hot updated at present is solved.
Optionally, before step S101, the method further includes:
and initializing the page when the APP is started, and obtaining the initialized page.
And loading the initialized page onto an APP interface to obtain a target page.
In the embodiment of the present invention, APP (Application) refers generally to a third party application of a smart phone. Such as a Tencentrated microblog development platform and a hundred-degree application platform.
The initialization may be understood as a process of restoring some settings to a start state, such as the initialization of software will restore some functional settings to a start setting.
The target page may be a web page browsed by a user in the application program, and specifically may be a specific page that the user wants to access.
Further, when the APP is started, an initialization page is first entered, where the initialization page contains some necessary information, such as application name, version number, author, etc.
In one embodiment, when the APP is started, the webview is initialized when the initialization page is started, the width of the webview is set to be 0.01px, the height of the webview is set to be 0.01px, and the background color is transparent.
Specifically, the APP starts to open a start page and loads webview.
Optionally, in the step of loading the initialized page onto the APP interface to obtain the target page, the time for starting the page may be set; loading the initialized page onto an APP interface, and entering the page when the page time response is started to obtain a target page.
In the embodiment of the present invention, the above-mentioned start page time may be set to 1200 ms, 1500 ms or 1600 ms. Specifically, when a page is started, the main interface is accessed after 1200 milliseconds are up; when the page is started, the main interface is accessed after 1500 milliseconds are up; when the page is launched, 1600 milliseconds arrive before entering the main interface.
Specifically, the page starting time is preset, and when the page starting time is set, the target page is entered.
Further, the APP starts to open the starting page, loads webview, and formally enters the target page when the starting page time responds.
Optionally, when the server instruction is monitored, in the step of determining the update type of the target page, whether the instruction is a hot update instruction is determined when the server instruction is monitored; if the instruction is a hot update instruction, determining the update type of the target page.
In the embodiment of the invention, when the websocket monitors the server command, the websocket is linked with the server. Specifically, the interface is initialized when the APP is started, and the websocket is initialized when the interface enters the onCreate lifecycle.
The onCreate lifecycle can be understood as a lifecycle method for initializing some necessary resources, such as WebSocket. The websocket is a network communication protocol based on the TCP protocol.
The server may be understood as a server, a core device of a network, a device providing a computing service,
the above-mentioned instruction refers to a command for executing a certain operation, and a task or operation to be completed includes a data transfer instruction, an update instruction, a control instruction, and the like.
The hot update is that when the application program is updated, the update package is not required to be completely downloaded, but only the part of the application program which is changed is updated in an incremental update mode, so that the update time and the network traffic are saved.
The update type refers to the type that the content and the state of the page need to be updated, and the update type can be a dynamic resource type or a static resource type.
Optionally, in the step of performing hot update on the local static resource if the update type is the static resource type, the corresponding static resource may be obtained; and carrying out hot update on the local static resources by the corresponding static resources.
In the embodiment of the present invention, the static resources refer to resources, such as pictures, CSS, javaScript, fonts, and the like, that are directly read from a file system without being read from a database in real time during the running process of a web page.
The corresponding static resource may be understood as the latest static resource that the server issues the instruction.
The hot update is that when the application program is updated, the update package is not required to be completely downloaded, but only the part of the application program which is changed is updated in an incremental update mode, so that the update time and the network traffic are saved.
Furthermore, the latest static resources are directly loaded into the local static resource memory without being downloaded and installed again, so that the occupation of network broadband can be improved and reduced, and the normal operation of the application program is ensured.
Optionally, before step S103, the method further includes:
acquiring type parameters, method name parameters and format parameters;
and calling and setting based on the type parameter, the method name parameter and the format parameter to obtain a preset calling mode.
In the embodiment of the invention, the type parameter can be understood as a calling method type; the method name parameter can be understood as the type of the called method; the format parameter may be understood as parameter json.
The preset calling mode can be a JS method, a JS file dynamic loading method, a JS file dynamic calling method and a JS active callback local method, and static resources are called when webview is initialized, and the webview addresses are local static resources.
The invoking js method comprises a calling method and a callback method. The calling method is getMetHod (Stringtype, stringname, stringjson), wherein type represents the method type, name represents the method name in js, json represents the parameter json; if no parameters can pass through the pass-through object json ().
Further, if the calling method is a synchronous calling method, the result set is directly returned.
Further, if the calling method is an asynchronous callback method, the js file is recalled to the webview through a defined onCallBack method.
Above-mentioned onCaslBack (Stringtype, stringname, stringjson), type represents the method type of calling, name represents the json method name of calling (one-to-one correspondence), json result set json is divided into code and data, the code tells apps whether succeeded or failed, data are the data that apps need.
Specifically, the onCallBack is a callback function, which is used for executing a specific operation when a certain event occurs, and is used for informing a calling party of a callback method to be executed.
Optionally, in the step of directly executing the updated target page by re-calling the local static resource after the hot update in a preset calling mode, the local static resource after the hot update can be re-called based on the type parameter, the method name parameter and the format parameter; based on the recalled local static resources, when the page time response is started, the updated target page is directly executed.
In the embodiment of the present invention, the above-mentioned start page time may be set to 1200 ms, 1500 ms or 1600 ms.
The updated target page may be the latest service page.
Furthermore, when the local static resource hot update is completed, the webview can recall the local static resource in a preset calling mode, and the APP can execute the latest service page without restarting.
Specifically, when the page starting time is 1200 milliseconds, directly executing the latest business page; when the time for starting the page is 1500 milliseconds, directly executing the latest business page; when the page starting time is 1600 milliseconds, the latest business page is directly executed.
In one possible embodiment, APP reboots or logs in again to execute the latest business page.
Example two
In this embodiment, please refer to fig. 2, fig. 2 is a flowchart of another page hot update method provided in the embodiment of the present application. Specifically, application is initialized when the Application is started, and websocket is initialized when the Application enters the onCreate life cycle; the websocket and the server keep long links, and heat is generated under js files to update the files when necessary; when the App enters a starting interface (large logo interface), the starting interface is not closed; initializing webview when initializing a starting interface; when the websocket monitors 4002 instructions, the local static resources of the business logic need to be updated, the app downloads the static resources to the local, and when the downloading is completed, the webview can recall a loadurl (local static resources) method, and the app can execute the latest business logic layer and the data processing layer without restarting; later app restart or logging in again can also execute the latest business logic layer and data processing layer, because the static resources are already downloaded into app local private directory (belonging to the physical storage type); when the page is started, the main interface is entered after the page starting timer responds, and it is noted that the page is not closed when the next interface is entered, because the page is started, and the hot update webview is needed to be updated at any time.
In the embodiment of the present invention, the onCreate lifecycle may be understood as a lifecycle method for initializing some necessary resources, such as Websocket.
The websocket is a network communication protocol based on the TCP protocol.
The invention may be a webview page. The invention is specifically illustrated in the webview page. Webview is a technology that can embed a browser in an application. The webview page can enable the application program to display the webpage, and meanwhile interaction with the webpage can be realized
Specifically, the WebView width may be set to 0.01px, the WebView height may be set to 0.01px, and the background color may be transparent.
The WebView described above provides 3 call modes: 1) A js file dynamic loading method; 2) Dynamically calling a method; 3) The JS actively calls back to native (local); the webview is initialized to call loadurl (static resource), and the web address is a local file address (static resource).
In the embodiment of the present invention, the 4002 instruction may be understood as a static resource hot update instruction.
Further, webview is mainly used for performing service logic hot update operation.
In the embodiment of the present invention, the above-mentioned start page timer may be set to 1200 ms, 1500 ms or 1600 ms.
Specifically, when a page is started, the main interface is accessed after 1200 milliseconds are up; when the page is started, the main interface is accessed after 1500 milliseconds are up; when the page is launched, 1600 milliseconds arrive before entering the main interface.
Example III
In this embodiment, as shown in fig. 3, fig. 3 is a flowchart of another page hot update method provided in the embodiment of the present application. Specifically, when the App needs to execute a certain business logic, a js method is called by using webview; js has only one calling method and one callback method in total.
Specifically, the calling method is getMetHod (String type, string name, string json), wherein type is a method type, name is a method name in js, and json is a parameter json.
Furthermore, if the calling method has no parameter, the object json () can be emptied.
Further, if the calling method is synchronous calling, a result set is directly returned.
Further, if the calling method is an asynchronous callback (time-consuming logic), the js file is recalled to the webview through a defined onCallBack method; onCaslBack (Stringtype, stringname, stringjson), type represents the type of the called method, name represents the name of the called js method (one-to-one correspondence), json result set json is divided into code and data, the code tells the app whether to succeed or fail, and the data is the data needed by the app.
Example IV
In this embodiment, based on the third embodiment, as shown in fig. 4, fig. 4 is a schematic diagram of the type of the calling method provided in the embodiment of the present application. Specifically, the invoked method class includes a business class, a database class, and a tool class.
In the embodiment of the present invention, the service class is denoted as 001, and includes domain name constants, network requests, privacy protocols, web addresses, applet sharing addresses, data parsing/data assembling, and the like.
The database class is denoted 002 and includes sql statements.
The above tool class is denoted 003, and the tool class includes tool methods and algorithms.
Example five
In this embodiment, as shown in fig. 5, fig. 5 is a flowchart of another page hot update method provided in the embodiment of the present application. Specifically, the App starts to open a starting page, loads webview, and formally enters a service interface when a starting page timer responds; when the App is initialized, an App interface manager List is initialized, and the interface manager is mainly used for monitoring the opening and closing of the interface; when the interface is opened, adding the interface object View to list < View > in the interface manager; when the interface is closed, removing the closed interface View from the List < View > in the interface manager; if the current interface index-1 is the starting interface when the interface is closed, the last view in the application is indicated at the time, and because the starting page is not closed, the last view in the application needs to be closed, and the application needs to be completely exited.
In the embodiment of the present invention, the above-mentioned start page timer may be set to 1200 ms, 1500 ms or 1600 ms.
Specifically, when a page is started, formally entering a service interface after 1200 milliseconds are up; when the page is started, formally entering a service interface after 1500 milliseconds are up; when the page is launched, 1600 milliseconds arrive after which the business interface is entered.
Example six
In this embodiment, as shown in fig. 6, fig. 6 is a schematic structural diagram of a page layout according to an embodiment of the present application. Specifically, the APP starts to open a starting page, loads webview, formally enters a service interface when a starting page timer responds, and the starting interface is provided with service thermal repair webview; when the App is initialized, initializing an App interface manager List; when the interface is opened, adding a service logic interface 1 … … service logic interface N into the manager List; when the interface is closed, removing the closed business logic interface 1 … … business logic interface N from the interface manager List; if the close interface is the start interface, the application needs to exit completely.
In the embodiment of the present invention, the above-mentioned start page timer may be set to 1200 ms, 1500 ms or 1600 ms.
Specifically, when a page is started, formally entering a service interface after 1200 milliseconds are up; when the page is started, formally entering a service interface after 1500 milliseconds are up; when the page is launched, 1600 milliseconds arrive after which the business interface is entered.
In the embodiment of the invention, the starting page is not closed when entering the next interface of the starting page, because the starting page has a hot update webview, and service logic update needs to be performed at any time.
Example seven
In this embodiment, as shown in fig. 7, fig. 7 is a schematic diagram of a device for implementing logic dynamic based on webview according to an embodiment of the present application. Specifically, the method comprises the following steps: global user unaware webview, webview hangs on the starting page, interface stack management, webview dynamic loading of local static resources, static resources support hot update, loadurl method support hot update, js method classification, js method synchronous call and js method asynchronous callback.
In the embodiment of the invention, the webview can be a control for displaying a webpage, and the system SDK can use a Tencement X5 kernel.
The above interface stack management may be understood as that the interface manager List is used to monitor the interface startup and monitor the false surface shutdown.
The hot update is that when the application program is updated, the update package is not required to be completely downloaded, but only the part of the application program which is changed is updated in an incremental update mode, so that the update time and the network traffic are saved.
The loadurl method described above can be understood as a static resource method.
The JS method can be a method for dynamically loading JS files, a dynamic calling method or a method for actively calling JS back to the local. And calling a loadurl method when webview is initialized, wherein the webview address is a local static resource.
The js method synchronous call can be understood as getMetHod (String type, string name, string json); type represents a method type, name represents a method name in js, json represents a parameter json; if there is no parameter, the object json () can be emptied.
The js method asynchronous callback can be understood as onCallBack (String type, string name, string json), type represents the type of the called method, name represents the name (one-to-one correspondence) of the called js method, json result set json is divided into code and data, the code tells the app whether success or failure occurs, and the data is the data required by the app.
In the embodiment of the invention, if the js method is synchronously called, a result set is directly returned; if the js method calls back asynchronously, the js file is called back to webview through a defined onCallBack method.
Example eight
Corresponding to the above-mentioned page hot updating method shown in fig. 1, fig. 8 is a schematic diagram of a page hot updating apparatus provided in an embodiment of the present application, where the apparatus M80 includes:
the determining module M801 is used for determining the update type of the target page when the server side instruction is monitored;
the thermal update module M802 is configured to perform thermal update on the local static resource if the update type is a static resource type;
and the execution module M803 is used for recalling the local static resource subjected to the hot update in a preset calling mode and directly executing the updated target page.
Optionally, the first obtaining module M1101 is further configured to request a page status value of the target web page from a server, so that the server returns the page status value of the target web page.
Optionally, referring to fig. 9, fig. 9 is a schematic structural diagram of another page thermal updating apparatus provided in an embodiment of the present application. The apparatus M80 further comprises:
the processing module M804 is used for initializing the page when the APP is started to obtain an initialized page;
and the loading module M805 is configured to load the initialized page onto an APP interface to obtain a target page.
Alternatively, referring to fig. 10, fig. 10 is a schematic structural diagram of a loading module according to an embodiment of the present application. The loading module M805 includes:
a setting submodule M8051 for setting the starting page time;
and the loading submodule M8052 is used for loading the initialized page onto an APP interface, and entering the page when the page starting time is responded to obtain a target page.
Alternatively, referring to fig. 11, fig. 11 is a schematic structural diagram of a determining module provided in an embodiment of the present application. The determining module M801 includes:
the judging submodule M8011 is used for judging whether the instruction is a hot update instruction or not when the instruction of the server side is monitored;
and the determination submodule M8012 is used for determining the update type of the target page if the instruction is a hot update instruction.
Optionally, referring to fig. 12, a schematic diagram of another page hot updating apparatus provided in an embodiment of the present application, apparatus M80 further includes:
an obtaining module M806, configured to obtain a type parameter, a method name parameter and a format parameter;
the setting module M807 is configured to perform call setting based on the type parameter, the method name parameter and the format parameter, so as to obtain a preset call mode.
Optionally, referring to fig. 13, a schematic structural diagram of an execution module provided in an embodiment of the present application, the execution module M803 includes:
a calling sub-module M8031, configured to recall the local static resource completed by the hot update based on the type parameter, the method name parameter and the format parameter;
and the execution submodule M8032 is used for directly executing the updated target page when the page starting time response is based on the recalled local static resource.
Example nine
Fig. 14 is a schematic structural diagram of an electronic device according to an embodiment of the present application. As shown in fig. 14, the electronic device D14 of this embodiment includes: at least one processor D140 (only one shown in fig. 14), a memory D141, a network interface D142, and a computer program stored in the memory D141 and executable on the at least one processor D140. The processor D140 is configured to call a computer program stored in the memory D141, and perform the following steps:
monitoring a server instruction type, and determining the update type of a target page;
if the update type of the target page is a static resource type, performing hot update on the local static resource;
and re-calling the local static resource subjected to the hot updating in a preset calling mode, and directly executing the updated target page.
Optionally, before the step of monitoring the server instruction type and determining the update type of the target page, the method executed by the processor D140 further includes:
initializing a page when the APP is started, and obtaining the initialized page;
and loading the initialized page to an APP interface to obtain a target page.
Optionally, the step of loading the initialized page to the APP interface performed by the processor D140 to obtain the target page includes:
setting page starting time;
and loading the initialized page to an APP interface, and entering the page when the page starting time is responded to obtain a target page.
Optionally, when the processor D140 monitors the server instruction, the step of determining the update type of the target page includes:
when a server command is monitored, judging whether the command is a hot update command;
and if the instruction is a hot update instruction, determining the update type of the target page.
Optionally, when the update type is a static resource type, the step of performing a hot update on the local static resource performed by the processor D140 includes:
if the update type is a static resource type, acquiring a corresponding static resource;
and carrying out hot update on the local static resources by the corresponding static resources.
Optionally, before the step of recalling the local static resource completed by the hot update through a preset recall manner, the method executed by the processor D140 further includes:
acquiring type parameters, method name parameters and format parameters;
and calling and setting the method name parameter and the format parameter based on the type parameter to obtain a preset calling mode.
Optionally, the step executed by the processor D140 of recalling the local static resource completed by the hot update through a preset recall manner, and directly executing the updated target page includes:
based on the type parameter, the method name parameter and the format parameter recall the local static resource completed by the hot update;
and directly executing the updated target page when the page starting time response is based on the recalled local static resource.
The electronic device D14 provided by the embodiment of the present invention can implement each implementation manner and corresponding beneficial effects in the embodiment of the page hot update method, and in order to avoid repetition, a description is omitted here.
d140-D142, it is understood that not all illustrated components are required to be implemented, and that more or fewer components may alternatively be implemented. It will be understood by those skilled in the art that the electronic device herein is a device capable of automatically performing numerical calculation and/or information processing according to a preset or stored instruction.
The processor D140 may be a central processing unit (Central Processing Unit, CPU) in some embodiments, the processor D140 may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSPs), application specific integrated circuits (Application Specific Integrated Circuit, ASICs), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory D141 may in some embodiments be an internal storage unit of the electronic device D14, such as a hard disk or a memory of the electronic device D14. The memory D141 may also be an external storage device of the electronic device D14 in other embodiments, for example, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card) or the like, which are provided on the electronic device D14. Further, the memory D141 may also include both an internal storage unit and an external storage device of the electronic device D14. The memory D141 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, etc., such as program codes of the computer program. The memory D141 may also be used to temporarily store data that has been output or is to be output.
The D142 may comprise a wireless network interface or a wired network interface, which network interface D142 is typically used for establishing a communication connection between the electronic device D14 and other electronic devices.
The embodiment of the present invention further provides a computer readable storage medium, where a computer program is stored, where the computer program when executed by the processor D140 implements each procedure of the page hot update method embodiment provided by the embodiment of the present invention, and the same technical effects can be achieved, so that repetition is avoided, and details are not repeated here.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the present application implements all or part of the flow of the method of the above embodiments, and may be implemented by a computer program to instruct related hardware, where the computer program may be stored in a computer readable storage medium, where the computer program, when executed by a processor, may implement the steps of each of the method embodiments described above. Wherein the computer program comprises computer program code which may be in source code form, object code form, executable file or some intermediate form etc. The computer readable medium may include at least: any entity or device capable of carrying computer program code to a photographing device/terminal apparatus, recording medium, computer Memory, read-Only Memory (ROM), random access Memory (Random Access Memory, RAM), electrical carrier signals, telecommunications signals, and software distribution media. Such as a U-disk, removable hard disk, magnetic or optical disk, etc.
The terms first, second and the like in the description and in the claims or in the above-described figures, are used for distinguishing between different objects and not necessarily for describing a sequential or chronological order. Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the present application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments.
The foregoing description of the preferred embodiments of the invention is not intended to be limiting, but rather is intended to cover all modifications, equivalents, and alternatives falling within the spirit and principles of the invention.

Claims (10)

CN202311304033.0A2023-10-092023-10-09Page hot updating method and device, electronic equipment and readable storage mediumPendingCN117539564A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202311304033.0ACN117539564A (en)2023-10-092023-10-09Page hot updating method and device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202311304033.0ACN117539564A (en)2023-10-092023-10-09Page hot updating method and device, electronic equipment and readable storage medium

Publications (1)

Publication NumberPublication Date
CN117539564Atrue CN117539564A (en)2024-02-09

Family

ID=89794631

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202311304033.0APendingCN117539564A (en)2023-10-092023-10-09Page hot updating method and device, electronic equipment and readable storage medium

Country Status (1)

CountryLink
CN (1)CN117539564A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN118689522A (en)*2024-08-272024-09-24杭州海康威视数字技术股份有限公司 A cloud platform control updating method, device, cloud platform control and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN118689522A (en)*2024-08-272024-09-24杭州海康威视数字技术股份有限公司 A cloud platform control updating method, device, cloud platform control and storage medium

Similar Documents

PublicationPublication DateTitle
CN109547570B (en)Service registration method, device, registration center management equipment and storage medium
US10713034B2 (en)Updating web resources
US10263910B2 (en)Resource calling for hybrid applications
US8527862B2 (en)Methods for making ajax web applications bookmarkable and crawlable and devices thereof
WO2020199751A1 (en)Method and apparatus for loading page picture, and electronic device
CN112612982A (en)Webpage preloading method and device and computer equipment
CN109725923A (en)A kind of software light weight update method, device and equipment
CN111079048B (en)Page loading method and device
CN112559927A (en)Webpage loading method and device
CN112818270A (en)Data cross-domain transfer method and device and computer equipment
CN107798064A (en)Page processing method, electronic equipment and computer-readable recording medium
CN110851204A (en)Application starting method and device and application packaging method and device
CN112214250A (en)Application program assembly loading method and device
CN112926002A (en)Service request processing method and device
CN117539564A (en)Page hot updating method and device, electronic equipment and readable storage medium
CN112099965A (en)Method and device for calling JS (JavaScript) by native application, electronic equipment and storage medium
CN110221830B (en)Method and system for loading WebView on PC
CN117707583A (en)Page updating method, electronic device and page updating system
CN111538926A (en)Automatic offline package publishing method and device, electronic equipment and storage medium
CN117112940A (en)Offline data display method and device, electronic equipment and readable storage medium
CN114721941A (en)Environment switching method, system, computer equipment and computer readable storage medium
CN112306723B (en)Operation information acquisition method and device applied to applet
CN114117273A (en)Page loading method and device, computer equipment and storage medium
CN113934953B (en) Web page first screen rendering method and device
CN116016648B (en) A service preheating method and device

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination

[8]ページ先頭

©2009-2025 Movatter.jp