WO2023169164A1 - 应用程序的修复方法、装置、计算机设备以及存储介质 - Google Patents

应用程序的修复方法、装置、计算机设备以及存储介质 Download PDF

Info

Publication number
WO2023169164A1
WO2023169164A1 PCT/CN2023/076115 CN2023076115W WO2023169164A1 WO 2023169164 A1 WO2023169164 A1 WO 2023169164A1 CN 2023076115 W CN2023076115 W CN 2023076115W WO 2023169164 A1 WO2023169164 A1 WO 2023169164A1
Authority
WO
WIPO (PCT)
Prior art keywords
target
function
file
bytecode
bytecode file
Prior art date
Application number
PCT/CN2023/076115
Other languages
English (en)
French (fr)
Inventor
季涛
Original Assignee
北京字节跳动网络技术有限公司
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 北京字节跳动网络技术有限公司 filed Critical 北京字节跳动网络技术有限公司
Publication of WO2023169164A1 publication Critical patent/WO2023169164A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0793Remedial or corrective actions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • G06F8/447Target code generation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45504Abstract machines for programme code execution, e.g. Java virtual machine [JVM], interpreters, emulators
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • the present disclosure relates to the field of computer technology, and specifically, to an application repair method, device, computer equipment, and storage medium.
  • Flutter a mobile user interface framework that includes a software development toolkit for building cross-platform applications
  • Flutter cross-end technology With the popularity of Flutter (a mobile user interface framework that includes a software development toolkit for building cross-platform applications) cross-end technology, more and more Flutter applications are developed based on this Flutter cross-end technology. Therefore, for The need to fix problems in Flutter applications is also becoming more and more common.
  • the patch package is then uploaded to the app store so that users can download the patch package from the app store. patch package to complete the repair of the functions to be repaired in the Flutter application. Therefore, the entire process of the existing repair solution is relatively lengthy and the repair efficiency is low.
  • Embodiments of the present disclosure provide at least an application repair method, device, computer equipment, and storage medium.
  • embodiments of the present disclosure provide an application repair method, which is applied to Flutter applications, including:
  • Detecting a function call request for a target function in the Flutter application searching for a target bytecode file of the target function in a local file of the Flutter application based on the detected function call request; wherein, the target The bytecode file contains bytecode for repairing the corresponding functional defect of the target function; when the target bytecode file of the target function is found, run the target bytecode file of the target function. , to achieve the target function after repairing the corresponding functional defects.
  • searching for the target bytecode file of the target function in the local file of the Flutter application based on the detected function call request includes:
  • the function identifier of the target function in the function call request obtain a target mapping file; wherein the target mapping file contains the mapping relationship between the function identifier of the specified function of the Flutter application and the bytecode identifier , the bytecode identifier is used to indicate whether there is a corresponding bytecode file corresponding to the specified function; search for the target mapping data corresponding to the function identifier of the target function in the target mapping file, and based on the If the target mapping data determines that the target bytecode file of the target function exists in the local file, the target bytecode file of the target function is searched for in the specified location of the local file.
  • the method further includes:
  • the target bytecode file of the target function is not found, obtain the historical download record of the Flutter application within the preset period; the historical download record is used to instruct the Flutter application from The server obtains the bytecode file of the corresponding function; when it is determined that the historical download record contains the historical download record of the target bytecode file of the target function, sends an acquisition request to the server; obtains the The server is based on the Obtain the target bytecode file returned by the request, and run the target bytecode file.
  • the method further includes:
  • target bytecode file of the target function If the target bytecode file of the target function is not found, search for the AOT (Ahead of Time, pre)compiled file of the target function in the local file, and run the AOT compiled file.
  • AOT Head of Time, pre
  • searching for the target bytecode file of the target function in the local file of the Flutter application based on the detected function call request includes:
  • the method further includes:
  • saving the target bytecode file of the target function in a designated storage location of the local file includes:
  • running the target bytecode file of the target function to implement the target function after repairing the corresponding functional defect includes:
  • embodiments of the present disclosure also provide an application repair method, which is applied to a server and includes:
  • the method further includes:
  • obtaining the target bytecode file corresponding to the function to be repaired includes:
  • the acquisition request carries the version identifier of the function to be repaired that is requested to be called.
  • embodiments of the present disclosure also provide an application repair device, which is applied to Flutter applications, including:
  • a detection unit used to detect function call requests for target functions in the Flutter application; a search unit, A target bytecode file for searching the target function in a local file of the Flutter application based on the detected function call request; wherein the target bytecode file contains a file for repairing the target function.
  • the bytecode corresponding to the functional defect; the running unit is used to run the target bytecode file of the target function when the target bytecode file of the target function is found, so as to realize the execution and repair of the corresponding functional defect. Afterwards the target function.
  • embodiments of the present disclosure also provide an application repair device, which is applied to a server and includes:
  • the determination unit is used to determine the target repair code of the function to be repaired in the Flutter application; the compilation unit is used to compile the target repair code and generate the target repair code of the function to be repaired based on the target intermediate compilation product in the compilation process.
  • Target bytecode file a sending unit, configured to send the target bytecode file to the Flutter application, so that the Flutter application runs the target bytecode file based on the method described in the first aspect of the above claim. .
  • embodiments of the present disclosure further provide a computer device, including: a processor, a memory, and a bus.
  • the memory stores machine-readable instructions executable by the processor.
  • the processing The processor communicates with the memory through a bus, and when the machine-readable instructions are executed by the processor, the steps in any one of the possible implementations of the first aspect to the second aspect are performed.
  • embodiments of the present disclosure also provide a computer-readable storage medium.
  • the computer-readable storage medium stores a computer program.
  • the computer program executes any one of the above-mentioned first to second aspects when run by a processor. steps in possible implementations.
  • a function call request for the target function in the Flutter application is first detected, and based on the function call request, the function call request is detected in the Flutter application.
  • the target bytecode file can be run to implement the target function after repairing the corresponding functional defect. This shortens the process of repairing functional defects of Flutter applications, improves the repair efficiency, and thus improves the user experience.
  • Figure 1 shows a flow chart of an application repair method provided by an embodiment of the present disclosure
  • Figure 2 shows a flow chart of searching for the target bytecode file of the target function in the local file of the Flutter application based on the detected function call request provided by the embodiment of the present disclosure
  • Figure 3 shows a flow chart of another application repair method provided by an embodiment of the present disclosure
  • Figure 4 shows a flow chart of yet another application repair method provided by an embodiment of the present disclosure
  • Figure 5 shows a schematic diagram of the interaction process between the Flutter application and the server provided by the embodiment of the present disclosure
  • Figure 6 shows a schematic diagram of an application repair device provided by an embodiment of the present disclosure
  • Figure 7 shows a schematic diagram of another application repair device provided by an embodiment of the present disclosure.
  • Figure 8 shows a schematic diagram of a computer device provided by an embodiment of the present disclosure
  • FIG. 9 shows a schematic diagram of another computer device provided by an embodiment of the present disclosure.
  • a and/or B can mean: A alone exists, A and B exist simultaneously, and B alone exists. situation.
  • at least one herein means any one of a plurality or any combination of at least two of a plurality, for example, including at least one of A, B, and C, which can mean including from A, Any one or more elements selected from the set composed of B and C.
  • the present disclosure provides an application repair method, device, computer device and storage medium.
  • a function call request for a target function in a Flutter application is first detected, and based on the function call Request to find the target bytecode file of the target function in the local file of the Flutter application.
  • the target bytecode file can be run to implement the repair of the corresponding functional defect. target functions, thereby shortening the process of repairing functional defects of Flutter applications, improving the repair efficiency, and thus improving the user experience.
  • the execution subject of the method for repairing an application program provided by the embodiment of the present disclosure is generally a computer with certain computing capabilities. equipment.
  • the repair method of the application can be implemented by the processor calling computer-readable instructions stored in the memory.
  • a flow chart of an application repair method provided by an embodiment of the present disclosure is applied to a Flutter application.
  • the method includes steps S101 to S105, where:
  • the above-mentioned Flutter application is an application developed based on the Flutter framework that can be developed across platforms.
  • the Flutter application includes methods for implementing different specified functions.
  • the Flutter application can be an information browsing application, where the Flutter application includes the following specified functions: information browsing, short video browsing, and film and television screening. Mini programs, etc.
  • the user can call the target function in the Flutter application through a function call request, thereby realizing the target function of the Flutter application.
  • the above target function is an applet in the Flutter application
  • the applet after detecting the calling operation for the applet, the applet can be determined as the target function, and it can be determined that the call operation for the target function is detected. Function call request.
  • the local file of the Flutter application it is first necessary to query the local file of the Flutter application and determine whether the local file contains the target bytecode file corresponding to the above target function. It should be noted that when the target function produces a functional defect, technicians can write a repair code to repair the functional defect corresponding to the target function, and generate the corresponding target bytecode file based on the repair code, and then Send the target bytecode file to the Flutter application. Therefore, before running the target function of the Flutter application, you need to first find the target bytecode file of the target function in the local file of the Flutter application.
  • the target bytecode files for the above target functions can be found in the following ways:
  • the local file of the above-mentioned Flutter application contains different sub-files, where each sub-file can correspond to at least one specified function in the Flutter application. Therefore, when searching for the target bytecode file of the above target function, you can first determine the target subfile corresponding to the target function in the local file of the Flutter application, and traverse the target subfile to determine the target subfile Whether the target bytecode file of the target function is included in .
  • the local file of the Flutter application includes a bytecode file
  • the bytecode file is used to store the bytecode file sent by the server. Therefore, when searching for the target bytecode file of the above target function, you can first determine the function identifier of the target function based on the above function call request, and search in the bytecode file of the above Flutter application based on the function identifier to determine Check whether the output bytecode file contains the target bytecode file corresponding to the function identifier.
  • the target function when the target bytecode file of the above target function is found, the target function can be realized by running the target bytecode file.
  • the target bytecode can be loaded into a virtual machine, and the function of the bytecode interpreter can be implemented through the virtual machine to run the target bytecode, thereby realizing the above target function.
  • a function call request for the target function in the Flutter application is first detected, and based on the function call request, the target bytecode file of the target function is searched for in the local file of the Flutter application, When the target bytecode file is found, the target bytecode file can be run to implement the target function after repairing the corresponding functional defect, thereby shortening the process of repairing the functional defect of the Flutter application and improving the repair speed. efficiency, thereby improving the user experience.
  • the method further includes the following process:
  • the designated storage location of the target bytecode file in the local file can be determined.
  • the local file of the Flutter application contains different sub-files, where each sub-file can correspond to at least one specified function in the Flutter application. Therefore, when determining the designated storage location of the target bytecode file of the above target function, you can first determine the storage directory of the target subfile corresponding to the local file where the target function is located, and generate the above target byte code in the storage directory The specified storage location of the code file, thereby storing the target bytecode file in the target subfile.
  • the local file of the Flutter application contains a bytecode file
  • the bytecode file is used to store the bytecode file sent by the server. Therefore, when determining the designated storage location of the target bytecode file of the above target function, you can first obtain the storage directory corresponding to the bytecode file in the local file, and generate the above target bytecode file in the storage directory The specified storage location, thereby storing the target bytecode file in the bytecode file.
  • the target bytecode file can be saved to the specified storage location of the local file, so as to facilitate the function call request from the specified storage location. Call the target bytecode file.
  • the above-mentioned saving of the target bytecode file of the target function in the designated storage location of the above-mentioned local file specifically includes the following process:
  • the target bytecode file before saving the target bytecode file, it may first be determined whether there is a historical version of the historical bytecode file for the target function in the local file.
  • the specified storage location of the above target bytecode file in the local file can first be determined. If other bytecode files exist in the specified storage location, it is determined that the target function has a history of historical versions in the local file. bytecode file, then you can delete the historical bytecode file and save the above target bytecode file in the specified storage location.
  • the storage directory to which the specified location belongs can also be queried to determine whether there is a historical bytecode file of the target function in the storage directory. If there is a historical bytecode file of the target function in the storage directory, the historical bytecode file can be deleted, and the target bytecode file can be saved in the specified storage location.
  • the above target bytecode file can first be determined.
  • the marking function checks whether a historical version of the historical bytecode file exists in the local file, and if there is a historical version of the historical bytecode file in the local file, deletes the historical bytecode file, thereby saving the storage space of the local file. , and reduces possible errors in calling bytecode files caused by the existence of multiple versions of bytecode files.
  • the above-mentioned S103 searches for the target bytecode file of the target function in the local file of the Flutter application based on the detected function call request, which specifically includes the following process:
  • the function identifier of the target function is obtained, where the function identifier may be the function id of the target function.
  • S1032 Obtain the target mapping file; wherein the target mapping file contains the mapping relationship between the function identifier of the specified function of the Flutter application and the bytecode identifier, and the bytecode identifier is used to indicate whether the corresponding specified function A corresponding bytecode file exists.
  • a target mapping file can be established for the above-mentioned Flutter application.
  • the target mapping file may include a mapping table, where the mapping table is used to indicate the mapping relationship between the function identifier and the bytecode identifier of the specified function in the Flutter application.
  • mapping relationship in the above mapping table is updated in real time.
  • the bytecode identifier of the bytecode file can be obtained, and the bytecode The identifier determines the specified function corresponding to the bytecode. Then, based on the bytecode identifier, the mapping relationship of the specified function can be updated in the above mapping table.
  • the mapping table may also include the specified location where the bytecode file is stored in the local file, thereby facilitating direct search of the bytecode file.
  • the above mapping table can be obtained, and based on the function identifier of the target function, it is searched in the mapping table whether the target function has a corresponding mapping relationship.
  • S1033 Search the target mapping file for target mapping data corresponding to the function identifier of the target function, and determine that the target bytecode file of the target function exists in the local file based on the target mapping data. In the case of searching for the target bytecode file of the target function in the specified location of the local file.
  • target mapping data corresponding to the function identifier of the target function may first be determined, and the mapping relationship corresponding to the target function may be determined based on the target mapping data.
  • whether the target function has a corresponding mapping relationship can be determined based on the above target mapping data.
  • whether the target function has a corresponding mapping relationship can be determined based on the mapping relationship identifier.
  • the mapping relationship identifier corresponding to the target function is 1, it is determined that the target function has a corresponding mapping relationship; when the mapping relationship identifier corresponding to the target function is 0, it is determined that the target function does not have a corresponding mapping relationship.
  • the target function After determining that the above target function does not have a corresponding mapping relationship, it can be determined that the target function does not have a corresponding target bytecode file. In addition, after determining that the above target function has a corresponding mapping relationship, it can be determined that the target function has a corresponding target bytecode file. Then, based on the above target mapping data, it can be determined that the target byte is stored in the local file. The specified location of the code file, and search for the above target bytecode file based on the specified location.
  • the target mapping data corresponding to the target function can be searched based on the target mapping file, and the target byte corresponding to the target function can be searched based on the target mapping data. code file, thereby improving the efficiency of finding the target bytecode file, thereby improving the response speed of the device.
  • the above-mentioned S103 searching for the target bytecode file of the target function in the local file of the Flutter application based on the detected function call request, also includes the following process:
  • the Flutter application when the above target function has experienced multiple version updates and/or function repairs of the Flutter application, the Flutter application will receive the corresponding bytecode file after each version update or function repair. Therefore, , the above target function can contain multiple versions of bytecode files in local files.
  • the version identifier can be used to indicate the corresponding target function. version update time.
  • the version identification of the target function called by the function call request is by default the version identification corresponding to the latest version update.
  • the version identification of multiple versions corresponding to the target function is indicated by the version identification.
  • the version update times are 2021.12.3, 2021.12.31 and 2022.2.1 respectively.
  • the version update time indicated by the version identifier of the target function called by the above function call request can be 2022.2.1.
  • the version identifier of the target function to be called indicated by the function call request may also be directional, and may indicate the version identifier of any version among all versions corresponding to the target function.
  • the user before calling the target function, the user can select the target version that he wants to call among multiple versions corresponding to the target function, and initiate a function call request for the target version. Therefore, after determining the version identifier of the target function called by the function call request, the bytecode file matching the version identifier can be determined as the target bytecode file among multiple versions of bytecode files. .
  • the multiple versions of bytecode files corresponding to the above target functions include invalid bytecode files, it can also be prioritized to determine whether the target bytecode file called by the function call request is valid, thereby avoiding the problem. Version conflicts between running invalid bytecode files and Flutter applications.
  • the invalid bytecode file can be determined by the developer. After the invalid bytecode file is determined, a disabling instruction can be sent to the Flutter application through the server, so that the Flutter application can disable the instruction based on the disabling instruction. The bytecode file is determined to be an invalid bytecode file.
  • the target bytecode file that needs to be called can be determined through the function call request, so that the user can choose the version he wants to run, improving improve the user’s operating experience.
  • the above method also includes the following process:
  • the target bytecode may not be saved due to problems such as storage failure, or the target bytecode may not be saved until the target bytecode file is saved. Later, the target bytecode file is accidentally deleted due to reasons such as cleaning up storage space. At this time, the target bytecode file for which the target function is not found will appear, but there is a historical download of the target bytecode file. recorded situation.
  • the function identifier of the target function can be determined, and the target bytecode file can be generated based on the function identifier. Get a request and get the target bytecode file returned by the server based on the get request.
  • the acquisition request for the target bytecode file can also be directly generated based on the function identifier of the target function.
  • the server receives After the acquisition request is made, it can be determined whether the target bytecode file corresponding to the target function exists. If it exists, the target bytecode file can be sent to the Flutter application, thereby improving the function calling request to the target bytecode. Document reliability.
  • the method further includes the following process:
  • target bytecode file of the target function If the target bytecode file of the target function is not found, search the local file for the AOT compiled file of the target function, and run the AOT compiled file.
  • the compiled product obtained when building the above Flutter application is an AOT compiled file.
  • the AOT compiled file is a binary code related to the processor type.
  • the Flutter application can be compiled through the Dart compiler.
  • an intermediate compilation product can also be produced: a bytecode file, which can be sent to the Flutter application. In order to make the Flutter application run the bytecode file, thereby achieving the effect of repairing the functional defect of the specified function.
  • the AOT compiled file of the target function in the local file can be obtained, and the AOT compiled file can be implemented by running the AOT compiled file. target function.
  • the AOT compiled file of the target function can also be run, so that the target function can run smoothly.
  • run the target bytecode file of the target function to implement the target function after repairing the corresponding functional defect which specifically includes the following process:
  • the above virtual machine can be called.
  • the virtual machine can be Dart empty Virtual machine, where the Dart virtual machine is a virtual machine that provides an execution environment for the Dart language.
  • the above target bytecode can be loaded into the Dart virtual machine to realize the function of the bytecode interpreter through the Dart virtual machine, thereby running the target bytecode to achieve the above target function.
  • the target bytecode file of the target function can be run, thereby realizing the target function after repairing the corresponding functional defect.
  • Figure 3 is a flow chart of another application repair method provided by an embodiment of the present disclosure. It is applied to a server. The method includes steps S301 to S305, wherein:
  • S301 Determine the target repair code of the function to be repaired in the Flutter application.
  • technicians can write target repair code for the function to be repaired.
  • the target repair code can be used to repair the functional defects corresponding to the function to be repaired.
  • the function to be repaired is the target function.
  • S303 Compile the target repair code, and generate a target bytecode file of the function to be repaired based on the target intermediate compilation product during the compilation process.
  • the target repair code of the function to be repaired in the Flutter application can be loaded into the Dart compiler, so that the Dart compiler compiles the target repair code. It should be understood that here it is necessary to obtain the intermediate compilation product in the compilation process, and generate the target bytecode file of the function to be repaired based on the intermediate compilation product.
  • S305 Send the target bytecode file to the Flutter application, so that the Flutter application runs the target bytecode file based on the method corresponding to Figure 1.
  • the target bytecode file can be sent to the Flutter application, so that the Flutter application runs the target bytecode file.
  • multiple sending methods can be set when sending the above target bytecode file to the Flutter application.
  • real-time sending can be used.
  • the target bytecode can be sent to the Flutter application; or timed sending can be used.
  • the specific sending time can be based on the Flutter application.
  • the version update time is determined.
  • a function call request for the target function in the Flutter application is first detected, and based on the function call request, the target bytecode file of the target function is searched for in the local file of the Flutter application, When the target bytecode file is found, the target bytecode file can be run to implement the target function after repairing the corresponding functional defect, thereby shortening the process of repairing the functional defect of the Flutter application and improving the repair speed. efficiency, thereby improving the user experience.
  • the method further includes the following process:
  • the above-mentioned Flutter application can determine the target bytecode that needs to be called based on the function call request for the target function, and based on the function identifier of the target function, generate a request for obtaining the target bytecode and send it to the server. Send this get request.
  • the server After the server obtains the acquisition request, it can determine the corresponding function to be repaired based on the function identifier carried in the acquisition request, and obtain the target bytecode file corresponding to the function to be repaired.
  • the target bytecode file can also be determined among the multiple versions of bytecode files. Specifically, the target bytecode file to be repaired is obtained.
  • the target bytecode file corresponding to the function includes the following processes:
  • the above-mentioned function to be repaired corresponds to an update file in a local file of the server, where the update file is used to store multiple versions of bytecode files of the function to be repaired.
  • the user Before sending the acquisition request corresponding to the function to be repaired to the server through the above Flutter application, the user can select the version identification of the version of the target bytecode file that he wants to obtain, and then generate an acquisition request based on the version identification and put This get request is sent to the server.
  • the server can first obtain the function identifier carried in the acquisition request to determine the function to be repaired, and obtain the bytecode files of each version in the update file corresponding to the function to be repaired.
  • the version identification of the function to be repaired carried in the above acquisition request can be determined, and based on the version identification, the bytecode files of each version included in the update file can be selected.
  • the matching operation is performed and the bytecode file matching the version identifier is determined as the target bytecode file.
  • the target bytecode file can be determined based on the version identifier carried in the acquisition request, so that the user can flexibly select the desired bytecode file through the acquisition request.
  • the version of the target bytecode file to be obtained improves the user experience.
  • FIG. 4 there is a flow chart of another application repair method provided by an embodiment of the present disclosure.
  • the method includes steps S401 to S105, wherein:
  • the user when the user uses the Flutter application, the user can call the target function in the Flutter application through a function call request, thereby realizing the target function of the Flutter application.
  • the above target function is an applet in the Flutter application
  • the applet after detecting the calling operation for the applet, the applet can be determined as the target function, and it can be determined that the call operation for the target function is detected. Function call request.
  • S402 Determine whether the target bytecode file for the above target function exists in the local file. If so, execute S403; if not, execute S404.
  • the local file of the Flutter application it is first necessary to query the local file of the Flutter application and determine whether the local file contains the target bytecode file corresponding to the above target function. It should be noted that when the target function produces a functional defect, technicians can write a repair code to repair the functional defect corresponding to the target function, and generate the corresponding target bytecode file based on the repair code, and then Send the target bytecode file to the Flutter application. Therefore, before running the target function of the Flutter application, you need to first find the target bytecode file of the target function in the local file of the Flutter application.
  • the target bytecode file of the above target function can be searched through several methods in the embodiment corresponding to Figure 1, which will not be described again here.
  • the target function when the target bytecode file of the above target function is found, the target function can be realized by running the target bytecode file.
  • the target bytecode can be loaded into a virtual machine, and the function of the bytecode interpreter can be implemented through the virtual machine to run the target bytecode, thereby realizing the above target function.
  • S404 Search the local file for the AOT compiled file of the above target function, and run the AOT compiled file to implement the target function.
  • the interaction process between the above-mentioned Flutter application and the server is shown in Figure 5, in which the Flutter application contains n specified functions, and each specified function corresponds to an AOT compiled file in a local file.
  • the Flutter application contains n specified functions, and each specified function corresponds to an AOT compiled file in a local file.
  • the AOT compiled file of the target function in the local file can be run to implement the target function.
  • the target bytecode file corresponding to the specified function 3 sent by the server can be obtained, and the target bytecode file can be stored in the specified location. .
  • the process of building the above Flutter application also includes the following processes:
  • the bytecode judgment program is used to judge whether the specified function has a corresponding bytecode file in the local file after detecting a function call request for the corresponding specified function;
  • the Flutter application in the process of building the above-mentioned Flutter application, can first be divided into multiple specified functions, and each specified function of the Flutter application can be developed separately, thereby obtaining the corresponding functions of each specified function.
  • Dart code files in the process of building the above-mentioned Flutter application, the Flutter application can first be divided into multiple specified functions, and each specified function of the Flutter application can be developed separately, thereby obtaining the corresponding functions of each specified function.
  • the above bytecode file judgment program can be written in the specified location of the Dart code file.
  • the bytecode file judgment program can be inserted into the specified position of each Dart code file through the instrumentation operation. This disclosure can judge the inserted bytecode file.
  • the specific timing of the procedure is not limited.
  • the Flutter application detects the function call request for the target function and passes the bytes in the target function.
  • the code file determination program searches whether the target bytecode file exists in the local file of the Flutter application.
  • the function call request for the target function in the Flutter application is first detected, and based on the function call request, the target bytecode file of the target function is searched in the local file of the Flutter application. After searching When the target bytecode file is found, the target bytecode file can be run to implement the target function after repairing the corresponding functional defect, thereby shortening the process of repairing the functional defect of the Flutter application and improving the repair efficiency. This further improves the user experience.
  • the writing order of each step does not mean a strict execution order and does not constitute any limitation on the implementation process.
  • the specific execution order of each step should be based on its function and Possible internal logic determined.
  • the embodiments of the disclosure also provide an application repair device corresponding to the application repair method. Since the problem-solving principle of the device in the embodiments of the disclosure is the same as the application repair method described above in the embodiments of the disclosure, are similar, so the implementation of the device can refer to the implementation of the method, and repeated details will not be repeated.
  • the device includes: a detection unit 61, a search unit 62, and an execution unit 63; wherein,
  • the detection unit 61 is used to detect a function call request for a target function in the Flutter application
  • the search unit 62 is configured to search the target bytecode file of the target function in the local file of the Flutter application based on the detected function call request; wherein the target bytecode file contains a file for repairing the target function.
  • the running unit 63 is configured to, if the target bytecode file of the target function is found, run the target bytecode file of the target function to implement the target function after repairing the corresponding functional defect.
  • a function call request for the target function in the Flutter application is first detected, and based on the function call request, the target bytecode file of the target function is searched for in the local file of the Flutter application. After the target is found, In the case of a bytecode file, the target bytecode file can be run to achieve the target function after repairing the corresponding functional defect, thereby shortening the process of repairing the functional defect of the Flutter application, improving the repair efficiency, and thus improving the User experience.
  • the search unit 62 is also used to:
  • the target mapping file contains the mapping relationship between the function identifier of the specified function of the Flutter application and the bytecode identifier, and the bytecode identifier is used to indicate whether the corresponding specified function exists.
  • the device is also used for:
  • the target bytecode file of the target function is not found, obtain the historical download record of the Flutter application within the preset period; the historical download record is used to instruct the Flutter application from The bytecode file of the corresponding function obtained by the server;
  • the device is also used for:
  • target bytecode file of the target function If the target bytecode file of the target function is not found, search the local file for the AOT compiled file of the target function, and run the AOT compiled file.
  • the search unit 62 is also used to:
  • the function call request determines the version identification of the target function that needs to be called at the current moment
  • the bytecode file matching the version identifier is determined as the target bytecode file of the target function among the bytecode files of the multiple versions.
  • the device is also used for:
  • the device is also used for:
  • the historical bytecode file is found, the historical bytecode file is deleted, and the target bytecode file is saved in the designated storage location of the local file.
  • the operation unit 63 is also used to:
  • the device includes: a determination unit 71, a compilation unit 72, and a sending unit 73; wherein,
  • Determining unit 71 used to determine the target repair code of the function to be repaired in the Flutter application
  • the compilation unit 72 is used to compile the target repair code, and generate the target bytecode file of the function to be repaired based on the target intermediate compilation product in the compilation process;
  • the sending unit 73 is configured to send the target bytecode file to the Flutter application, so that the Flutter application runs the target bytecode file based on the method corresponding to Figure 1.
  • the device is also used for:
  • the device is also used for:
  • an embodiment of the present disclosure also provides a computer device 800.
  • Figure 8 which is a schematic structural diagram of the computer device 800 provided by an embodiment of the present disclosure, it includes:
  • Processor 81 memory 82, and bus 83; memory 82 is used to store execution instructions, including memory 821 and external memory 822; memory 821 here is also called internal memory, and is used to temporarily store operation data in processor 81, and with The processor 81 exchanges data with the external memory 822 such as a hard disk through the memory 821.
  • the processor 81 and the memory 82 are connected through the bus 83. Communication causes the processor 81 to execute the following instructions:
  • the target bytecode file of the target function is executed to implement the target function after repairing the corresponding function defect.
  • the embodiment of the present disclosure also provides another computer device 900.
  • Figure 9 is a schematic structural diagram of the computer device 900 provided by the embodiment of the present disclosure, it includes:
  • the processor 91 and the memory 92 communicate through the bus 93, so that The processor 91 executes the following instructions:
  • Embodiments of the present disclosure also provide a computer-readable storage medium.
  • a computer program is stored on the computer-readable storage medium.
  • the storage medium may be a volatile or non-volatile computer-readable storage medium.
  • Embodiments of the present disclosure also provide a computer program product.
  • the computer program product carries program code.
  • the instructions included in the program code can be used to execute the steps of the application repair method described in the above method embodiments. For details, see The above method embodiments will not be described again here.
  • the above-mentioned computer program product can be specifically implemented by hardware, software or a combination thereof.
  • the computer program product is embodied as a computer storage medium.
  • the computer program product is embodied as a software product, such as a Software Development Kit (SDK), etc. wait.
  • SDK Software Development Kit
  • the units described as separate components may or may not be physically separate and shown as units.
  • a component may or may not be a physical unit, that is, it may be located in one place, or it may be distributed over multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in various embodiments of the present disclosure may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor.
  • the technical solution of the present disclosure is essentially or the part that contributes to the existing technology or the part of the technical solution can be embodied in the form of a software product.
  • the computer software product is stored in a storage medium, including Several instructions are used to cause a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present disclosure.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program code. .

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Human Computer Interaction (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Devices For Executing Special Programs (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本公开提供了一种应用程序的修复方法、装置、计算机设备以及存储介质,其中,该方法包括:检测针对所述Flutter应用中的目标功能的功能调用请求;基于检测到的所述功能调用请求在所述Flutter应用的本地文件中查找所述目标功能的目标字节码文件;在查找到所述目标功能的目标字节码文件的情况下,运行所述目标功能的目标字节码文件,以实现执行修复对应功能缺陷之后的目标功能。在本公开实施例中,在基于功能调用请求在Flutter应用的本地文件中查找到目标功能的目标字节码文件的情况下,就可以运行该字节码文件,以实现执行修复对应功能缺陷之后的目标功能,从而缩短了修复Flutter应用的功能缺陷的流程,提高了修复效率,进而提高了用户的使用体验。

Description

应用程序的修复方法、装置、计算机设备以及存储介质
本申请要求于2022年03月10日提交中国专利局、申请号为202210240370.7、申请名称为“应用程序的修复方法、装置、计算机设备以及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本公开涉及计算机技术领域,具体而言,涉及一种应用程序的修复方法、装置、计算机设备以及存储介质。
背景技术
随着Flutter(一种移动用户界面框架,包含用于构建跨平台应用程序的软件开发工具包)跨端技术的普及,基于该Flutter跨端技术开发的Flutter应用也越来越多,因此,针对Flutter应用的问题修复需求也越来越普遍。然而,在现有的针对Flutter应用的修复方案中,在针对该Flutter应用中的待修复功能进行代码修改得到补丁包后,再将该补丁包上传至应用商店,以使用户从应用商店下载该补丁包,从而完成该Flutter应用中的待修复功能的修复。因此,现有的修复方案整个流程较为冗长,修复效率较低。
发明内容
本公开实施例至少提供一种应用程序的修复方法、装置、计算机设备以及存储介质。
第一方面,本公开实施例提供了一种应用程序的修复方法,应用于Flutter应用,包括:
检测针对所述Flutter应用中的目标功能的功能调用请求;基于检测到的所述功能调用请求在所述Flutter应用的本地文件中查找所述目标功能的目标字节码文件;其中,所述目标字节码文件中包含用于修复所述目标功能的对应功能缺陷的字节码;在查找到所述目标功能的目标字节码文件的情况下,运行所述目标功能的目标字节码文件,以实现执行修复对应功能缺陷之后的目标功能。
一种可选的实施方式中,所述基于检测到的所述功能调用请求在所述Flutter应用的本地文件中查找所述目标功能的目标字节码文件,包括:
在所述功能调用请求中获取所述目标功能的功能标识;获取目标映射文件;其中,所述目标映射文件中包含所述Flutter应用的指定功能的功能标识和字节码标识之间的映射关系,所述字节码标识用于指示对应指定功能是否存在相应的字节码文件;在所述目标映射文件中查找与所述目标功能的功能标识相对应的目标映射数据,并在基于所述目标映射数据确定所述本地文件中存在所述目标功能的目标字节码文件的情况下,在所述本地文件的指定位置中查找所述目标功能的目标字节码文件。
一种可选的实施方式中,所述方法还包括:
在未查找到所述目标功能的目标字节码文件的情况下,获取预设时段内所述Flutter应用的历史下载记录;所述历史下载记录用于指示所述Flutter应用在预设时段内从服务器获取到的对应功能的字节码文件;在确定所述历史下载记录中包含所述目标功能的目标字节码文件的历史下载记录的情况下,向所述服务器发送获取请求;获取所述服务器基于所述 获取请求返回的所述目标字节码文件,并运行所述目标字节码文件。
一种可选的实施方式中,所述方法还包括:
在未查找到所述目标功能的目标字节码文件的情况下,在所述本地文件查找所述目标功能的AOT(Ahead of Time,预)编译文件,并运行所述AOT编译文件。
一种可选的实施方式中,所述基于检测到的所述功能调用请求在所述Flutter应用的本地文件中查找所述目标功能的目标字节码文件,包括:
在所述本地文件中查找到所述目标功能的多个版本的字节码文件的情况下,基于所述功能调用请求确定当前时刻所需要调用的目标功能的版本标识;在所述多个版本的字节码文件中确定与所述版本标识相匹配的字节码文件作为所述目标功能的目标字节码文件。
一种可选的实施方式中,所述方法还包括:
在检测对所述Flutter应用中的目标功能的功能调用请求之后,获取服务器发送的所述目标功能的目标字节码文件;将所述目标功能的目标字节码文件保存在所述本地文件的指定存储位置。
一种可选的实施方式中,所述将所述目标功能的目标字节码文件保存在所述本地文件的指定存储位置,包括:
在所述本地文件中查找所述目标功能的历史字节码文件;在查找到所述历史字节码文件的情况下,删除所述历史字节码文件,并将所述目标字节码文件保存在所述本地文件的指定存储位置。
一种可选的实施方式中,所述运行所述目标功能的目标字节码文件,以实现执行修复对应功能缺陷之后的目标功能,包括:
调用所述Flutter应用中的Dart(一种计算机编程语言)虚拟机;将所述目标字节码文件加载至所述Dart虚拟机,以通过所述Dart虚拟机中的字节码解释器运行所述目标功能的目标字节码文件,以实现执行修复对应功能缺陷之后的目标功能。
第二方面,本公开实施例还提供一种应用程序的修复方法,应用于服务器,包括:
确定Flutter应用中待修复功能的目标修复代码;对所述目标修复代码进行编译,并基于所述编译过程中的目标中间编译产物生成所述待修复功能的目标字节码文件;向所述Flutter应用发送所述目标字节码文件,以使所述Flutter应用基于上述第一方面所述的方法运行所述目标字节码文件。
一种可选的实施方式中,所述方法还包括:
接收所述Flutter应用发送的获取请求,并确定所述获取请求所对应的待修复功能;获取所述待修复功能所对应的目标字节码文件,并将所述目标字节码文件传输至所述Flutter应用。
一种可选的实施方式中,所述获取所述待修复功能所对应的目标字节码文件,包括:
获取所述待修复功能所对应的各个版本的字节码文件;在所述各个版本的字节码文件中确定与所述获取请求相匹配的字节码文件作为所述目标字节码文件;其中,所述获取请求中携带所请求调用的待修复功能的版本标识。
第三方面,本公开实施例还提供一种应用程序的修复装置,应用于Flutter应用,包括:
检测单元,用于检测针对所述Flutter应用中的目标功能的功能调用请求;查找单元, 用于基于检测到的所述功能调用请求在所述Flutter应用的本地文件中查找所述目标功能的目标字节码文件;其中,所述目标字节码文件中包含用于修复所述目标功能的对应功能缺陷的字节码;运行单元,用于在查找到所述目标功能的目标字节码文件的情况下,运行所述目标功能的目标字节码文件,以实现执行修复对应功能缺陷之后的目标功能。
第四方面,本公开实施例还提供一种应用程序的修复装置,应用于服务器,包括:
确定单元,用于确定Flutter应用中待修复功能的目标修复代码;编译单元,用于对所述目标修复代码进行编译,并基于所述编译过程中的目标中间编译产物生成所述待修复功能的目标字节码文件;发送单元,用于向所述Flutter应用发送所述目标字节码文件,以使所述Flutter应用基于上述权利要求第一方面所述的方法运行所述目标字节码文件。
第五方面,本公开实施例还提供一种计算机设备,包括:处理器、存储器和总线,所述存储器存储有所述处理器可执行的机器可读指令,当计算机设备运行时,所述处理器与所述存储器之间通过总线通信,所述机器可读指令被所述处理器执行时执行上述第一方面至第二方面中任一种可能的实施方式中的步骤。
第六方面,本公开实施例还提供一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序,该计算机程序被处理器运行时执行上述第一方面至第二方面中任一种可能的实施方式中的步骤。
本公开实施例提供的应用程序的修复方法、装置、计算机设备以及存储介质,在本公开实施例中,首先检测针对Flutter应用中的目标功能的功能调用请求,并基于该功能调用请求在Flutter应用的本地文件中查找该目标功能的目标字节码文件,在查找到该目标字节码文件的情况下,就可以运行该目标字节码文件,以实现执行修复对应功能缺陷之后的目标功能,从而缩短了修复Flutter应用的功能缺陷的流程,提高了修复效率,进而提高了用户的使用体验。
为使本公开的上述目的、特征和优点能更明显易懂,下文特举较佳实施例,并配合所附附图,作详细说明如下。
附图说明
为了更清楚地说明本公开实施例的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,此处的附图被并入说明书中并构成本说明书中的一部分,这些附图示出了符合本公开的实施例,并与说明书一起用于说明本公开的技术方案。应当理解,以下附图仅示出了本公开的某些实施例,因此不应被看作是对范围的限定,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他相关的附图。
图1示出了本公开实施例所提供的一种应用程序的修复方法的流程图;
图2示出了本公开实施例所提供的基于检测到的功能调用请求在Flutter应用的本地文件中查找目标功能的目标字节码文件的流程图;
图3示出了本公开实施例所提供的另一种应用程序的修复方法的流程图;
图4示出了本公开实施例所提供的又一种应用程序的修复方法的流程图;
图5示出了本公开实施例所提供的Flutter应用和服务器之间的交互过程的示意图;
图6示出了本公开实施例所提供的一种应用程序的修复装置的示意图;
图7示出了本公开实施例所提供的另一种应用程序的修复装置的示意图;
图8示出了本公开实施例所提供的一种计算机设备的示意图;
图9示出了本公开实施例所提供的另一种计算机设备的示意图。
具体实施方式
为使本公开实施例的目的、技术方案和优点更加清楚,下面将结合本公开实施例中附图,对本公开实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本公开一部分实施例,而不是全部的实施例。通常在此处附图中描述和示出的本公开实施例的组件可以以各种不同的配置来布置和设计。因此,以下对在附图中提供的本公开的实施例的详细描述并非旨在限制要求保护的本公开的范围,而是仅仅表示本公开的选定实施例。基于本公开的实施例,本领域技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本公开保护的范围。
应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步定义和解释。
本文中术语“和/或”,仅仅是描述一种关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中术语“至少一种”表示多种中的任意一种或多种中的至少两种的任意组合,例如,包括A、B、C中的至少一种,可以表示包括从A、B和C构成的集合中选择的任意一个或多个元素。
经研究发现,在现有的针对Flutter应用的修复方案中,在针对该Flutter应用中的待修复功能进行代码修改得到补丁包后,再将该补丁包上传至应用商店,以使用户从应用商店下载该补丁包,从而完成该Flutter应用中的待修复功能的修复。因此,现有的修复方案整个流程较为冗长,修复效率较低。
基于上述研究,本公开提供了一种应用程序的修复方法、装置、计算机设备以及存储介质,在本公开实施例中,首先检测针对Flutter应用中的目标功能的功能调用请求,并基于该功能调用请求在Flutter应用的本地文件中查找该目标功能的目标字节码文件,在查找到该目标字节码文件的情况下,就可以运行该目标字节码文件,以实现执行修复对应功能缺陷之后的目标功能,从而缩短了修复Flutter应用的功能缺陷的流程,提高了修复效率,进而提高了用户的使用体验。
为便于对本实施例进行理解,首先对本公开实施例所公开的一种应用程序的修复方法进行详细介绍,本公开实施例所提供的应用程序的修复方法的执行主体一般为具有一定计算能力的计算机设备。在一些可能的实现方式中,该应用程序的修复方法可以通过处理器调用存储器中存储的计算机可读指令的方式来实现。
参见图1所示,为本公开实施例提供的一种应用程序的修复方法的流程图,应用于Flutter应用,所述方法包括步骤S101~S105,其中:
S101:检测针对所述Flutter应用中的目标功能的功能调用请求。
在本公开实施例中,上述Flutter应用为基于可跨平台开发的Flutter框架开发的应用程序,该Flutter应用中包含实现不同指定功能的方法。例如,该Flutter应用可以为资讯浏览类应用程序,其中,该Flutter应用包含以下指定功能:资讯浏览,短视频浏览,影视放映, 小程序等。
这里,用户在使用该Flutter应用时,可以通过功能调用请求对Flutter应用中的目标功能进行调用,从而实现该Flutter应用的目标功能。例如,在上述目标功能为该Flutter应用中的小程序的情况下,在检测到针对该小程序的调用操作后,就可以将该小程序确定为目标功能,并确定检测到针对该目标功能的功能调用请求。
S103:基于检测到的所述功能调用请求在所述Flutter应用的本地文件中查找所述目标功能的目标字节码文件;其中,所述目标字节码文件中包含用于修复所述目标功能的对应功能缺陷的字节码。
在本公开实施例中,首先需要查询Flutter应用的本地文件,并确定该本地文件中是否包含上述目标功能所对应的目标字节码文件。需要说明的是,在该目标功能产生功能缺陷的情况下,技术人员可以编写用于修复该目标功能所对应功能缺陷的修复代码,并将基于该修复代码生成对应的目标字节码文件,然后将该目标字节码文件下发至Flutter应用。因此,在运行该Flutter应用的目标功能之前,需要首先在Flutter应用的本地文件中查找该目标功能的目标字节码文件。
具体实施时,可以通过以下几种方式查找上述目标功能的目标字节码文件:
方式一:
在本公开实施例中,上述Flutter应用的本地文件中包含不同的子文件,其中,每个子文件可以对应该Flutter应用中的至少一个指定功能。因此,在查找上述目标功能的目标字节码文件时,首先可以确定该目标功能在Flutter应用的本地文件中所对应的目标子文件,并对该目标子文件进行遍历,从而确定该目标子文件中是否包含该目标功能的目标字节码文件。
方式二:
在本公开实施例中,上述Flutter应用的本地文件中包含字节码文件,该字节码文件用于存储服务器发送的字节码文件。因此,在在查找上述目标功能的目标字节码文件时,首先可以基于上述功能调用请求确定目标功能的功能标识,并根据该功能标识在上述Flutter应用的字节码文件中进行查找,从而确定出字节码文件中是否包含和该功能标识相对应的目标字节码文件。
S105:在查找到所述目标功能的目标字节码文件的情况下,运行所述目标功能的字节码文件,以实现执行修复对应功能缺陷之后的目标功能。
在本公开实施例中,在查找到上述目标功能的目标字节码文件的情况下,就可以通过运行该目标字节码文件的方式实现该目标功能。具体实施时,可以将该目标字节码加载到虚拟机中,并通过该虚拟机实现字节码解释器的功能,对该目标字节码进行运行,从而实现上述目标功能。
通过上述描述可知,在本公开实施例中,首先检测针对Flutter应用中的目标功能的功能调用请求,并基于该功能调用请求在Flutter应用的本地文件中查找该目标功能的目标字节码文件,在查找到该目标字节码文件的情况下,就可以运行该目标字节码文件,以实现执行修复对应功能缺陷之后的目标功能,从而缩短了修复Flutter应用的功能缺陷的流程,提高了修复效率,进而提高了用户的使用体验。
在一个可选的实施方式中,所述方法还包括如下过程:
(1)、在检测对所述Flutter应用中的目标功能的功能调用请求之后,获取服务器发送的所述目标功能的目标字节码文件;
(2)、将所述目标功能的目标字节码文件保存在所述本地文件的指定存储位置。
在本公开实施例中,在获取到服务器发送的目标功能的目标字节码文件后,就可以确定该目标字节码文件在本地文件中的指定存储位置。具体实施时,对应上述查找目标功能的目标字节码文件的几种方式,包括以下几种情况:
情况一:
在本公开实施例中,对应上述方式一中提到的:上述Flutter应用的本地文件中包含不同的子文件,其中,每个子文件可以对应该Flutter应用中的至少一个指定功能。因此,在确定上述目标功能的目标字节码文件的指定存储位置时,首先可以确定该目标功能所在本地文件中所对应的目标子文件的存储目录,并在该存储目录下生成上述目标字节码文件的指定存储位置,从而将该目标字节码文件存储在该目标子文件中。
情况二:
在本公开实施例中,对应上述方式二中提到的:上述Flutter应用的本地文件中包含字节码文件,该字节码文件用于存储服务器发送的字节码文件。因此,在确定上述目标功能的目标字节码文件的指定存储位置时,首先可以获取该字节码文件在本地文件中所对应的存储目录,并在该存储目录下生成上述目标字节码文件的指定存储位置,从而将该目标字节码文件存储在该字节码文件中。
通过上述描述可知,在获取到服务器发送的目标功能的目标字节码文件之后,就可以将该目标字节码文件保存到本地文件的指定存储位置,从而便于根据功能调用请求,从指定存储位置调用该目标字节码文件。
在一个可选的实施方式中,上述将所述目标功能的目标字节码文件保存在上述本地文件的指定存储位置,具体包括如下过程:
(1)、在所述本地文件中查找所述目标功能的历史字节码文件;
(2)、在查找到所述历史字节码文件的情况下,删除所述历史字节码文件,并将所述目标字节码文件保存在所述本地文件的指定存储位置。
在本公开实施例中,在对上述目标字节码文件进行保存之前,首先可以确定上述目标功能在本地文件中是否存在历史版本的历史字节码文件。
具体实施时,首先可以确定上述目标字节码文件在本地文件中的指定存储位置,在该指定存储位置存在其他字节码文件的情况下,则确定目标功能在本地文件中存在历史版本的历史字节码文件,然后,就可以删除该历史字节码文件,并将上述目标字节码文件保存在该指定存储位置。
另外的,在上述指定存储位置不存在其他字节码文件的情况下,还可以对该指定位置所属的存储目录进行查询,从而确定该存储目录下是否存在目标功能的历史字节码文件。在该存储目录下存在目标功能的历史字节码文件的情况下,就可以删除该历史字节码文件,并将上述目标字节码文件保存在上述指定存储位置。
通过上述描述可知,在将对上述目标字节码文件进行保存之前,首先可以确定上述目 标功能在本地文件中是否存在历史版本的历史字节码文件,并在本地文件中存在历史版本的历史字节码文件的情况下,删除该历史字节码文件,从而节省本地文件的存储空间,并减少了可能出现的,由于存在多个版本的字节码文件造成的调用字节码文件错误的情况。
在一个可选的实施方式中,参见图2所示,上述S103,基于检测到的功能调用请求在Flutter应用的本地文件中查找目标功能的目标字节码文件,具体包括如下过程:
S1031:在所述功能调用请求中获取所述目标功能的功能标识。
在本公开实施例中,首先基于上述功能调用请求,获取目标功能的功能标识,其中,该功能标识可以为该目标功能的功能id。
S1032:获取目标映射文件;其中,所述目标映射文件中包含所述Flutter应用的指定功能的功能标识和字节码标识之间的映射关系,所述字节码标识用于指示对应指定功能是否存在相应的字节码文件。
在本公开实施例中,可以为上述Flutter应用建立目标映射文件。这里,该目标映射文件中可以包含映射表,其中,该映射表用于指示Flutter应用中的指定功能的功能标识和字节码标识之间的映射关系。
这里,上述映射表中的映射关系是实时更新的,具体实施时,在接收到服务器发送的字节码文件后,就可以获取该字节码文件的字节码标识,并根据该字节码标识确定该字节码所对应的指定功能,然后,就可以基于该字节码标识,在上述映射表中更新该指定功能的映射关系。另外的,该映射表中还可以包含本地文件中存储字节码文件的指定位置,从而便于直接查找该字节码文件。
在本公开实施例中,在获取到上述目标功能的功能标识后,就可以获取上述映射表,并根据该目标功能的功能标识在映射表中查找该目标功能是否有对应的映射关系。
S1033:在所述目标映射文件中查找与所述目标功能的功能标识相对应的目标映射数据,并在基于所述目标映射数据确定所述本地文件中存在所述目标功能的目标字节码文件的情况下,在所述本地文件的指定位置中查找所述目标功能的目标字节码文件。
在本公开实施例中,首先可以确定与目标功能的功能标识相对应的目标映射数据,并基于该目标映射数据确定该目标功能所对应的映射关系。
具体实施时,可以基于上述目标映射数据确定目标功能是否有对应的映射关系,这里,可以基于映射关系标识来确定该目标功能是否有对应的映射关系。在该目标功能所对应的映射关系标识为1时,则确定该目标功能有对应的映射关系,在该目标功能所对应的映射关系标识为0时,则确定该目标功能没有对应的映射关系。
在确定出上述目标功能没有对应的映射关系后,就可以确定该目标功能没有对应的目标字节码文件。另外的,在确定出上述目标功能有对应的映射关系后,就可以确定该目标功能有对应的目标字节码文件,然后,就可以基于上述目标映射数据,确定本地文件中存储该目标字节码文件的指定位置,并基于该指定位置查找上述目标字节码文件。
通过上述描述可知,在检测到针对目标功能的功能调用请求后,就可以基于目标映射文件查找与该目标功能相对应的目标映射数据,并根据该目标映射数据查找目标功能所对应的目标字节码文件,从而提高了查找目标字节码文件的效率,进而提高了设备的响应速度。
在一个可选的实施方式中,上述S103,基于检测到的所述功能调用请求在所述Flutter应用的本地文件中查找所述目标功能的目标字节码文件,还包括如下过程:
(1)、在所述本地文件中查找到所述目标功能的多个版本的字节码文件的情况下,基于所述功能调用请求确定当前时刻所需要调用的目标功能的版本标识;
(2)、在所述多个版本的字节码文件中确定与所述版本标识相匹配的字节码文件作为所述目标功能的目标字节码文件。
在本公开实施例中,在上述目标功能经历过多次Flutter应用的版本更新和/或功能修复的情况下,每次版本更新或者功能修复后Flutter应用都会收到对应的字节码文件,因此,上述目标功能在本地文件中可以包含多个版本的字节码文件。
在本地文件中查找到目标功能的多个版本的字节码文件的情况下,首先需要确定功能调用请求所指示调用的目标功能的版本标识,其中,该版本标识可以用于指示对应的目标功能的版本更新时间。
在一种可选的实施方式中,上述功能调用请求所指示调用的目标功能的版本标识默认为最近一次版本更新所对应的版本标识,例如,目标功能所对应的多个版本的版本标识所指示的版本更新时间分别为2021.12.3、2021.12.31以及2022.2.1,那么,上述功能调用请求所指示调用的目标功能的版本标识所指示的版本更新时间就可以为2022.2.1。
在另一种可选的实施方式中,上述功能调用请求所指示调用的目标功能的版本标识还可以为指向性的,可以指示目标功能所对应的全部版本中的任一版本的版本标识。
具体实施时,用户在针对目标功能进行调用之前,可以在目标功能所对应的多个版本中选择想要调用的目标版本,并针对该目标版本发起功能调用请求。因此,在确定出该功能调用请求所指示调用的目标功能的版本标识后,就可以在多个版本的字节码文件中确定与该版本标识相匹配的字节码文件作为目标字节码文件。
另外的,在上述目标功能所对应的多个版本的字节码文件中包含失效字节码文件的情况下,还可以优先判断功能调用请求所指示调用的目标字节码文件是否有效,从而避免运行失效字节码文件造成的和Flutter应用之间的版本冲突。这里,失效字节码文件可以由开发人员进行确定,在确定出失效字节码文件之后,就可以通过服务器向Flutter应用发送禁用指令,以使该Flutter应用基于禁用指令,将该禁用指令所指示的字节码文件确定为失效字节码文件。
通过上述描述可知,在目标功能对应多个版本的字节码文件的情况下,可以通过功能调用请求确定出需要调用的目标字节码文件,从而使得用户可以自行选择想要运行的版本,提高了用户的操作体验。
在一个可选的实施方式中,上述方法还包括如下过程:
(1)、在未查找到所述目标功能的目标字节码文件的情况下,获取预设时段内所述Flutter应用的历史下载记录;所述历史下载记录用于指示所述Flutter应用在预设时段内从服务器获取到的对应功能的字节码文件;
(2)、在确定所述历史下载记录中包含所述目标功能的目标字节码文件的历史下载记录的情况下,向所述服务器发送获取请求;
(3)、获取所述服务器基于所述获取请求返回的所述目标字节码文件,并运行所述目 标字节码文件。
在一种可选的实施方式中,在获取到服务器发送的目标字节码文件后,可能会由于存储失败等问题无法对该目标字节码进行保存,或者在对该目标字节码进行保存后,由于清理存储空间等原因出现将该目标字节码文件误删等情况,此时,就会出现未查找到该目标功能的目标字节码文件,但是存在目标字节码文件的历史下载记录的情况。
这里,在确定出上述历史下载记录中包含目标功能的目标字节码文件的历史下载记录的情况下,就可以确定所述目标功能的功能标识,并基于该功能标识生成目标字节码文件的获取请求,并获取服务器基于该获取请求返回的目标字节码文件。
在另一种可选的实施方式中,在未查找到目标功能的目标字节码文件的情况下,还可以直接基于目标功能的功能标识生成目标字节码文件的获取请求,服务器在接收到该获取请求后,就可以确定该目标功能是否存在对应的目标字节码文件,若存在,就可以将该目标字节码文件发送至Flutter应用,从而提高了功能调用请求调用到目标字节码文件的可靠性。
通过上述描述可知,在未查找到目标功能的目标字节码文件的情况下,可以通过历史下载记录确定目标功能是否对应目标字节码文件,从而避免在该目标字节码文件被从本地文件中误删时,功能调用请求无法调用到该目标字节码文件的问题。
在一个可选的实施方式中,所述方法还包括如下过程:
在未查找到所述目标功能的目标字节码文件的情况下,在所述本地文件查找所述目标功能的AOT编译文件,并运行所述AOT编译文件。
需要说明的是,在构建上述Flutter应用时得到的编译产物为AOT编译文件,该AOT编译文件为和处理器类型相关的二进制代码,具体的,可以通过Dart编译器对该Flutter应用进行编译。另外的,在对上述Flutter应用的指定功能进行编译从而修复该指定功能的功能缺陷的过程中,还可以产出中间编译产物:字节码文件,该字节码文件可以发送到Flutter应用中,以使该Flutter应用对该字节码文件进行运行,从而达到修复该指定功能的功能缺陷的效果。
因此,在本公开实施例中,在未查找到目标功能的目标字节码文件的情况下,就可以获取该目标功能在本地文件中的AOT编译文件,并通过运行该AOT编译文件来实现该目标功能。
通过上述描述可知,在未查找到目标功能的目标字节码文件的情况下,还可以运行该目标功能的AOT编译文件,从而使得该目标功能能够顺利的运行。
在一个可选的实施方式中,运行所述目标功能的目标字节码文件,以实现执行修复对应功能缺陷之后的目标功能,具体包括如下过程:
(1)、调用所述Flutter应用中的Dart虚拟机;
(2)、将所述目标字节码文件加载至所述Dart虚拟机,以通过所述Dart虚拟机中的字节码解释器运行所述目标功能的目标字节码文件,以实现执行修复对应功能缺陷之后的目标功能。
在本公开实施例中,在获取到上述目标功能的目标字节码后,就可以调用上述虚拟机,这里,由于该Flutter应用是基于Dart语言进行构建的,那么,该虚拟机就可以为Dart虚 拟机,其中,Dart虚拟机为Dart语言提供执行环境的虚拟机。
具体实施时,可以将上述目标字节码加载到Dart虚拟机中,以通过该Dart虚拟机实现字节码解释器的功能,从而对该目标字节码进行运行,实现上述目标功能。
通过上述描述可知,通过将目标功能的目标字节码文件加载至Dart虚拟机的方式,就可以运行该目标功能的目标字节码文件,从而实现执行修复对应功能缺陷之后的目标功能。
在一个可选的实施方式中,参见图3所示,为本公开实施例提供的另一种应用程序的修复方法的流程图,应用于服务器,所述方法包括步骤S301~S305,其中:
S301:确定Flutter应用中待修复功能的目标修复代码。
在本公开实施例中,在确定出Flutter应用中的待修复功能后,技术人员就可以针对该待修复功能编写目标修复代码,该目标修复代码可以用于修复该待修复功能所对应的功能缺陷。这里,上述待修复功能即为上述目标功能。
S303:对所述目标修复代码进行编译,并基于所述编译过程中的目标中间编译产物生成所述待修复功能的目标字节码文件。
在本公开实施例中,在确定出Flutter应用中待修复功能的目标修复代码后,就可以将该目标修复代码加载至Dart编译器中,以使该Dart编译器对该目标修复代码进行编译。应理解的是,这里需要获取该编译过程中的中间编译产物,并基于该中间编译产物生成待修复功能的目标字节码文件。
S305:向所述Flutter应用发送所述目标字节码文件,以使所述Flutter应用基于上述图1所对应的方法运行所述目标字节码文件。
在本公开实施例中,在确定出上述目标字节码文件后,就可以将该目标字节码文件发送至Flutter应用,以使该Flutter应用运行该目标字节码文件。
具体实施时,在向Flutter应用发送上述目标字节码文件时可以设置多种发送方式。例如,可以采用实时发送的方式,在确定出上述目标字节码文件后就可以将该目标字节码发送至Flutter应用;或者可以采用定时发送的方式,这里,具体的发送时间可以基于Flutter应用的版本更新时间进行确定。
通过上述描述可知,在本公开实施例中,首先检测针对Flutter应用中的目标功能的功能调用请求,并基于该功能调用请求在Flutter应用的本地文件中查找该目标功能的目标字节码文件,在查找到该目标字节码文件的情况下,就可以运行该目标字节码文件,以实现执行修复对应功能缺陷之后的目标功能,从而缩短了修复Flutter应用的功能缺陷的流程,提高了修复效率,进而提高了用户的使用体验。
在一个可选的实施方式中,所述方法还包括如下过程:
(1)、接收所述Flutter应用发送的获取请求,并确定所述获取请求所对应的待修复功能;
(2)、接获取所述待修复功能所对应的目标字节码文件,并将所述目标字节码文件传输至所述Flutter应用。
在本公开实施例中,上述Flutter应用可以基于针对目标功能的功能调用请求确定需要调用的目标字节码,并基于该目标功能的功能标识,生成该目标字节码的获取请求,并向服务器发送该获取请求。
服务器在获取到该获取请求后,就可以基于该获取请求所携带的功能标识确定对应的待修复功能,并获取该待修复功能所对应的目标字节码文件。
另外的,在上述待修复功能对应多个版本的字节码文件的情况下,还可以在这多个版本的字节码文件中确定出目标字节码文件,具体的,获取所述待修复功能所对应的目标字节码文件,包括如下过程:
(1)、获取所述待修复功能所对应的各个版本的字节码文件;
(2)、在所述各个版本的字节码文件中确定与所述获取请求相匹配的字节码文件作为所述目标字节码文件;其中,所述获取请求中携带所请求调用的待修复功能的版本标识。
在本公开实施例中,上述待修复功能在服务器的本地文件中对应着更新文件,其中,该更新文件用于存储该待修复功能的多个版本的字节码文件。
在通过上述Flutter应用向服务器发送待修复功能所对应的获取请求之前,用户可以选择想要获取的目标字节码文件所属版本的版本标识,然后,就可以基于该版本标识生成获取请求,并将该获取请求发送至服务器。
服务器在接收到该获取请求后,首先可以获取该获取请求所携带的功能标识确定待修复功能,并获取该待修复功能所对应的更新文件中的各个版本的字节码文件。
在获取到上述各个版本的字节码文件后,就可以确定上述获取请求中所携带的待修复功能的版本标识,并根据该版本标识在更新文件中所包含的各个版本的字节码文件之中进行匹配操作,并将与该版本标识相匹配的字节码文件确定为目标字节码文件。
通过上述描述可知,在待修复功能对应多个版本的字节码文件的情况下,可以基于获取请求所携带的版本标识确定出目标字节码文件,从而使得用户能通过获取请求灵活的选择想要获取的目标字节码文件的版本,提高了用户的使用体验。
参见图4所示,为本公开实施例提供的又一种应用程序的修复方法的流程图,所述方法包括步骤S401~S105,其中:
S401:检测针对所述Flutter应用中的目标功能的功能调用请求。
在本公开实施例中,用户在使用该Flutter应用时,可以通过功能调用请求对Flutter应用中的目标功能进行调用,从而实现该Flutter应用的目标功能。例如,在上述目标功能为该Flutter应用中的小程序的情况下,在检测到针对该小程序的调用操作后,就可以将该小程序确定为目标功能,并确定检测到针对该目标功能的功能调用请求。
S402:判断上述目标功能在本地文件中是否存在目标字节码文件,若是,则执行S403;若否,则执行S404。
在本公开实施例中,在本公开实施例中,首先需要查询Flutter应用的本地文件,并确定该本地文件中是否包含上述目标功能所对应的目标字节码文件。需要说明的是,在该目标功能产生功能缺陷的情况下,技术人员可以编写用于修复该目标功能所对应功能缺陷的修复代码,并将基于该修复代码生成对应的目标字节码文件,然后将该目标字节码文件下发至Flutter应用。因此,在运行该Flutter应用的目标功能之前,需要首先在Flutter应用的本地文件中查找该目标功能的目标字节码文件。
具体实施时,可以通过上述图1所对应的实施例中的几种方式查找上述目标功能的目标字节码文件,此处不再赘述。
S403:运行上述目标功能的目标字节码文件,以实现执行修复对应功能缺陷之后的目标功能。
在本公开实施例中,在查找到上述目标功能的目标字节码文件的情况下,就可以通过运行该目标字节码文件的方式实现该目标功能。具体实施时,可以将该目标字节码加载到虚拟机中,并通过该虚拟机实现字节码解释器的功能,对该目标字节码进行运行,从而实现上述目标功能。
S404:在本地文件查找上述目标功能的AOT编译文件,并运行该AOT编译文件,以实现执行该目标功能。
在本公开实施例中,上述Flutter应用和服务器之间的交互过程如图5所示,其中,该Flutter应用中包含n个指定功能,每个指定功能在本地文件中均对应AOT编译文件。在上述目标功能在本地文件中不包含目标字节码文件时,就可以运行该目标功能在本地文件中的AOT编译文件,以实现执行该目标功能。
另外的,在上述Flutter应用中的指定功能3需要修复的情况下,就可以获取服务器发送的该指定功能3所对应的目标字节码文件,并将该目标字节码文件存储到指定位置中。
在一个可选的实施方式中,在构建上述Flutter应用的过程中,还包括如下过程:
(1)、获取上述Flutter应用中所包含的多个指定功能,并获取每个指定功能所对应的Dart代码文件;
确定字节码文件判断程序;该字节码判断程序用于在检测到针对对应的指定功能的功能调用请求之后,判断该指定功能在本地文件中是否存在对应的字节码文件;
(2)、基于上述字节码文件判断程序,为每个上述Dart代码文件进行插桩操作;其中,该插桩操作为在每个Dart代码文件的指定位置***该字节码文件判断程序。
在本公开实施例中,在构建上述Flutter应用的过程中,首先可以将该Flutter应用划分为多个指定功能,并分别开发该Flutter应用的每个指定功能,从而得到每个指定功能所对应的Dart代码文件。
这里,可以在编写每个指定功能所对应的Dart代码文件的过程中,将上述字节码文件判断程序编写在该Dart代码文件的指定位置中。另外的,还可以在得到每个指定功能所对应的Dart代码文件之后,通过插桩操作为每个Dart代码文件的指定位置***该字节码文件判断程序,本公开对***字节码文件判断程序的具体时机不做限定。
通过上述描述可知,通过为每个指定功能所对应的Dart代码文件***字节码文件判断程序的方式,使得Flutter应用在检测到针对目标功能的功能调用请求后,通过该目标功能中的字节码文件判断程序查找该Flutter应用的本地文件中是否存在目标字节码文件。
综上,在本公开实施例中,首先检测针对Flutter应用中的目标功能的功能调用请求,并基于该功能调用请求在Flutter应用的本地文件中查找该目标功能的目标字节码文件,在查找到该目标字节码文件的情况下,就可以运行该目标字节码文件,以实现执行修复对应功能缺陷之后的目标功能,从而缩短了修复Flutter应用的功能缺陷的流程,提高了修复效率,进而提高了用户的使用体验。
本领域技术人员可以理解,在具体实施方式的上述方法中,各步骤的撰写顺序并不意味着严格的执行顺序而对实施过程构成任何限定,各步骤的具体执行顺序应当以其功能和 可能的内在逻辑确定。
基于同一发明构思,本公开实施例中还提供了与应用程序的修复方法对应的应用程序的修复装置,由于本公开实施例中的装置解决问题的原理与本公开实施例上述应用程序的修复方法相似,因此装置的实施可以参见方法的实施,重复之处不再赘述。
参照图6所示,为本公开实施例提供的一种应用程序的修复装置的示意图,所述装置包括:检测单元61、查找单元62、运行单元63;其中,
检测单元61,用于检测针对所述Flutter应用中的目标功能的功能调用请求;
查找单元62,用于基于检测到的所述功能调用请求在所述Flutter应用的本地文件中查找所述目标功能的目标字节码文件;其中,所述目标字节码文件中包含用于修复所述目标功能的对应功能缺陷的字节码;
运行单元63,用于在查找到所述目标功能的目标字节码文件的情况下,运行所述目标功能的目标字节码文件,以实现执行修复对应功能缺陷之后的目标功能。
在本公开实施例中,首先检测针对Flutter应用中的目标功能的功能调用请求,并基于该功能调用请求在Flutter应用的本地文件中查找该目标功能的目标字节码文件,在查找到该目标字节码文件的情况下,就可以运行该目标字节码文件,以实现执行修复对应功能缺陷之后的目标功能,从而缩短了修复Flutter应用的功能缺陷的流程,提高了修复效率,进而提高了用户的使用体验。
一种可能的实施方式中,查找单元62,还用于:
在所述功能调用请求中获取所述目标功能的功能标识;
获取目标映射文件;其中,所述目标映射文件中包含所述Flutter应用的指定功能的功能标识和字节码标识之间的映射关系,所述字节码标识用于指示对应指定功能是否存在相应的字节码文件;
在所述目标映射文件中查找与所述目标功能的功能标识相对应的目标映射数据,并在基于所述目标映射数据确定所述本地文件中存在所述目标功能的目标字节码文件的情况下,在所述本地文件的指定位置中查找所述目标功能的目标字节码文件。
一种可能的实施方式中,该装置还用于:
在未查找到所述目标功能的目标字节码文件的情况下,获取预设时段内所述Flutter应用的历史下载记录;所述历史下载记录用于指示所述Flutter应用在预设时段内从服务器获取到的对应功能的字节码文件;
在确定所述历史下载记录中包含所述目标功能的目标字节码文件的历史下载记录的情况下,向所述服务器发送获取请求;
获取所述服务器基于所述获取请求返回的所述目标字节码文件,并运行所述目标字节码文件。
一种可能的实施方式中,该装置还用于:
在未查找到所述目标功能的目标字节码文件的情况下,在所述本地文件查找所述目标功能的AOT编译文件,并运行所述AOT编译文件。
一种可能的实施方式中,查找单元62,还用于:
在所述本地文件中查找到所述目标功能的多个版本的字节码文件的情况下,基于所述 功能调用请求确定当前时刻所需要调用的目标功能的版本标识;
在所述多个版本的字节码文件中确定与所述版本标识相匹配的字节码文件作为所述目标功能的目标字节码文件。
一种可能的实施方式中,该装置还用于:
在检测对所述Flutter应用中的目标功能的功能调用请求之后,获取服务器发送的所述目标功能的目标字节码文件;
将所述目标功能的目标字节码文件保存在所述本地文件的指定存储位置。
一种可能的实施方式中,该装置还用于:
在所述本地文件中查找所述目标功能的历史字节码文件;
在查找到所述历史字节码文件的情况下,删除所述历史字节码文件,并将所述目标字节码文件保存在所述本地文件的指定存储位置。
一种可能的实施方式中,运行单元63,还用于:
调用所述Flutter应用中的Dart虚拟机;
将所述目标字节码文件加载至所述Dart虚拟机,以通过所述Dart虚拟机中的字节码解释器运行所述目标功能的目标字节码文件,以实现执行修复对应功能缺陷之后的目标功能。
参照图7所示,为本公开实施例提供的另一种应用程序的修复装置的示意图,所述装置包括:确定单元71、编译单元72、发送单元73;其中,
确定单元71,用于确定Flutter应用中待修复功能的目标修复代码;
编译单元72,用于对所述目标修复代码进行编译,并基于所述编译过程中的目标中间编译产物生成所述待修复功能的目标字节码文件;
发送单元73,用于向所述Flutter应用发送所述目标字节码文件,以使所述Flutter应用基于上述图1所对应的方法运行所述目标字节码文件。
一种可能的实施方式中,该装置还用于:
接收所述Flutter应用发送的获取请求,并确定所述获取请求所对应的待修复功能;
获取所述待修复功能所对应的目标字节码文件,并将所述目标字节码文件传输至所述Flutter应用。
一种可能的实施方式中,该装置还用于:
获取所述待修复功能所对应的各个版本的字节码文件;
在所述各个版本的字节码文件中确定与所述获取请求相匹配的字节码文件作为所述目标字节码文件;其中,所述获取请求中携带所请求调用的待修复功能的版本标识。
关于装置中的各单元的处理流程、以及各单元之间的交互流程的描述可以参照上述方法实施例中的相关说明,这里不再详述。
对应于图1中的应用程序的修复方法,本公开实施例还提供了一种计算机设备800,如图8所示,为本公开实施例提供的计算机设备800结构示意图,包括:
处理器81、存储器82、和总线83;存储器82用于存储执行指令,包括内存821和外部存储器822;这里的内存821也称内存储器,用于暂时存放处理器81中的运算数据,以及与硬盘等外部存储器822交换的数据,处理器81通过内存821与外部存储器822进行数据交换,当所述计算机设备800运行时,所述处理器81与所述存储器82之间通过总线83 通信,使得所述处理器81执行以下指令:
检测针对所述Flutter应用中的目标功能的功能调用请求;
基于检测到的所述功能调用请求在所述Flutter应用的本地文件中查找所述目标功能的目标字节码文件;其中,所述目标字节码文件中包含用于修复所述目标功能的对应功能缺陷的字节码;
在查找到所述目标功能的目标字节码文件的情况下,运行所述目标功能的目标字节码文件,以实现执行修复对应功能缺陷之后的目标功能。
对应于图3中的应用程序的修复方法,本公开实施例还提供了另一种计算机设备900,如图9所示,为本公开实施例提供的计算机设备900结构示意图,包括:
处理器91、存储器92、和总线93;存储器92用于存储执行指令,包括内存921和外部存储器922;这里的内存921也称内存储器,用于暂时存放处理器91中的运算数据,以及与硬盘等外部存储器922交换的数据,处理器91通过内存921与外部存储器922进行数据交换,当所述计算机设备900运行时,所述处理器91与所述存储器92之间通过总线93通信,使得所述处理器91执行以下指令:
确定Flutter应用中待修复功能的目标修复代码;
对所述目标修复代码进行编译,并基于所述编译过程中的目标中间编译产物生成所述待修复功能的目标字节码文件;
向所述Flutter应用发送所述目标字节码文件,以使所述Flutter应用基于上述图1所对应的方法运行所述目标字节码文件。
本公开实施例还提供一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序,该计算机程序被处理器运行时执行上述方法实施例中所述的应用程序的修复方法的步骤。其中,该存储介质可以是易失性或非易失的计算机可读取存储介质。
本公开实施例还提供一种计算机程序产品,该计算机程序产品承载有程序代码,所述程序代码包括的指令可用于执行上述方法实施例中所述的应用程序的修复方法的步骤,具体可参见上述方法实施例,在此不再赘述。
其中,上述计算机程序产品可以具体通过硬件、软件或其结合的方式实现。在一个可选实施例中,所述计算机程序产品具体体现为计算机存储介质,在另一个可选实施例中,计算机程序产品具体体现为软件产品,例如软件开发包(Software Development Kit,SDK)等等。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的***和装置的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。在本公开所提供的几个实施例中,应该理解到,所揭露的***、装置和方法,可以通过其它的方式实现。以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,又例如,多个单元或组件可以结合或者可以集成到另一个***,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些通信接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的 部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本公开各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个处理器可执行的非易失的计算机可读取存储介质中。基于这样的理解,本公开的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本公开各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
最后应说明的是:以上所述实施例,仅为本公开的具体实施方式,用以说明本公开的技术方案,而非对其限制,本公开的保护范围并不局限于此,尽管参照前述实施例对本公开进行了详细的说明,本领域的普通技术人员应当理解:任何熟悉本技术领域的技术人员在本公开揭露的技术范围内,其依然可以对前述实施例所记载的技术方案进行修改或可轻易想到变化,或者对其中部分技术特征进行等同替换;而这些修改、变化或者替换,并不使相应技术方案的本质脱离本公开实施例技术方案的精神和范围,都应涵盖在本公开的保护范围之内。因此,本公开的保护范围应所述以权利要求的保护范围为准。

Claims (16)

  1. 一种应用程序的修复方法,其特征在于,应用于Flutter应用,包括:
    检测针对所述Flutter应用中的目标功能的功能调用请求;
    基于检测到的所述功能调用请求,在所述Flutter应用的本地文件中查找所述目标功能的目标字节码文件;其中,所述目标字节码文件中包含用于修复所述目标功能的对应功能缺陷的字节码;
    在查找到所述目标功能的目标字节码文件的情况下,运行所述目标功能的目标字节码文件,以实现执行修复对应功能缺陷之后的目标功能。
  2. 根据权利要求1所述的方法,其特征在于,所述基于检测到的所述功能调用请求,在所述Flutter应用的本地文件中查找所述目标功能的目标字节码文件,包括:
    在所述功能调用请求中获取所述目标功能的功能标识;
    获取目标映射文件;其中,所述目标映射文件中包含所述Flutter应用的指定功能的功能标识和字节码标识之间的映射关系,所述字节码标识用于指示对应指定功能是否存在相应的字节码文件;
    在所述目标映射文件中查找与所述目标功能的功能标识相对应的目标映射数据,并在基于所述目标映射数据确定所述本地文件中存在所述目标功能的目标字节码文件的情况下,在所述本地文件的指定位置中查找所述目标功能的目标字节码文件。
  3. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    在未查找到所述目标功能的目标字节码文件的情况下,获取预设时段内所述Flutter应用的历史下载记录;所述历史下载记录用于指示所述Flutter应用在预设时段内从服务器获取到的对应功能的字节码文件;
    在确定所述历史下载记录中包含所述目标功能的目标字节码文件的历史下载记录的情况下,向所述服务器发送获取请求;
    获取所述服务器基于所述获取请求返回的所述目标字节码文件,并运行所述目标字节码文件。
  4. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    在未查找到所述目标功能的目标字节码文件的情况下,在所述本地文件查找所述目标功能的AOT编译文件,并运行所述AOT编译文件。
  5. 根据权利要求1所述的方法,其特征在于,所述基于检测到的所述功能调用请求,在所述Flutter应用的本地文件中查找所述目标功能的目标字节码文件,包括:
    在所述本地文件中查找到所述目标功能的多个版本的字节码文件的情况下,基于所述功能调用请求确定当前时刻所需要调用的目标功能的版本标识;
    在所述多个版本的字节码文件中,确定与所述版本标识相匹配的字节码文件作为所述目标功能的目标字节码文件。
  6. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    在检测对所述Flutter应用中的目标功能的功能调用请求之后,获取服务器发送的所述目标功能的目标字节码文件;
    将所述目标功能的目标字节码文件保存在所述本地文件的指定存储位置。
  7. 根据权利要求6所述的方法,其特征在于,所述将所述目标功能的目标字节码文件保存在所述本地文件的指定存储位置,包括:
    在所述本地文件中查找所述目标功能的历史字节码文件;
    在查找到所述历史字节码文件的情况下,删除所述历史字节码文件,并将所述目标字节码文件保存在所述本地文件的指定存储位置。
  8. 根据权利要求1所述的方法,其特征在于,所述运行所述目标功能的目标字节码文件,以实现执行修复对应功能缺陷之后的目标功能,包括:
    调用所述Flutter应用中的Dart虚拟机;
    将所述目标字节码文件加载至所述Dart虚拟机,以通过所述Dart虚拟机中的字节码解释器运行所述目标功能的目标字节码文件,以实现执行修复对应功能缺陷之后的目标功能。
  9. 一种应用程序的修复方法,其特征在于,应用于服务器,包括:
    确定Flutter应用中待修复功能的目标修复代码;
    对所述目标修复代码进行编译,并基于所述编译过程中的目标中间编译产物生成所述待修复功能的目标字节码文件;
    向所述Flutter应用发送所述目标字节码文件,以使所述Flutter应用基于上述权利要求1至8中任一项所述的方法运行所述目标字节码文件。
  10. 根据权利要求9所述的方法,其特征在于,所述方法还包括:
    接收所述Flutter应用发送的获取请求,并确定所述获取请求所对应的待修复功能;
    获取所述待修复功能所对应的目标字节码文件,并将所述目标字节码文件传输至所述Flutter应用。
  11. 根据权利要求10所述的方法,其特征在于,所述获取所述待修复功能所对应的目标字节码文件,包括:
    获取所述待修复功能所对应的各个版本的字节码文件;
    在所述各个版本的字节码文件中确定与所述获取请求相匹配的字节码文件作为所述目标字节码文件;其中,所述获取请求中携带所请求调用的待修复功能的版本标识。
  12. 一种应用程序的修复装置,其特征在于,应用于Flutter应用,包括:
    检测单元,用于检测针对所述Flutter应用中的目标功能的功能调用请求;
    查找单元,用于基于检测到的所述功能调用请求在所述Flutter应用的本地文件中查找所述目标功能的目标字节码文件;其中,所述目标字节码文件中包含用于修复所述目标功能的对应功能缺陷的字节码;
    运行单元,用于在查找到所述目标功能的目标字节码文件的情况下,运行所述目标功能的目标字节码文件,以实现执行修复对应功能缺陷之后的目标功能。
  13. 一种应用程序的修复装置,其特征在于,应用于服务器,包括:
    确定单元,用于确定Flutter应用中待修复功能的目标修复代码;
    编译单元,用于对所述目标修复代码进行编译,并基于所述编译过程中的目标中间编译产物生成所述待修复功能的目标字节码文件;
    发送单元,用于向所述Flutter应用发送所述目标字节码文件,以使所述Flutter应用基于上述权利要求1至8中任一项所述的方法运行所述目标字节码文件。
  14. 一种计算机设备,其特征在于,包括:处理器、存储器和总线,所述存储器存储有所述处理器可执行的机器可读指令,当计算机设备运行时,所述处理器与所述存储器之间通过总线通信,所述机器可读指令被所述处理器执行时执行如权利要求1至11任意一项所述的应用程序的修复方法的步骤。
  15. 一种计算机可读存储介质,其特征在于,该计算机可读存储介质上存储有计算机程序,该计算机程序被处理器运行时执行如权利要求1至11任意一项所述的应用程序的修复方法的步骤。
  16. 一种计算机程序产品,其特征在于,所述计算机程序产品包括计算机程序或指令,所述计算机程序或所述指令被处理器执行时实现如权利要求1至11任一项所述的应用程序的修复方法的步骤。
PCT/CN2023/076115 2022-03-10 2023-02-15 应用程序的修复方法、装置、计算机设备以及存储介质 WO2023169164A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210240370.7A CN114610516B (zh) 2022-03-10 2022-03-10 应用程序的修复方法、装置、计算机设备以及存储介质
CN202210240370.7 2022-03-10

Publications (1)

Publication Number Publication Date
WO2023169164A1 true WO2023169164A1 (zh) 2023-09-14

Family

ID=81862110

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/076115 WO2023169164A1 (zh) 2022-03-10 2023-02-15 应用程序的修复方法、装置、计算机设备以及存储介质

Country Status (2)

Country Link
CN (1) CN114610516B (zh)
WO (1) WO2023169164A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114610516B (zh) * 2022-03-10 2023-07-04 抖音视界有限公司 应用程序的修复方法、装置、计算机设备以及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140245275A1 (en) * 2013-02-26 2014-08-28 Red Hat, Inc. Bytecode modification
CN108089870A (zh) * 2016-11-21 2018-05-29 百度在线网络技术(北京)有限公司 用于修复应用的方法和装置
CN109445807A (zh) * 2017-08-28 2019-03-08 腾讯科技(深圳)有限公司 实现应用程序更新的方法、装置和计算机可读存储介质
CN114610516A (zh) * 2022-03-10 2022-06-10 北京字节跳动网络技术有限公司 应用程序的修复方法、装置、计算机设备以及存储介质
CN114706586A (zh) * 2022-03-11 2022-07-05 北京字节跳动网络技术有限公司 代码编译、代码运行方法、装置、计算机设备及存储介质

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106843947B (zh) * 2017-01-04 2020-01-24 腾讯科技(深圳)有限公司 代码缺陷的处理方法和装置
CN111142922B (zh) * 2018-11-02 2023-04-25 阿里巴巴集团控股有限公司 应用程序更新方法、装置、终端及服务器
CN110471693A (zh) * 2019-08-21 2019-11-19 网易(杭州)网络有限公司 应用程序发布、运行方法及设备
CN113918195A (zh) * 2021-11-19 2022-01-11 中电金信软件有限公司 应用界面更新方法、装置、电子设备及可读存储介质
CN114116509A (zh) * 2021-12-02 2022-03-01 建信金融科技有限责任公司 程序分析方法、装置、电子设备和存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140245275A1 (en) * 2013-02-26 2014-08-28 Red Hat, Inc. Bytecode modification
CN108089870A (zh) * 2016-11-21 2018-05-29 百度在线网络技术(北京)有限公司 用于修复应用的方法和装置
CN109445807A (zh) * 2017-08-28 2019-03-08 腾讯科技(深圳)有限公司 实现应用程序更新的方法、装置和计算机可读存储介质
CN114610516A (zh) * 2022-03-10 2022-06-10 北京字节跳动网络技术有限公司 应用程序的修复方法、装置、计算机设备以及存储介质
CN114706586A (zh) * 2022-03-11 2022-07-05 北京字节跳动网络技术有限公司 代码编译、代码运行方法、装置、计算机设备及存储介质

Also Published As

Publication number Publication date
CN114610516B (zh) 2023-07-04
CN114610516A (zh) 2022-06-10

Similar Documents

Publication Publication Date Title
JP4878715B2 (ja) オペレーティングシステムに適合しないアプリケーションにパッチを当てる方法、コンピュータシステム及びコンピュータ可読記録媒体
US6542167B1 (en) System and method for flexible software linking
JP5208350B2 (ja) 自己記述型ソフトウェアイメージ更新コンポーネント
CN104603750B (zh) 使用bpram来布局和执行软件应用
WO2015165232A1 (zh) 一种加载驱动程序的方法及嵌入式设备
US6269442B1 (en) Apparatus and method for on-line replacement of a running program code and data using checkpoints
US9563446B2 (en) Binary file generation
CN109614165B (zh) 一种com组件的多版本并行运行方法和装置
CN104583948B (zh) 使用bpram来布局和执行操作***
US20200249925A1 (en) On-demand loading of dynamic scripting language code for reduced memory usage
WO2018045733A1 (zh) 一种安卓***so文件的加载方法及电子设备
US20060064576A1 (en) Boot systems and methods
US7191436B1 (en) Computer system utility facilitating dynamically providing program modifications for identified programs
CN108614702B (zh) 字节码优化方法及装置
CN110554998B (zh) 一种通过替换函数内部指令的钩子方法、装置、终端及存储介质
WO2023169164A1 (zh) 应用程序的修复方法、装置、计算机设备以及存储介质
US20120227056A1 (en) Method and system for enabling access to functionality provided by resources outside of an operating system environment
WO2024113717A1 (zh) 基于zns ssd的文件***控制方法、装置及设备
CN111562934A (zh) 一种基于热补丁的软件***升级方法、终端及存储介质
WO2023179298A1 (zh) 应用程序更新、应用程序开发方法、装置及计算机设备
WO2022227409A1 (zh) 一种嵌入式终端远程软件更新方法
US6691121B1 (en) Method and apparatus for online and dynamic extension of IMS data entry databases
US10185653B2 (en) Integrated systems and methods for the transactional management of main memory and data storage
JP2004206353A (ja) ソフトウェアのインストール方法
WO2024146324A1 (zh) Arm架构下热补丁处理方法、装置、存储介质及电子装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23765742

Country of ref document: EP

Kind code of ref document: A1