A mini-program thermal repair method, device, and electronic device
Download and parse object code files through the WebView engine, load repair codes to repair the Native engine, solve the problem that the Native engine needs to upgrade the host APP in the existing technology, and realize hot repair without updating the host APP, reducing repair costs and improving user experience.
Patent Information
- Application Number
- CN202111566681.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-20
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2041-12-20
Smart Images

Figure CN114265610B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, in particular to the field of mini-program technology, and specifically to a mini-program hot repair method, device, and electronic device. Background Art
[0002] Mini Programs are a cross between native apps (native applications) and web apps (web applications), offering both the dynamic rendering capabilities of web apps and the high performance of native apps. As an open ecosystem, mini programs have attracted a large number of host apps to access the mini program SDK (Software Development Kit), which includes both a WebView engine and a native engine.
[0003] In related technologies, if a problem occurs with the Native engine, the developer of the host APP will report the problem to the developer of the mini program, and then re-integrate the SDK containing the repaired Native engine, that is, solve the problem by upgrading the host APP. Summary of the Invention
[0004] The present disclosure provides a method, device, and electronic device for hot-repairing a small program.
[0005] According to one aspect of the present disclosure, a method for hot-fixing an applet is provided, comprising:
[0006] Obtaining a target code file downloaded by a WebView engine; wherein the target code file is a file used to perform code repair on a native engine; the target code file is a file downloaded by the WebView engine when downloading its own hot update file from a preset server;
[0007] Parsing the target code file to obtain the parsed repair code corresponding to the target code file;
[0008] The parsed repair code corresponding to the target code file is loaded to perform code hot repair on the Native engine.
[0009] According to another aspect of the present disclosure, a thermal repair device for a small program is provided, comprising:
[0010] An acquisition module, configured to acquire a target code file downloaded by a WebView engine; wherein the target code file is a file used to perform code repair on a native engine; and the target code file is a file downloaded by the WebView engine when downloading its own hot update file from a preset server;
[0011] A first parsing module, configured to parse the target code file to obtain a parsed repair code corresponding to the target code file;
[0012] The loading module is used to load the parsed repair code corresponding to the target code file to perform code hot repair on the Native engine.
[0013] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the steps of the above-mentioned applet hot repair method.
[0014] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the steps of the above-mentioned method for hot repairing a small program.
[0015] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, which implements the steps of the above-mentioned method for hot repairing a small program when executed by a processor.
[0016] This solution can achieve the purpose of hot-fixing the Native engine without updating the host APP.
[0017] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The accompanying drawings are provided to facilitate a better understanding of the present invention and do not constitute a limitation of the present disclosure.
[0019] Figure 1 This is a flow chart of a method for hot repairing a small program according to the present disclosure;
[0020] Figure 2 is another flow chart of a method for hot repairing an applet according to the present disclosure;
[0021] Figure 3 This is an architectural diagram of a hot fix method for a mini-program according to the present disclosure;
[0022] Figure 4 This is a schematic diagram of the structure of a thermal repair device according to the disclosed applet;
[0023] Figure 5 4 is a block diagram of an electronic device used to implement the hot repair method of the applet of the embodiment of the present disclosure. DETAILED DESCRIPTION
[0024] The following description of exemplary embodiments of the present disclosure is made in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding. These details should be considered as merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0025] Below, the professional terms involved in the present invention are first explained:
[0026] WebView Engine: Provides the front-end environment for the mini-program runtime and loads the developer code for the mini-program. The WebView Engine can also be called the WebView runtime framework.
[0027] Native engine: provides the runtime environment of the WebView engine and calls the system API (Application Programming Interface), such as calling positioning, map, Bluetooth, video player and other APIs; and the Native engine can also be called the Native runtime framework.
[0028] Mini Program SDK: Also known as the Mini Program Basic Library, it enables the host app connected to the Mini Program to have the ability to run the Mini Program. The Mini Program Basic Library provides a rich set of native APIs that can easily call up the native capabilities provided by the host app, such as obtaining user information, local storage, payment functions, etc.
[0029] In related technologies, the Mini Program SDK includes a Native engine and a WebView engine. If there is a problem with the WebView engine, it can be fixed at any time through a hot update. However, if there is a problem with the Native engine, the developer of the host app will report the problem to the Mini Program developer, and then re-connect the SDK containing the repaired Native engine. In other words, the problem needs to be fixed by upgrading the host app, resulting in very high overall repair and communication costs. Among them, when a problem occurs with the Native engine, if the user does not upgrade the app, it may cause problems such as the Mini Program function being unavailable or crashing.
[0030] Furthermore, existing hot-fix solutions for the Native engine in related technologies are all based on a single host app entry point. For example, for a 2.0 version Mini Program SDK, the Mini Program SDK includes a repaired Native engine relative to version 1.0. If a shopping app needs to hot-fix the Mini Program's Native engine, it can only be repaired through the shopping app's own hot-fix entry point, meaning the shopping app itself is updated without the user's knowledge, and the updated shopping app has the 2.0 version of the Mini Program SDK connected to it. If a video playback app needs to hot-fix the Native engine in the Mini Program SDK, it can only be repaired through the video playback app's own hot-fix entry point, meaning the video playback app itself is updated without the user's knowledge, and the updated video playback app has the 2.0 version of the Mini Program SDK connected to it. It can be seen that when hot-fixing the Native engine based on a single host app entry point, each host app needs to be repaired separately to achieve the purpose of repairing the Native engine.
[0031] Based on the above content, how to implement hot repair of the native engine of the host APP's mini program without updating the host APP, the embodiments of the present disclosure provide a mini program hot repair method, device and electronic device.
[0032] The following first introduces a method for hot repairing a small program provided by an embodiment of the present disclosure.
[0033] The hot repair method of a small program provided in the embodiment of the present disclosure can be applied to an electronic device. In a specific application, for example, the electronic device can be a terminal device. In practical applications, the terminal device can be: a smart phone, a tablet computer, a desktop computer, etc. In addition, the present disclosure does not limit the operating system of the electronic device. For example, the electronic device can run an IOS system (a mobile operating system developed by Apple) or an Android system, etc.
[0034] Specifically, the execution entity of the mini program's hot repair method can be the mini program's native engine.
[0035] Furthermore, the present disclosure does not limit the specific types of mini programs. For example, the types of mini programs may be shopping, information, or games.
[0036] The hotfix method for a mini-program provided in the embodiments of the present disclosure may include the following steps:
[0037] Obtaining a target code file downloaded by the WebView engine; wherein the target code file is a file used to perform code repair on the Native engine; the target code file is a file downloaded by the WebView engine when downloading its own hot update file from a preset server;
[0038] Parsing the target code file to obtain the parsed repair code corresponding to the target code file;
[0039] The parsed repair code corresponding to the target code file is loaded to perform code hot repair on the native engine.
[0040] In the solution provided by the present disclosure, when the WebView engine downloads its own hot update file from a preset server, it also downloads the target code file used to perform code repairs on the Native engine. In this way, the Native engine can obtain the target code file downloaded by WebView and parse the target code file to obtain the parsed repair code corresponding to the target code file. Then, the parsed repair code corresponding to the target code file is loaded to perform hot repairs on the Native engine. As can be seen, by downloading the target code file for code repairs for the Native engine at the same time as the WebView engine is hot updated, the Native engine can perform hot repairs based on the target code file, thereby achieving the purpose of hot repairing the Native engine without updating the host app.
[0041] The following describes the hot repair method for the mini-program provided by the embodiment of the present disclosure in conjunction with the accompanying drawings.
[0042] like Figure 1 As shown, a method for hot-repairing a small program provided by an embodiment of the present disclosure may include the following steps:
[0043] S101, obtaining a target code file downloaded by a WebView engine; wherein the target code file is a file used to perform code repair on the Native engine; the target code file is a file downloaded by the WebView engine when downloading its own hot update file from a preset server;
[0044] In this embodiment, the target code file is a code file for repairing problems existing in the Native engine. The target code file can be stored on a preset server, and the preset server can store WebView engines under different versions of the mini program SDK.
[0045] It should be noted that when the developer of the Mini Program SDK discovers a problem with the code in the Native Engine, they will write a patch package to fix the problem, that is, the target code file, and pre-store the target code file on a preset server. When the host app that integrates the Mini Program SDK enters the Mini Program runtime environment, it will load the WebView engine. At this time, the WebView engine can obtain the target code file stored on the preset server while obtaining the WebView engine's hot update file from the preset server.
[0046] For example, the WebView engine in the mini-program of the host APP can send a hot update request to the preset server, and the hot update request carries the current version number of the Web engine; accordingly, the preset server can receive the current version number sent by the WebView engine and search for the latest version number of the Web engine; if it is detected that the latest version number is different from the current version number, the hot update file can be fed back to the WebView engine. At the same time, if it is detected that the target code file exists, the target code file can be fed back to the WebView engine.
[0047] After the WebView engine downloads the hot update file of the WebView engine and the target code file for fixing code problems from the preset server, the Native engine can obtain the target code file from the WebView engine.
[0048] Alternatively, in one implementation, provided that a bidirectional link can be established between the Native engine and the WebView engine, the Native engine can periodically request the target code file from the WebView engine. Accordingly, if the WebView engine has already downloaded the target code file and has not yet sent it to the Native engine, it can provide the Native engine with the downloaded target code file. In this implementation, the Native engine proactively requests the target code file from the WebView engine.
[0049] Optionally, in one implementation, obtaining the target code file downloaded by the web view WebView engine includes:
[0050] Receive the target code file sent by the web view WebView engine and downloaded by the WebView engine.
[0051] In this implementation, the Native engine can passively receive the target code file sent by the WebView engine and downloaded by the WebView engine. It can be understood that in this implementation, a one-way link can be established from the WebView engine to the Native engine; and after downloading the target code file from the preset server, the WebView engine can actively send the downloaded target code file to the Native engine. This greatly reduces the interaction cost between the WebView engine and the Native engine compared to the method where the Native engine actively requests the target code file.
[0052] Exemplarily, receiving a target code file sent by a web view WebView engine and downloaded by the WebView engine includes:
[0053] Receive the target code file downloaded by the WebView engine and sent by the WebView engine by calling a specified interface; wherein the specified interface is an interface for transferring files to the Native engine.
[0054] For example, for the iOS system, the JavaScriptCore framework is used to implement the interaction principle between the dynamic language features of the JS (JavaScript) language and the OC (Objective C) language. Accordingly, the designated interface can be a preHotFix (preset hot fix) interface. By calling the designated interface, the preset Native engine hot fix method can be triggered, and the target code file can be passed to the Native engine. The preHotFix interface can also be called the preHotFix terminal capability entry.
[0055] S102, parsing the target code file to obtain a parsed repair code corresponding to the target code file;
[0056] It is understandable that the target code file pre-stored on the preset server can be a file compressed according to certain encoding rules. Therefore, after the Native engine obtains the target code file through step S101, it can perform code parsing on the target code file to obtain the parsed repair code corresponding to the target code file.
[0057] S103: Load the parsed repair code corresponding to the target code file to perform code hot repair on the Native engine.
[0058] After obtaining the parsed repair code corresponding to the target code file in step S102, the Native engine can load the repair code to replace the problem code in the Native engine with the repair code, thereby implementing code hot repair of the Native engine.
[0059] In one implementation, the repair code may be used to replace the problem code in the Native engine by injecting the repair code into a hot repair framework in the Native engine to replace the problem code.
[0060] Exemplarily, the above-mentioned hot repair framework can be the AndFix hot repair framework, which can be used to replace methods; exemplary, the above-mentioned hot repair framework can also be the Tinker hot repair framework, which can be used to replace methods, classes, class structures, and resources. It should be noted that the AndFix hot repair framework and the Tinker hot repair framework are exemplary hot repair frameworks that can replace problem codes. In specific applications, the appropriate hot repair framework can be selected according to specific business needs, and the embodiments of the present disclosure do not limit this.
[0061] In the solution provided by the present disclosure, when the WebView engine downloads its own hot update file from a preset server, it also downloads the target code file used to perform code repairs on the Native engine. In this way, the Native engine can obtain the target code file downloaded by WebView and parse the target code file to obtain the parsed repair code corresponding to the target code file. Then, the parsed repair code corresponding to the target code file is loaded to perform hot repairs on the Native engine. As can be seen, by downloading the target code file for code repairs for the Native engine at the same time as the WebView engine is hot updated, the Native engine can perform hot repairs based on the target code file, thereby achieving the purpose of hot repairing the Native engine without updating the host app.
[0062] Optionally, in another embodiment of the present disclosure, as Figure 2 As shown, a method for hot-fixing a small program may include the following steps:
[0063] S201, obtaining a target code file downloaded by a WebView engine; wherein the target code file is a file used to perform code repair on the Native engine; the target code file is a file downloaded by the WebView engine when downloading its own hot update file from a preset server;
[0064] S202, performing code parsing on the target code file to obtain a parsed repair code corresponding to the target code file;
[0065] S203: Load the parsed repair code corresponding to the target code file to perform code hot repair on the Native engine.
[0066] The contents of steps S201-S203 are the same as those of steps S101-S103 in the above embodiment, and are not repeated here.
[0067] S204: If receiving the target code file fails, sending a file acquisition request to a preset server, so that the preset server feeds back a specified file corresponding to the file acquisition request to the native engine; wherein the file acquisition request is used to obtain a file for code repair for the native engine;
[0068] Exemplarily, the Native engine determines that the target code file has failed to be received by: the Native engine identifies that the target code file received from the WebView engine is an error file, or the target code file received from the WebView engine is an incomplete file.
[0069] In this embodiment, the designated file is a file for performing code repairs on issues existing in the Native engine. The designated file may be stored on a preset server and is essentially the target code file described above. If the Native engine fails to receive the target code file sent by the WebView engine, the Native engine may send a file retrieval request for the designated file to the preset server. Upon receiving the file retrieval request, the preset server recognizes that the file retrieval request is a request for a file for performing code repairs on the Native engine and, thereby, sends the designated file to the Native engine.
[0070] S205, parsing the code of the designated file to obtain the parsed repair code corresponding to the designated file;
[0071] It is understandable that since the specified file pre-stored on the preset server can be a file compressed according to certain encoding rules, after the Native engine obtains the specified file through step S204, it can perform code parsing on the specified file to obtain the parsed repair code corresponding to the specified file.
[0072] S206: Perform code hot repair on the Native engine based on the parsed repair code corresponding to the designated file.
[0073] Exemplarily, based on the parsed repair code corresponding to the designated file, a method of performing code hot repair on the Native engine may be: loading the repair code to replace the problematic code in the Native engine with the repair code, thereby performing code hot repair on the Native engine.
[0074] As can be seen, through this solution, when the target code file downloaded by the WebView engine fails to be obtained, a designated file for code repair for the Native engine can be obtained from a preset server. By parsing and loading this designated file, the Native engine code hot repair is implemented. Therefore, if the Native engine fails to be repaired during the WebView engine update, the purpose of hot repairing the Native engine can still be achieved without updating the host app.
[0075] In order to better understand the content of the embodiments of the present disclosure, the solution of the present disclosure is introduced below in conjunction with a hot repair architecture diagram of a Native engine in the embodiments of the present disclosure.
[0076] like Figure 3 As shown, two methods of hot-fixing the Native engine are shown.
[0077] The first method: After the host APP starts the mini program and enters the Native engine runtime environment, the WebView engine will be loaded inside the mini program Native. When the WebView engine starts, it automatically pulls the latest version of the WebView engine. When downloading the latest version of the WebView engine, it also downloads the target code file for repairing the Native engine. After the latest version of the WebView engine is loaded, the target code file is sent to the Native engine by calling the preHotFix interface. Then, after receiving the target code file, the Native engine parses the target code file to obtain the repair code. Then, the repair code is injected into the hot repair framework to use the repair code to replace the problem code in the Native engine, thereby realizing the hot repair of the Native engine code.
[0078] The second method: The Native engine sends a file acquisition request to the Server (service), so that after receiving the file acquisition request, the Server feeds back to the Native engine a specified file for code repair for the Native engine; wherein, the Server corresponds to the preset server mentioned above; then, after receiving the specified file, the Native engine parses the specified file to obtain the repair code; then, the repair code is injected into the hot repair framework to use the repair code to replace the problematic code in the Native engine, thereby achieving code hot repair of the Native engine. In addition, it should be noted that the Native engine can send the file acquisition request to the Server only after failing to obtain the target code file using the first method.
[0079] In order to better illustrate the content of the embodiments of the present disclosure, the solution of the present disclosure is introduced below with reference to a specific example.
[0080] The problem of Native Engine reported by Mini Program developers: Due to the adjustment of the method of obtaining advertising identifiers in the iOS 14.6 system, the advertising identifier obtained by the iOS Mini Program SDK 2.35 version is empty in the iOS 14.6 and above systems. Therefore, the host APP that integrates the Mini Program SDK 2.35 version will be affected.
[0081] Hot fix solution: (1) Release the latest version of the WebView engine and the target code file that fixes the problems of the Native engine reported by the mini-program developers, and store the latest version of the WebView engine and the target code file on the preset server;
[0082] (2) The host APP starts the Mini Program Native runtime environment. The Mini Program Native runtime loads the WebView engine. When the WebView engine starts, it automatically pulls the latest version of the WebView engine from the preset server. While downloading the latest version of the WebView engine, it also downloads the target code file for repairing the Native engine.
[0083] (3) After the latest version of the WebView engine is loaded, the hot repair interface is called, corresponding to the specified interface above, to trigger the preset Native engine hot repair method and pass the target code file to the Native engine;
[0084] (4) After receiving the target code file, the Native engine parses the target code file to obtain the parsed repair code corresponding to the target code file;
[0085] (5) The repair code obtained by parsing the target code file is used to replace the advertising identifier acquisition method in the original Native engine, thereby realizing the hot repair of the Native engine code. After the hot repair, when the mini program on the host APP calls the advertising identifier acquisition method, it can obtain the correct value.
[0086] It can be seen that through this solution, it is possible to obtain the repair code by calling the hot repair interface through the WebView engine in the mini-program environment without upgrading the host APP, and repair the mini-program SDK code of the corresponding version on the host APP.
[0087] In the technical solutions disclosed herein, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0088] Based on the above method embodiment, the present disclosure embodiment also provides a small program hot repair device, such as Figure 4 As shown, the device includes:
[0089] The acquisition module 410 is used to obtain the target code file downloaded by the web view WebView engine; wherein the target code file is a file used to perform code repair on the native Native engine; the target code file is a file downloaded by the WebView engine when downloading its own hot update file from a preset server;
[0090] A first parsing module 420 is configured to parse the target code file to obtain a parsed repair code corresponding to the target code file;
[0091] The loading module 430 is used to load the parsed repair code corresponding to the target code file to perform code hot repair on the Native engine.
[0092] Optionally, the acquisition device includes:
[0093] The acquisition submodule is used to receive the target code file sent by the web view WebView engine and downloaded by the WebView engine.
[0094] Optionally, the acquisition submodule is specifically used to:
[0095] Receive the target code file downloaded by the WebView engine and sent by the WebView engine by calling a specified interface; wherein the specified interface is an interface for transferring files to the Native engine.
[0096] Optionally, the device further comprises:
[0097] a request module configured to, if receiving the target code file fails, send a file acquisition request to a preset server, so that the preset server feeds back a specified file corresponding to the file acquisition request to the Native engine; wherein the file acquisition request is used to obtain a file for code repair for the Native engine;
[0098] A second parsing module is used to parse the code of the specified file to obtain the parsed repair code corresponding to the specified file;
[0099] The repair module is used to perform code hot repair on the Native engine based on the parsed repair code corresponding to the designated file.
[0100] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0101] An electronic device provided by the present disclosure may include:
[0102] at least one processor; and
[0103] A memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the steps of the above-mentioned small program hot repair method.
[0104] The present disclosure provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps of the hot repair method of any of the above-mentioned small programs are implemented.
[0105] In another embodiment provided by the present disclosure, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute the steps of the hot repair method of any applet in the above embodiments.
[0106] Figure 5 A schematic block diagram of an example electronic device 500 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are provided as examples only and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0107] like Figure 5 As shown, the device 500 includes a computing unit 501, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 502 or a computer program loaded from a storage unit 508 into a random access memory (RAM) 503. Various programs and data required for the operation of the device 500 can also be stored in the RAM 503. The computing unit 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0108] Various components in device 500 are connected to I / O interface 505, including: an input unit 506, such as a keyboard, mouse, etc.; an output unit 507, such as various types of displays, speakers, etc.; a storage unit 508, such as a magnetic disk, optical disk, etc.; and a communication unit 509, such as a network card, modem, wireless communication transceiver, etc. The communication unit 509 allows device 500 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0109] The computing unit 501 can be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 501 performs the various methods and processes described above, such as the hot repair method of the applet. For example, in some embodiments, the hot repair method of the applet can be implemented as a computer software program that is tangibly contained in a machine-readable medium, such as a storage unit 508. In some embodiments, part or all of the computer program can be loaded and / or installed on the device 500 via the ROM 502 and / or the communication unit 509. When the computer program is loaded into the RAM 503 and executed by the computing unit 501, one or more steps of the hot repair method of the applet described above can be performed. Alternatively, in other embodiments, the computing unit 501 can be configured to execute the hot repair method of the applet by any other appropriate means (e.g., by means of firmware).
[0110] Various embodiments of the systems and techniques described above can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0111] The program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0112] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0113] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0114] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.
[0115] A computer system may include a client and a server. The client and server are generally remote from each other and typically interact through a communication network. The client-server relationship arises through computer programs running on the respective computers and having a client-server relationship with each other. The server may be a cloud server, a server in a distributed system, or a server integrated with a blockchain.
[0116] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved. This is not limited herein.
[0117] The above specific embodiments do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the scope of protection of this disclosure.
Claims
1. A method for hot-repairing a small program, wherein: The method comprises: Obtaining a target code file downloaded by a WebView engine; wherein the target code file is a file used to perform code repair on a native engine; the target code file is a file downloaded by the WebView engine when downloading its own hot update file from a preset server; Parsing the target code file to obtain the parsed repair code corresponding to the target code file; The parsed repair code corresponding to the target code file is loaded to perform code hot repair on the Native engine.
2. The method according to claim 1, wherein The obtaining of the target code file downloaded by the web view WebView engine includes: Receive the target code file sent by the web view WebView engine and downloaded by the WebView engine.
3. The method according to claim 2, wherein: The receiving of the target code file sent by the WebView engine and downloaded by the WebView engine includes: Receiving a target code file downloaded by the WebView engine and sent by the WebView engine through calling a specified interface; The designated interface is an interface for transferring files to the Native engine.
4. The method according to claim 2 or 3, further comprising: If receiving the target code file fails, sending a file acquisition request to a preset server, so that the preset server feeds back a specified file corresponding to the file acquisition request to the Native engine; wherein the file acquisition request is used to obtain a file for code repair for the Native engine; Parsing the code of the specified file to obtain the parsed repair code corresponding to the specified file; Based on the parsed repair code corresponding to the specified file, a code hot repair is performed on the Native engine.
5. A mini-program hot-repair device, comprising: An acquisition module, configured to acquire a target code file downloaded by a WebView engine; wherein the target code file is a file used to perform code repair on a native engine; and the target code file is a file downloaded by the WebView engine when downloading its own hot update file from a preset server; A first parsing module, configured to parse the target code file to obtain a parsed repair code corresponding to the target code file; The loading module is used to load the parsed repair code corresponding to the target code file to perform code hot repair on the Native engine.
6. The device according to claim 5, wherein The acquisition device includes: The acquisition submodule is used to receive the target code file sent by the web view WebView engine and downloaded by the WebView engine.
7. The device according to claim 6, wherein The acquisition submodule is specifically used for: Receiving a target code file downloaded by the WebView engine and sent by the WebView engine through calling a specified interface; The designated interface is an interface for transferring files to the Native engine.
8. The device according to claim 6 or 7, further comprising: a request module configured to, if receiving the target code file fails, send a file acquisition request to a preset server, so that the preset server feeds back a specified file corresponding to the file acquisition request to the Native engine; wherein the file acquisition request is used to obtain a file for code repair for the Native engine; A second parsing module is used to parse the code of the specified file to obtain the parsed repair code corresponding to the specified file; The repair module is used to perform code hot repair on the Native engine based on the parsed repair code corresponding to the designated file.
9. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 4.
10. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-4.
11. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Upgrading method and system of SDK (software development kit)
CN103353844A
System updating method and apparatus, electronic device, and computer readable storage medium
WO2021249266A1