CN114610516A - Application program repairing method and device, computer equipment and storage medium - Google Patents

Application program repairing method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN114610516A
CN114610516A CN202210240370.7A CN202210240370A CN114610516A CN 114610516 A CN114610516 A CN 114610516A CN 202210240370 A CN202210240370 A CN 202210240370A CN 114610516 A CN114610516 A CN 114610516A
Authority
CN
China
Prior art keywords
target
function
file
bytecode
byte code
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210240370.7A
Other languages
Chinese (zh)
Other versions
CN114610516B (en
Inventor
季涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN202210240370.7A priority Critical patent/CN114610516B/en
Publication of CN114610516A publication Critical patent/CN114610516A/en
Priority to PCT/CN2023/076115 priority patent/WO2023169164A1/en
Application granted granted Critical
Publication of CN114610516B publication Critical patent/CN114610516B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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

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

The disclosure provides a method, a device, a computer device and a storage medium for repairing an application program, wherein the method comprises the following steps: detecting a function call request aiming at a target function in the Flutter application; searching a target byte code file of the target function in a local file of the Flutter application based on the detected function calling request; and under the condition that the target bytecode file of the target function is found, operating the target bytecode file of the target function to realize executing the target function after repairing the corresponding functional defect. In the embodiment of the present disclosure, when the target bytecode file of the target function is found in the local file of the Flutter application based on the function call request, the bytecode file may be operated to implement the execution of 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 further improving the user experience.

Description

Application program repairing method and device, computer equipment and storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and an apparatus for repairing an application program, a computer device, and a storage medium.
Background
With the popularization of the Flutter cross-terminal technology, more and more Flutter applications are developed based on the Flutter cross-terminal technology, and therefore, the problem repair requirements for the Flutter applications are more and more common. However, in the existing repair solution for the Flutter application, after the code of the function to be repaired in the Flutter application is modified to obtain the patch package, the patch package is uploaded to the application store, so that the user downloads the patch package from the application store, thereby completing the repair of the function to be repaired in the Flutter application. Therefore, the existing repair scheme has a long whole flow and low repair efficiency.
Disclosure of Invention
The embodiment of the disclosure at least provides a method and a device for repairing an application program, a computer device and a storage medium.
In a first aspect, an embodiment of the present disclosure provides an application program repairing method, applied to a Flutter application, including:
detecting a function call request aiming at a target function in the Flutter application; searching a target byte code file of the target function in a local file of the Flutter application based on the detected function calling request; wherein the target bytecode file contains a bytecode for repairing a corresponding functional defect of the target function; and under the condition that the target bytecode file of the target function is found, operating the target bytecode file of the target function to realize executing the target function after repairing the corresponding functional defect.
In an optional embodiment, the searching, in a local file of the Flutter application, a target bytecode file of the target function based on the detected function call request includes:
acquiring a function identifier of the target function in the function calling request; acquiring a target mapping file; the target mapping file comprises a mapping relation between a function identifier and a byte code identifier of a specified function applied by the Flutter, and the byte code identifier is used for indicating whether a corresponding byte code file exists in the corresponding specified function or not; and searching target mapping data corresponding to the function identifier of the target function in the target mapping file, and searching the target bytecode file of the target function in the specified position of the local file under the condition that the target bytecode file of the target function is determined to exist in the local file based on the target mapping data.
In an optional embodiment, the method further comprises:
under the condition that the target byte code file of the target function is not found, acquiring a historical downloading record of the FLUTTER application in a preset time period; the historical download record is used for indicating that the Flutter applies the byte code file of the corresponding function obtained from the server within a preset time period; under the condition that the historical download record of the target byte code file of the target function is determined to be contained in the historical download record, sending an acquisition request to the server; and acquiring the target byte code file returned by the server based on the acquisition request, and operating the target byte code file.
In an optional embodiment, the method further comprises:
and under the condition that the target bytecode file of the target function is not found, finding the AOT compiled file of the target function in the local file, and operating the AOT compiled file.
In an optional embodiment, the searching, in a local file of the Flutter application, a target bytecode file of the target function based on the detected function call request includes:
under the condition that the bytecode files of the multiple versions of the target function are found in the local file, determining the version identification of the target function required to be called at the current moment based on the function calling request; and determining the byte code file matched with the version identification in the byte code files of the plurality of versions as a target byte code file of the target function.
In an optional embodiment, the method further comprises:
after detecting a function call request for a target function in the Flutter application, acquiring a target bytecode file of the target function sent by a server; and storing the target byte code file of the target function in the appointed storage position of the local file.
In an optional embodiment, the saving the target bytecode file of the target function in a specified storage location of the local file includes:
searching a historical byte code file of the target function in the local file; and under the condition that the historical byte code file is found, deleting the historical byte code file, and storing the target byte code file in a specified storage position of the local file.
In an optional embodiment, the running the target bytecode file of the target function to implement the target function after repairing the corresponding functional defect includes:
calling a Dart virtual machine in the Flutter application; and loading the target bytecode file to the Dart virtual machine, so as to run the target bytecode file of the target function through a bytecode interpreter in the Dart virtual machine, thereby implementing the target function after repairing the corresponding functional defect.
In a second aspect, an embodiment of the present disclosure further provides a method for repairing an application program, which is applied to a server, and includes:
determining a target repair code of a function to be repaired in the Flutter application; compiling the target repair code, and generating a target byte code file of the function to be repaired based on a target intermediate compilation product in the compiling process; and sending the target byte code file to the Flutter application so that the Flutter application runs the target byte code file based on the method of the first aspect.
In an optional embodiment, the method further comprises:
receiving an acquisition request sent by the Flutter application, and determining a function to be repaired corresponding to the acquisition request; and acquiring a target byte code file corresponding to the function to be repaired, and transmitting the target byte code file to the Flutter application.
In an optional implementation manner, the obtaining a target bytecode file corresponding to the function to be repaired includes:
acquiring byte code files of each version corresponding to the function to be repaired; determining byte code files matched with the acquisition request in the byte code files of the versions as the target byte code files; and the obtaining request carries the version identification of the function to be repaired requested to be called.
In a third aspect, an embodiment of the present disclosure further provides a device for repairing an application program, which is applied to a Flutter application, and includes:
a detecting unit, configured to detect a function call request for a target function in the Flutter application; the searching unit is used for searching a target byte code file of the target function in a local file of the Flutter application based on the detected function calling request; wherein the target bytecode file contains a bytecode for repairing a corresponding functional defect of the target function; and the operation unit is used for operating the target bytecode file of the target function under the condition that the target bytecode file of the target function is found so as to realize the execution of the target function after the corresponding functional defect is repaired.
In a fourth aspect, an embodiment of the present disclosure further provides an apparatus for repairing an application, where the apparatus is applied to a server, and the apparatus includes:
the device comprises a determining unit, a judging unit and a judging unit, wherein the determining unit is used for determining a target repair code of a function to be repaired in the Flutter application; the compiling unit is used for compiling the target repair code and generating a target byte code file of the function to be repaired based on a target intermediate compiling product in the compiling process; 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 of the first aspect of the preceding claims.
In a fifth aspect, an embodiment of the present disclosure further provides a computer device, including: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, the processor and the memory communicating via the bus when the computer device is running, the machine-readable instructions being executable by the processor to perform the steps of any one of the possible implementations of the first to second aspects.
In a sixth aspect, the disclosed embodiments further provide a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and the computer program is executed by a processor to perform the steps in any one of the possible implementation manners of the first aspect to the second aspect.
In the embodiment of the present disclosure, a function call request for a target function in a Flutter application is first detected, a target bytecode file of the target function is searched in a local file of the Flutter application based on the function call request, and the target bytecode file can be run under the condition that the target bytecode file is found, so as to implement the execution of the target function after the corresponding function defect is repaired, thereby shortening a flow of repairing the function defect of the Flutter application, improving repair efficiency, and further improving user experience.
In order to make the aforementioned objects, features and advantages of the present disclosure more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings required for use in the embodiments will be briefly described below, and the drawings herein incorporated in and forming a part of the specification illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the technical solutions of the present disclosure. It is appreciated that the following drawings depict only certain embodiments of the disclosure and are therefore not to be considered limiting of its scope, for those skilled in the art will be able to derive additional related drawings therefrom without the benefit of the inventive faculty.
Fig. 1 is a flowchart illustrating a method for repairing an application provided by an embodiment of the present disclosure;
fig. 2 shows a flowchart for finding a target bytecode file of a target function in a local file of a Flutter application based on a detected function call request according to an embodiment of the present disclosure;
FIG. 3 is a flow chart illustrating another method for repairing an application provided by an embodiment of the present disclosure;
FIG. 4 is a flowchart illustrating a method for repairing an application according to an embodiment of the present disclosure;
fig. 5 is a schematic diagram illustrating an interaction process between a Flutter application and a server provided by an embodiment of the present disclosure;
FIG. 6 is a schematic diagram illustrating a device for repairing an application according to an embodiment of the present disclosure;
FIG. 7 is a schematic diagram of another application repair apparatus provided by an embodiment of the present disclosure;
FIG. 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.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present disclosure more clear, the technical solutions of the embodiments of the present disclosure will be described clearly and completely with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are only a part of the embodiments of the present disclosure, not all of the embodiments. The components of the embodiments of the present disclosure, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present disclosure, presented in the figures, is not intended to limit the scope of the claimed disclosure, but is merely representative of selected embodiments of the disclosure. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the disclosure without making creative efforts, shall fall within the protection scope of the disclosure.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
The term "and/or" herein merely describes an associative relationship, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the term "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, C, and may mean including any one or more elements selected from the group consisting of A, B and C.
Research shows that in the existing repair scheme for the Flutter application, after code modification is performed on a function to be repaired in the Flutter application to obtain a patch package, the patch package is uploaded to an application store, so that a user downloads the patch package from the application store, and repair of the function to be repaired in the Flutter application is completed. Therefore, the existing repair scheme has a long whole flow and low repair efficiency.
Based on the above research, the present disclosure provides a method, an apparatus, a computer device, and a storage medium for repairing an application program, in an embodiment of the present disclosure, a function call request for a target function in a Flutter application is first detected, a target bytecode file of the target function is searched in a local file of the Flutter application based on the function call request, and the target bytecode file can be run under the condition that the target bytecode file is found, so as to implement execution of a target function after repairing a corresponding function defect, thereby shortening a flow of repairing the function defect of the Flutter application, improving repair efficiency, and further improving user experience.
In order to facilitate understanding of the present embodiment, a detailed description is first given of a method for repairing an application program disclosed in the embodiments of the present disclosure, and an execution subject of the method for repairing an application program provided in the embodiments of the present disclosure is generally a computer device with certain computing capability. In some possible implementations, the application repair method may be implemented by a processor calling computer-readable instructions stored in a memory.
Referring to fig. 1, a flowchart of a method for repairing an application program provided in an embodiment of the present disclosure is applied to a Flutter application, where the method includes steps S101 to S105, where:
s101: detecting a function call request for a target function in the Flutter application.
In this disclosure, the Flutter application is an application program developed based on a Flutter framework that can be developed across platforms, and the Flutter application includes a method for implementing different specified functions. For example, the Flutter application may be an information browsing application, wherein the Flutter application includes the following specific functions: information browsing, short video browsing, movie screening, applets, etc.
Here, when using the Flutter application, the user may call the target function in the Flutter application through the function call request, thereby implementing the target function of the Flutter application. For example, in the case where the target function is an applet in the Flutter application, after a call operation for the applet is detected, the applet may be determined as the target function, and a function call request for the target function may be determined to be detected.
S103: searching a target byte code file of the target function in a local file of the Flutter application based on the detected function calling request; wherein the target bytecode file includes a bytecode for repairing a corresponding functional defect of the target function.
In the embodiment of the present disclosure, first, a local file of the Flutter application needs to be queried, and whether the local file includes a target bytecode file corresponding to the target function is determined. It should be noted that, under the condition that the target function has a functional defect, a technician may write a repair code for repairing the functional defect corresponding to the target function, generate a corresponding target bytecode file based on the repair code, and then issue the target bytecode file to the Flutter application. Therefore, before the target function of the Flutter application is run, the target bytecode file of the target function needs to be first searched in the local file of the Flutter application.
In specific implementation, the target bytecode file of the target function can be searched in the following ways:
the method I comprises the following steps:
in this disclosure, the local file of the Flutter application includes different subfiles, where each subfile may correspond to at least one specified function in the Flutter application. Therefore, when searching for the target bytecode file of the target function, first, the target subfile corresponding to the target function in the local file applied by the Flutter may be determined, and the target subfile is traversed, so as to determine whether the target subfile includes the target bytecode file of the target function.
The second method comprises the following steps:
in this disclosure, the local file of the Flutter application includes a byte code file, and the byte code file is used for storing the byte code file sent by the server. Therefore, when searching for the target bytecode file of the target function, firstly, the function identifier of the target function may be determined based on the function call request, and the bytecode file applied by Flutter may be searched for according to the function identifier, so as to determine whether the bytecode file includes the target bytecode file corresponding to the function identifier.
S105: and under the condition that the target bytecode file of the target function is found, operating the bytecode file of the target function to realize the target function after repairing the corresponding functional defect.
In the embodiment of the present disclosure, when the target bytecode file of the target function is found, the target function can be implemented by running the target bytecode file. In specific implementation, the target bytecode may be loaded into a virtual machine, and the virtual machine implements a function of a bytecode interpreter to operate the target bytecode, thereby implementing the target function.
As can be seen from the above description, in the embodiment of the present disclosure, a function call request for a target function in the Flutter application is first detected, a target bytecode file of the target function is searched in a local file of the Flutter application based on the function call request, and the target bytecode file can be run under the condition that the target bytecode file is found, so as to implement execution of the target function after repairing a corresponding functional defect, thereby shortening a process of repairing the functional defect of the Flutter application, improving repair efficiency, and further improving user experience.
In an optional embodiment, the method further comprises the process of:
(1) after detecting a function call request of a target function in the Flutter application, acquiring a target byte code file of the target function sent by a server;
(2) and storing the target byte code file of the target function in the appointed storage position of the local file.
In the embodiment of the present disclosure, after the target bytecode file of the target function sent by the server is acquired, the specified storage location of the target bytecode file in the local file may be determined. In specific implementation, several ways corresponding to the above-mentioned target bytecode file for searching for a target function include the following situations:
the first condition is as follows:
in the embodiment of the present disclosure, corresponding to the first mentioned manner: the local file of the Flutter application includes different subfiles, where each subfile may correspond to at least one designated function in the Flutter application. Therefore, when the specified storage location of the target bytecode file of the target function is determined, first, the storage directory of the target subfile corresponding to the local file of the target function is determined, and the specified storage location of the target bytecode file is generated in the storage directory, so that the target bytecode file is stored in the target subfile.
Case two:
in the embodiment of the present disclosure, corresponding to the above mentioned mode two: the local file of the Flutter application includes a byte code file, and the byte code file is used for storing the byte code file sent by the server. Therefore, when the specified storage location of the target bytecode file of the target function is determined, the storage directory corresponding to the bytecode file in the local file is first obtained, and the specified storage location of the target bytecode file is generated under the storage directory, so that the target bytecode file is stored in the bytecode file.
As can be seen from the above description, after the target bytecode file of the target function sent by the server is acquired, the target bytecode file can be stored in the specified storage location of the local file, so that the target bytecode file can be called from the specified storage location according to the function call request.
In an optional implementation manner, the storing the target bytecode file of the target function in the specified storage location of the local file specifically includes the following processes:
(1) searching a historical byte code file of the target function in the local file;
(2) and under the condition that the historical byte code file is found, deleting the historical byte code file, and storing the target byte code file in the specified storage position of the local file.
In the embodiment of the present disclosure, before saving the target bytecode file, it may be first determined whether the target function has a history bytecode file of a history version in a local file.
In a specific implementation, a specified storage location of the target bytecode file in the local file may be determined, and if there is another bytecode file in the specified storage location, it may be determined that the historical bytecode file of the historical version exists in the local file for the target function, and then the historical bytecode file may be deleted and the target bytecode file may be stored in the specified storage location.
In addition, when there is no other bytecode file in the specified storage location, the storage directory to which the specified location belongs may be queried to determine whether there is a history bytecode file of the target function in the storage directory. If a history bytecode file of a target function exists in the storage directory, the history bytecode file may be deleted and the target bytecode file may be stored in the designated storage location.
As can be seen from the above description, before the target bytecode file is saved, it may be determined whether the historical bytecode file of the historical version exists in the local file for the target function, and in a case that the historical bytecode file of the historical version exists in the local file, the historical bytecode file is deleted, so that the storage space of the local file is saved, and a case that a bytecode file calling error possibly occurs due to the existence of multiple versions of bytecode files is reduced.
In an optional implementation manner, referring to fig. 2, in step 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 specifically includes the following processes:
s1031: and acquiring the function identification of the target function in the function calling request.
In this embodiment of the present disclosure, first, a function identifier of a target function is obtained based on the function call request, where the function identifier may be a function id of the target function.
S1032: acquiring a target mapping file; the target mapping file comprises a mapping relation between a function identifier and a byte code identifier of a specified function of the Flutter application, and the byte code identifier is used for indicating whether a corresponding byte code file exists in the corresponding specified function.
In this embodiment of the present disclosure, a target mapping file may be established for the Flutter application. Here, the target mapping file may include a mapping table, where the mapping table is used to indicate a mapping relationship between a function identifier and a bytecode identifier of a specific function in the Flutter application.
Here, the mapping relationship in the mapping table is updated in real time, and in a specific implementation, after receiving a bytecode file sent by a server, the bytecode identifier of the bytecode file may be acquired, and a specific function corresponding to the bytecode may be determined according to the bytecode identifier, and then, the mapping relationship of the specific function may be updated in the mapping table based on the bytecode identifier. In addition, the mapping table may further include a specified location in the local file where the bytecode file is stored, so as to facilitate direct search of the bytecode file.
In this disclosure, after the function identifier of the target function is obtained, the mapping table may be obtained, and whether the target function has a corresponding mapping relationship is searched in the mapping table according to the function identifier of the target function.
S1033: and searching target mapping data corresponding to the function identifier of the target function in the target mapping file, and searching the target bytecode file of the target function in the specified position of the local file under the condition that the target bytecode file of the target function is determined to exist in the local file based on the target mapping data.
In the embodiment of the present disclosure, first, target mapping data corresponding to a function identifier of a target function may be determined, and a mapping relationship corresponding to the target function may be determined based on the target mapping data.
In specific implementation, whether the target function has a corresponding mapping relationship may be determined based on the target mapping data, where whether the target function has a corresponding mapping relationship may be determined based on the mapping relationship identifier. And when the mapping relation identifier corresponding to the target function is 1, determining that the target function has a corresponding mapping relation, and when the mapping relation identifier corresponding to the target function is 0, determining that the target function does not have a corresponding mapping relation.
After determining that the target function has no corresponding mapping relationship, it may be determined that the target function has no corresponding target bytecode file. In addition, after the mapping relationship corresponding to the target function is determined, the target bytecode file corresponding to the target function can be determined, then, the specified position of the local file storing the target bytecode file can be determined based on the target mapping data, and the target bytecode file can be searched based on the specified position.
According to the above description, after the function call request for the target function is detected, the target mapping data corresponding to the target function can be searched based on the target mapping file, and the target bytecode file corresponding to the target function is searched according to the target mapping data, so that the efficiency of searching the target bytecode file is improved, and the response speed of the device is improved.
In an optional implementation manner, in step S103, searching a target bytecode file of the target function in a local file of the Flutter application based on the detected function call request, further includes the following process:
(1) determining the version identification of the target function required to be called at the current moment based on the function calling request under the condition that the byte code files of the multiple versions of the target function are found in the local file;
(2) and determining the byte code file matched with the version identification in the byte code files of the plurality of versions as a target byte code file of the target function.
In this embodiment of the present disclosure, when the target function has undergone multiple version updates and/or function repairs of the Flutter application, the Flutter application receives the corresponding bytecode file after each version update or function repair, and therefore, the target function may include multiple versions of bytecode files in the local file.
When the bytecode files of multiple versions of the target function are found in the local file, the version identifier of the target function called by the function call request needs to be determined first, where the version identifier may be used to indicate the version update time of the corresponding target function.
In an alternative embodiment, the version id of the target function called by the function call request defaults to the version id corresponding to the latest version update, for example, the version update times indicated by the version ids of the multiple versions corresponding to the target function are 2021.12.3, 2021.12.31, and 2022.2.1, respectively, so that the version update time indicated by the version id of the target function called by the function call request may be 2022.2.1.
In another optional implementation, the version identifier of the target function called by the function calling request may also be directional, and may indicate the version identifier of any version of all versions corresponding to the target function.
In specific implementation, before calling the target function, the user may select a target version to be called from the multiple versions corresponding to the target function, and initiate a function calling request for the target version. Therefore, after the version identifier of the target function called by the function calling request is determined, the bytecode file matched with the version identifier can be determined as the target bytecode file in the plurality of versions of bytecode files.
In addition, under the condition that the bytecode files of the multiple versions corresponding to the target function contain the failed bytecode file, whether the target bytecode file called by the function calling request is valid or not can be preferentially judged, so that version conflict between the target bytecode file and the Flutter application caused by running the failed bytecode file is avoided. Here, the determining of the invalid byte code file may be performed by a developer, and after the determining of the invalid byte code file, a disabling instruction may be sent to the Flutter application by the server, so that the Flutter application determines the byte code file indicated by the disabling instruction as the invalid byte code file based on the disabling instruction.
According to the description, under the condition that the target function corresponds to the byte code files of the plurality of versions, the target byte code file to be called can be determined through the function calling request, so that the user can select the version to be operated by himself, and the operation experience of the user is improved.
In an optional embodiment, the method further includes the following steps:
(1) under the condition that the target byte code file of the target function is not found, acquiring a historical downloading record of the FLUTTER application in a preset time period; the historical download record is used for indicating that the Flutter applies the byte code file of the corresponding function obtained from the server within a preset time period;
(2) sending an acquisition request to the server under the condition that the historical download record of the target bytecode file of the target function is determined to be contained in the historical download record;
(3) and acquiring the target byte code file returned by the server based on the acquisition request, and operating the target byte code file.
In an optional implementation manner, after the target bytecode file sent by the server is acquired, the target bytecode file may not be saved due to a problem of storage failure, or after the target bytecode file is saved, the target bytecode file is mistakenly deleted due to reasons such as cleaning up a storage space, and at this time, the target bytecode file with the target function not found may occur, but there is a history download record of the target bytecode file.
Here, when the historical download record of the target bytecode file including the target function in the historical download record is determined, the function identifier of the target function may be determined, the acquisition request of the target bytecode file may be generated based on the function identifier, and the target bytecode file returned by the server based on the acquisition request may be acquired.
In another optional implementation manner, in the case that the target bytecode file of the target function is not found, an acquisition request of the target bytecode file may be generated directly based on the function identifier of the target function, and after receiving the acquisition request, the server may determine whether the target function has a corresponding target bytecode file, and if so, the target bytecode file may be sent to the Flutter application, so that the reliability of calling the target bytecode file by the function calling request is improved.
According to the above description, under the condition that the target bytecode file of the target function is not found, whether the target function corresponds to the target bytecode file can be determined through the history download record, so that the problem that the target bytecode file cannot be called by the function call request when the target bytecode file is deleted from the local file by mistake is avoided.
In an optional embodiment, the method further comprises the process of:
and under the condition that the target byte code file of the target function is not found, finding the AOT compiled file of the target function in the local file, and operating the AOT compiled file.
It should be noted that the compiled product obtained when the Flutter application is constructed is an AOT compiled file, the AOT compiled file is a binary code related to a processor type, and specifically, the Flutter application may be compiled by a Dart compiler. In addition, in the process of compiling the specified function of the Flutter application to repair the functional defect of the specified function, an intermediate compilation product may be produced: the byte code file can be sent to the Flutter application so that the Flutter application can operate the byte code file, and therefore the effect of repairing the functional defects of the specified functions is achieved.
Therefore, in the embodiment of the present disclosure, in the case that the target bytecode file of the target function is not found, the AOT compiled file of the target function in the local file may be obtained, and the target function is implemented by running the AOT compiled file.
As can be seen from the above description, under the condition that the target bytecode file of the target function is not found, the AOT compiled file of the target function can also be run, so that the target function can run smoothly.
In an optional embodiment, the operating the target bytecode file of the target function to implement the target function after repairing the corresponding functional defect includes the following steps:
(1) calling a Dart virtual machine in the Flutter application;
(2) and loading the target byte code file to the Dart virtual machine so as to run the target byte code file of the target function through a byte code interpreter in the Dart virtual machine, so as to realize the target function after repairing the corresponding functional defect.
In this disclosure, after the target bytecode of the target function is acquired, the virtual machine may be called, where the Flutter application is constructed based on a Dart language, and the virtual machine may be a Dart virtual machine, where the Dart virtual machine is a virtual machine that provides an execution environment for the Dart language.
In specific implementation, the target bytecode may be loaded into a Dart virtual machine to implement a bytecode interpreter function through the Dart virtual machine, so as to operate the target bytecode and implement the target function.
As can be seen from the above description, the target bytecode file of the target function can be run by loading the target bytecode file of the target function into the Dart virtual machine, so as to implement the target function after repairing the corresponding functional defect.
In an optional implementation manner, referring to fig. 3, a flowchart of another method for repairing an application provided in an embodiment of the present disclosure is applied to a server, where the method includes steps S301 to S305, where:
s301: and determining a target repair code of a function to be repaired in the Flutter application.
In the embodiment of the present disclosure, after determining the function to be repaired in the Flutter application, a technician may write a target repair code for the function to be repaired, where the target repair code may be used to repair a functional defect corresponding to the function to be repaired. Here, the function to be repaired is the target function.
S303: compiling the target repair code, and generating a target byte code file with the function to be repaired based on a target intermediate compilation product in the compiling process.
In the embodiment of the present disclosure, after determining the target repair code of the function to be repaired in the Flutter application, the target repair code may 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 an intermediate compilation product in the compilation process, and generate an object bytecode file of a function to be repaired based on the intermediate compilation product.
S305: and sending the target byte code file to the Flutter application so that the Flutter application runs the target byte code file based on the method corresponding to the above-mentioned fig. 1.
In this disclosure, after determining the target bytecode file, the target bytecode file may be sent to a Flutter application, so that the Flutter application runs the target bytecode file.
In specific implementation, multiple sending modes can be set when the target bytecode file is sent to the Flutter application. For example, a real-time sending mode may be adopted, and after the target byte code file is determined, the target byte code may be sent to the Flutter application; or a timing transmission mode may be adopted, where the specific transmission time may be determined based on the version update time of the Flutter application.
As can be seen from the above description, in the embodiment of the present disclosure, a function call request for a target function in a Flutter application is first detected, a target bytecode file of the target function is searched in a local file of the Flutter application based on the function call request, and the target bytecode file can be run under the condition that the target bytecode file is found, so as to implement execution of the target function after repairing the corresponding function defect, thereby shortening a flow of repairing the function defect of the Flutter application, improving repair efficiency, and further improving user experience.
In an optional embodiment, the method further comprises the process of:
(1) receiving an acquisition request sent by the Flutter application, and determining a function to be repaired corresponding to the acquisition request;
(2) and acquiring a target byte code file corresponding to the function to be repaired, and transmitting the target byte code file to the Flutter application.
In this disclosure, the Flutter application may determine, based on the function call request for the target function, a target bytecode that needs to be called, generate an acquisition request for the target bytecode based on the function identifier of the target function, and send the acquisition request to the server.
After the server acquires the acquisition request, the server can determine the corresponding function to be repaired based on the function identifier carried by the acquisition request, and acquire the target bytecode file corresponding to the function to be repaired.
In addition, under the condition that the function to be repaired corresponds to multiple versions of bytecode files, a target bytecode file can be determined from the multiple versions of bytecode files, and specifically, the target bytecode file corresponding to the function to be repaired is obtained, which includes the following processes:
(1) acquiring byte code files of each version corresponding to the function to be repaired;
(2) determining byte code files matched with the acquisition request in the byte code files of the versions as target byte code files; and the obtaining request carries the version identification of the function to be repaired requested to be called.
In this embodiment of the present disclosure, the 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.
Before sending an obtaining request corresponding to a function to be repaired to a server through the Flutter application, a user may select a version identifier of a version to which a target bytecode file that the user wants to obtain belongs, and then may generate an obtaining request based on the version identifier and send the obtaining request to the server.
After receiving the acquisition request, the server may first acquire a function identifier carried by the acquisition request to determine a function to be repaired, and acquire bytecode files of each version in an update file corresponding to the function to be repaired.
After the bytecode files of the versions are acquired, the version identification of the function to be repaired carried in the acquisition request can be determined, matching operation is performed on the bytecode files of the versions contained in the update file according to the version identification, and the bytecode file matched with the version identification is determined as a target bytecode file.
According to the description, under the condition that the function to be repaired corresponds to the byte code files of the multiple versions, the target byte code file can be determined based on the version identification carried by the acquisition request, so that the user can flexibly select the version of the target byte code file to be acquired through the acquisition request, and the use experience of the user is improved.
Referring to fig. 4, a flowchart of a method for repairing an application according to an embodiment of the present disclosure is shown, where the method includes steps S401 to S105, where:
s401: detecting a function call request for a target function in the Flutter application.
In the embodiment of the disclosure, when using the Flutter application, a user may call a target function in the Flutter application through a function call request, so as to implement the target function of the Flutter application. For example, in the case where the target function is an applet in the Flutter application, after a call operation for the applet is detected, the applet may be determined as the target function, and a function call request for the target function may be determined to be detected.
S402: judging whether the target function has a target byte code file in a local file, if so, executing S403; if not, go to S404.
In this disclosure, first, a local file applied by the Flutter needs to be queried, and whether the local file includes a target bytecode file corresponding to the target function is determined. It should be noted that, under the condition that the target function has a functional defect, a technician may write a repair code for repairing the functional defect corresponding to the target function, generate a corresponding target bytecode file based on the repair code, and then send the target bytecode file to the Flutter application. Therefore, before the target function of the Flutter application is run, the target bytecode file of the target function needs to be first searched in the local file of the Flutter application.
In specific implementation, the target bytecode file of the target function may be searched in several ways in the embodiment corresponding to fig. 1, which is not described herein again.
S403: and operating the target byte code file of the target function to realize the target function after the corresponding functional defect is repaired.
In the embodiment of the present disclosure, when the target bytecode file of the target function is found, the target function can be implemented by running the target bytecode file. In specific implementation, the target bytecode may be loaded into a virtual machine, and the virtual machine implements a function of a bytecode interpreter to operate the target bytecode, thereby implementing the target function.
S404: and searching the AOT compiled file of the target function in the local file, and operating the AOT compiled file to realize the execution of the target function.
In this embodiment of the present disclosure, an interaction process between the Flutter application and the server is as shown in fig. 5, where the Flutter application includes n designated functions, and each designated function corresponds to an AOT compiled file in a local file. When the target function does not contain the target bytecode file in the local file, the AOT compiled file of the target function in the local file can be run to implement the target function.
In addition, when the designated function 3 in the Flutter application needs to be repaired, the target bytecode file corresponding to the designated function 3 sent by the server may be acquired and stored in the designated location.
In an optional embodiment, in the process of constructing the Flutter application, the following process is further included:
(1) acquiring a plurality of specified functions contained in the Flutter application, and acquiring a Dart code file corresponding to each specified function;
determining a byte code file judgment program; the bytecode judging program is used for judging whether the specified function has a corresponding bytecode file in the local file after detecting a function calling request aiming at the corresponding specified function;
(2) performing instrumentation operation for each Dart code file based on the byte code file judgment program; wherein the instrumentation is to insert the bytecode file judgment program at a designated location of each Dart code file.
In the embodiment of the disclosure, in the process of constructing the Flutter application, the Flutter application may be first divided into a plurality of designated functions, and each designated function of the Flutter application is respectively developed, so as to obtain a Dart code file corresponding to each designated function.
Here, the byte code file judgment program may be written in a designated location of the Dart code file in the process of writing the Dart code file corresponding to each designated function. In addition, after the Dart code file corresponding to each designated function is obtained, the bytecode file judgment program can be inserted into the designated position of each Dart code file through instrumentation operation, and the specific time for inserting the bytecode file judgment program is not limited in the present disclosure.
As can be seen from the above description, in a manner of inserting a bytecode file determination program into a Dart code file corresponding to each specified function, after the Flutter application detects a function call request for a target function, the bytecode file determination program in the target function searches whether a target bytecode file exists in a local file of the Flutter application.
In summary, in the embodiment of the present disclosure, a function call request for a target function in a Flutter application is first detected, a target bytecode file of the target function is searched in a local file of the Flutter application based on the function call request, and the target bytecode file can be run under the condition that the target bytecode file is found, so as to implement execution of the target function after repairing the corresponding function defect, thereby shortening a process of repairing the function defect of the Flutter application, improving repair efficiency, and further improving user experience.
It will be understood by those skilled in the art that in the method of the present invention, the order of writing the steps does not imply a strict order of execution and any limitations on the implementation, and the specific order of execution of the steps should be determined by their function and possible inherent logic.
Based on the same inventive concept, the embodiment of the present disclosure further provides a device for repairing an application program corresponding to the method for repairing an application program, and since the principle of solving the problem of the device in the embodiment of the present disclosure is similar to the method for repairing an application program in the embodiment of the present disclosure, the implementation of the device may refer to the implementation of the method, and repeated details are not described again.
Referring to fig. 6, a schematic diagram of a device for repairing an application according to an embodiment of the present disclosure is shown, where the device includes: the detection unit 61, the search unit 62 and the operation unit 63; wherein the content of the first and second substances,
a detecting unit 61, configured to detect a function call request for a target function in the Flutter application;
a searching unit 62, configured to search, based on the detected function call request, a target bytecode file of the target function in a local file of the Flutter application; wherein the target bytecode file contains a bytecode for repairing a corresponding functional defect of the target function;
and the running unit 63 is configured to run the target bytecode file of the target function under the condition that the target bytecode file of the target function is found, so as to implement the target function after repairing the corresponding functional defect.
In the embodiment of the disclosure, a function call request for a target function in the Flutter application is detected first, a target bytecode file of the target function is searched in a local file of the Flutter application based on the function call request, and the target bytecode file can be run under the condition that the target bytecode file is found, so that the target function after the corresponding functional defect is repaired is implemented, thereby shortening the process of repairing the functional defect of the Flutter application, improving the repair efficiency, and further improving the use experience of a user.
In a possible implementation, the search unit 62 is further configured to:
acquiring a function identifier of the target function in the function calling request;
acquiring a target mapping file; the target mapping file comprises a mapping relation between a function identifier and a byte code identifier of a specified function of the Flutter application, wherein the byte code identifier is used for indicating whether a corresponding byte code file exists in the corresponding specified function;
and searching target mapping data corresponding to the function identifier of the target function in the target mapping file, and searching the target bytecode file of the target function in the specified position of the local file under the condition that the target bytecode file of the target function is determined to exist in the local file based on the target mapping data.
In one possible embodiment, the apparatus is further configured to:
under the condition that the target byte code file of the target function is not found, acquiring a historical downloading record of the FLUTTER application in a preset time period; the historical download record is used for indicating that the Flutter applies the byte code file of the corresponding function obtained from the server within a preset time period;
under the condition that the historical download record of the target byte code file of the target function is determined to be contained in the historical download record, sending an acquisition request to the server;
and acquiring the target bytecode file returned by the server based on the acquisition request, and operating the target bytecode file.
In one possible embodiment, the apparatus is further configured to:
and under the condition that the target byte code file of the target function is not found, finding the AOT compiled file of the target function in the local file, and operating the AOT compiled file.
In a possible implementation, the search unit 62 is further configured to:
under the condition that the bytecode files of the multiple versions of the target function are found in the local file, determining the version identification of the target function to be called at the current moment based on the function calling request;
and determining the byte code file matched with the version identification in the byte code files of the plurality of versions as a target byte code file of the target function.
In one possible embodiment, the apparatus is further configured to:
after detecting a function call request for a target function in the Flutter application, acquiring a target bytecode file of the target function sent by a server;
and storing the target byte code file of the target function in the appointed storage position of the local file.
In one possible embodiment, the apparatus is further configured to:
searching a historical byte code file of the target function in the local file;
and under the condition that the historical byte code file is found, deleting the historical byte code file, and storing the target byte code file in a specified storage position of the local file.
In a possible embodiment, the operation unit 63 is further configured to:
calling a Dart virtual machine in the Flutter application;
and loading the target bytecode file to the Dart virtual machine, so as to run the target bytecode file of the target function through a bytecode interpreter in the Dart virtual machine, thereby implementing the target function after repairing the corresponding functional defect.
Referring to fig. 7, a schematic diagram of a device for repairing an application according to another embodiment of the present disclosure is shown, where the device includes: a determination unit 71, a compiling unit 72, a transmission unit 73; wherein the content of the first and second substances,
a determining unit 71, configured to determine a target repair code of a function to be repaired in the Flutter application;
a compiling unit 72, configured to compile the target repair code, and generate a target bytecode file of the function to be repaired based on a target intermediate compilation product in the compiling process;
a sending unit 73, 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 fig. 1.
In one possible embodiment, the apparatus is further configured to:
receiving an acquisition request sent by the Flutter application, and determining a function to be repaired corresponding to the acquisition request;
and acquiring a target byte code file corresponding to the function to be repaired, and transmitting the target byte code file to the Flutter application.
In one possible embodiment, the apparatus is further configured to:
acquiring byte code files of each version corresponding to the function to be repaired;
determining byte code files matched with the acquisition request in the byte code files of the versions as the target byte code files; and the obtaining request carries the version identification of the function to be repaired requested to be called.
The description of the processing flow of each unit in the device and the interaction flow between the units may refer to the related description in the above method embodiments, and will not be described in detail here.
Corresponding to the method for repairing the application program in fig. 1, an embodiment of the present disclosure further provides a computer device 800, and as shown in fig. 8, a schematic structural diagram of the computer device 800 provided in the embodiment of the present disclosure includes:
a processor 81, a memory 82, and a bus 83; the memory 82 is used for storing execution instructions and includes a memory 821 and an external memory 822; the memory 821 herein is also referred to as an internal memory, and is configured to temporarily store operation data in the processor 81 and data exchanged with the external memory 822 such as a hard disk, the processor 81 exchanges data with the external memory 822 through the memory 821, and when the computer apparatus 800 operates, the processor 81 communicates with the memory 82 through the bus 83, so that the processor 81 executes the following instructions:
detecting a function call request aiming at a target function in the Flutter application;
searching a target byte code file of the target function in a local file of the Flutter application based on the detected function calling request; wherein the target bytecode file contains a bytecode for repairing a corresponding functional defect of the target function;
and under the condition that the target bytecode file of the target function is found, operating the target bytecode file of the target function to realize executing the target function after repairing the corresponding functional defect.
Corresponding to the method for repairing the application program in fig. 3, an embodiment of the present disclosure further provides another computer device 900, as shown in fig. 9, a schematic structural diagram of the computer device 900 provided in the embodiment of the present disclosure includes:
a processor 91, a memory 92, and a bus 93; the memory 92 is used for storing execution instructions and includes a memory 921 and an external memory 922; here, the memory 921 is also referred to as an internal memory, and is configured to temporarily store operation data in the processor 91 and data exchanged with an external memory 922 such as a hard disk, the processor 91 exchanges data with the external memory 922 through the memory 921, and when the computer apparatus 900 operates, the processor 91 communicates with the memory 92 through the bus 93, so that the processor 91 executes the following instructions:
determining a target repair code of a function to be repaired in the Flutter application;
compiling the target repair code, and generating a target byte code file of the function to be repaired based on a target intermediate compilation product in the compiling process;
and sending the target byte code file to the Flutter application so that the Flutter application runs the target byte code file based on the method corresponding to the above-mentioned fig. 1.
The embodiments of the present disclosure also provide a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program performs the steps of the method for repairing an application program in the above method embodiments. The storage medium may be a volatile or non-volatile computer-readable storage medium.
An embodiment of the present disclosure further provides a computer program product, where the computer program product carries a program code, and an instruction included in the program code may be used to execute the step of the method for repairing an application program in the foregoing method embodiment.
The computer program product may be implemented by hardware, software or a combination thereof. In an alternative embodiment, the computer program product is embodied in a computer storage medium, and in another alternative embodiment, the computer program product is embodied in a Software product, such as a Software Development Kit (SDK), or the like.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the system and the apparatus described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again. In the several embodiments provided in the present disclosure, it should be understood that the disclosed system, apparatus, and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present disclosure may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such understanding, the technical solution of the present disclosure may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present disclosure. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
Finally, it should be noted that: the above-mentioned embodiments are merely specific embodiments of the present disclosure, which are used for illustrating the technical solutions of the present disclosure and not for limiting the same, and the scope of the present disclosure is not limited thereto, and although the present disclosure is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive of the technical solutions described in the foregoing embodiments or equivalent technical features thereof within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the embodiments of the present disclosure, and should be construed as being included therein. Therefore, the protection scope of the present disclosure shall be subject to the protection scope of the claims.

Claims (15)

1. A method for repairing an application program is applied to a Flutter application, and comprises the following steps:
detecting a function call request aiming at a target function in the Flutter application;
searching a target byte code file of the target function in a local file of the Flutter application based on the detected function calling request; wherein the target bytecode file contains a bytecode for repairing a corresponding functional defect of the target function;
and under the condition that the target bytecode file of the target function is found, operating the target bytecode file of the target function to realize executing the target function after repairing the corresponding functional defect.
2. The method according to claim 1, wherein the finding a target bytecode file of the target function in a local file of the Flutter application based on the detected function call request comprises:
acquiring a function identifier of the target function in the function calling request;
acquiring a target mapping file; the target mapping file comprises a mapping relation between a function identifier and a byte code identifier of a specified function of the Flutter application, wherein the byte code identifier is used for indicating whether a corresponding byte code file exists in the corresponding specified function;
and searching target mapping data corresponding to the function identifier of the target function in the target mapping file, and searching the target bytecode file of the target function in the specified position of the local file under the condition that the target bytecode file of the target function is determined to exist in the local file based on the target mapping data.
3. The method of claim 1, further comprising:
under the condition that the target byte code file of the target function is not found, acquiring a historical downloading record of the FLUTTER application in a preset time period; the historical download record is used for indicating that the Flutter applies the byte code file of the corresponding function obtained from the server within a preset time period;
under the condition that the historical download record of the target byte code file of the target function is determined to be contained in the historical download record, sending an acquisition request to the server;
and acquiring the target bytecode file returned by the server based on the acquisition request, and operating the target bytecode file.
4. The method of claim 1, further comprising:
and under the condition that the target byte code file of the target function is not found, finding the AOT compiled file of the target function in the local file, and operating the AOT compiled file.
5. The method according to claim 1, wherein said finding a target bytecode file of the target function in a local file of the Flutter application based on the detected function call request comprises:
under the condition that the bytecode files of the multiple versions of the target function are found in the local file, determining the version identification of the target function to be called at the current moment based on the function calling request;
and determining the byte code file matched with the version identification in the byte code files of the plurality of versions as a target byte code file of the target function.
6. The method of claim 1, further comprising:
after detecting a function call request for a target function in the Flutter application, acquiring a target bytecode file of the target function sent by a server;
and storing the target byte code file of the target function in the appointed storage position of the local file.
7. The method of claim 6, wherein saving the target bytecode file of the target function in a specified storage location of the local file comprises:
searching a historical byte code file of the target function in the local file;
and under the condition that the historical byte code file is found, deleting the historical byte code file, and storing the target byte code file in a specified storage position of the local file.
8. The method of claim 1, wherein the running the target bytecode file of the target function to implement the target function after performing the repairing of the corresponding functional defect comprises:
calling a Dart virtual machine in the Flutter application;
and loading the target bytecode file to the Dart virtual machine, so as to run the target bytecode file of the target function through a bytecode interpreter in the Dart virtual machine, thereby implementing the target function after repairing the corresponding functional defect.
9. The method for repairing the application program is applied to a server and comprises the following steps:
determining a target repair code of a function to be repaired in the Flutter application;
compiling the target repair code, and generating a target byte code file of the function to be repaired based on a target intermediate compilation product in the compiling process;
sending the target bytecode file to the Flutter application, so that the Flutter application runs the target bytecode file based on the method of any of the preceding claims 1 to 8.
10. The method of claim 9, further comprising:
receiving an acquisition request sent by the Flutter application, and determining a function to be repaired corresponding to the acquisition request;
and acquiring a target byte code file corresponding to the function to be repaired, and transmitting the target byte code file to the Flutter application.
11. The method according to claim 10, wherein the obtaining the target bytecode file corresponding to the function to be repaired includes:
acquiring byte code files of each version corresponding to the function to be repaired;
determining byte code files matched with the acquisition request in the byte code files of the versions as the target byte code files; and the obtaining request carries the version identification of the function to be repaired requested to be called.
12. An apparatus for repairing an application program, applied to a Flutter application, comprising:
a detecting unit, configured to detect a function call request for a target function in the Flutter application;
the searching unit is used for searching a target byte code file of the target function in a local file of the Flutter application based on the detected function calling request; wherein the target bytecode file contains a bytecode for repairing a corresponding functional defect of the target function;
and the operation unit is used for operating the target bytecode file of the target function under the condition that the target bytecode file of the target function is found so as to realize the execution of the target function after the corresponding functional defect is repaired.
13. An application program recovery device applied to a server includes:
the device comprises a determining unit, a judging unit and a judging unit, wherein the determining unit is used for determining a target repair code of a function to be repaired in the Flutter application;
the compiling unit is used for compiling the target repair code and generating a target byte code file of the function to be repaired based on a target intermediate compiling product in the compiling process;
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 of any of the above claims 1 to 8.
14. A computer device, comprising: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, the processor and the memory communicating via the bus when a computer device is running, the machine-readable instructions when executed by the processor performing the steps of the application repair method according to any one of claims 1 to 11.
15. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, carries out the steps of the application program healing method according to any one of claims 1 to 11.
CN202210240370.7A 2022-03-10 2022-03-10 Application program repairing method and device, computer equipment and storage medium Active CN114610516B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202210240370.7A CN114610516B (en) 2022-03-10 2022-03-10 Application program repairing method and device, computer equipment and storage medium
PCT/CN2023/076115 WO2023169164A1 (en) 2022-03-10 2023-02-15 Method and apparatus for restoring application program, and computer device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210240370.7A CN114610516B (en) 2022-03-10 2022-03-10 Application program repairing method and device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114610516A true CN114610516A (en) 2022-06-10
CN114610516B CN114610516B (en) 2023-07-04

Family

ID=81862110

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210240370.7A Active CN114610516B (en) 2022-03-10 2022-03-10 Application program repairing method and device, computer equipment and storage medium

Country Status (2)

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

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023169164A1 (en) * 2022-03-10 2023-09-14 北京字节跳动网络技术有限公司 Method and apparatus for restoring application program, and computer device and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106843947A (en) * 2017-01-04 2017-06-13 腾讯科技(深圳)有限公司 The treating method and apparatus of aacode defect
CN109445807A (en) * 2017-08-28 2019-03-08 腾讯科技(深圳)有限公司 Realize the method, apparatus and computer readable storage medium of application program update
CN110471693A (en) * 2019-08-21 2019-11-19 网易(杭州)网络有限公司 Application issued, operation method and equipment
CN111142922A (en) * 2018-11-02 2020-05-12 阿里巴巴集团控股有限公司 Application program updating method and device, terminal and server
CN113918195A (en) * 2021-11-19 2022-01-11 中电金信软件有限公司 Application interface updating method and device, electronic equipment and readable storage medium
CN114116509A (en) * 2021-12-02 2022-03-01 建信金融科技有限责任公司 Program analysis method, program analysis device, electronic device, and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11347498B2 (en) * 2013-02-26 2022-05-31 Red Hat, Inc. Bytecode modification
CN108089870B (en) * 2016-11-21 2022-01-21 百度在线网络技术(北京)有限公司 Method and apparatus for repairing applications
CN114610516B (en) * 2022-03-10 2023-07-04 抖音视界有限公司 Application program repairing method and device, computer equipment and storage medium
CN114706586A (en) * 2022-03-11 2022-07-05 北京字节跳动网络技术有限公司 Code compiling method, code running method, code compiling device, code running device, computer equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106843947A (en) * 2017-01-04 2017-06-13 腾讯科技(深圳)有限公司 The treating method and apparatus of aacode defect
CN109445807A (en) * 2017-08-28 2019-03-08 腾讯科技(深圳)有限公司 Realize the method, apparatus and computer readable storage medium of application program update
CN111142922A (en) * 2018-11-02 2020-05-12 阿里巴巴集团控股有限公司 Application program updating method and device, terminal and server
CN110471693A (en) * 2019-08-21 2019-11-19 网易(杭州)网络有限公司 Application issued, operation method and equipment
CN113918195A (en) * 2021-11-19 2022-01-11 中电金信软件有限公司 Application interface updating method and device, electronic equipment and readable storage medium
CN114116509A (en) * 2021-12-02 2022-03-01 建信金融科技有限责任公司 Program analysis method, program analysis device, electronic device, and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023169164A1 (en) * 2022-03-10 2023-09-14 北京字节跳动网络技术有限公司 Method and apparatus for restoring application program, and computer device and storage medium

Also Published As

Publication number Publication date
CN114610516B (en) 2023-07-04
WO2023169164A1 (en) 2023-09-14

Similar Documents

Publication Publication Date Title
CN105677415B (en) Hot update method and device
US10019256B2 (en) Systems and methods for incremental software development
CN107193607B (en) Method and apparatus for updating code file, storage medium, processor, and terminal
EP0718764A2 (en) Bytecode program interpreter apparatus and method with pre-verification of data type restrictions
CN112015491B (en) Method, device and computer storage medium for realizing function jump
CN110442371B (en) Method, device and medium for releasing codes and computer equipment
CN105183760A (en) Webpage component loading method and apparatus
US11842188B2 (en) Continuous integration and deployment pipeline selection based on dynamic mapping
US20130185602A1 (en) Heap dump occurrence detection
CN111679852B (en) Detection method and device for conflict dependency library
CN112099880A (en) Method and system for reducing application program driven by scene
CN107463485B (en) Method stack-based log acquisition method and device and terminal
CN114610516B (en) Application program repairing method and device, computer equipment and storage medium
CN115268879A (en) Code processing method and device, electronic equipment and storage medium
US9841982B2 (en) Locating import class files at alternate locations than specified in classpath information
CN116775061A (en) Deployment method, device, equipment and storage medium of micro-service application
CN109426546B (en) Application starting method and device, computer storage medium and equipment
CN113791809B (en) Application exception handling method and device and computer readable storage medium
CN114706586A (en) Code compiling method, code running method, code compiling device, code running device, computer equipment and storage medium
CN110737438A (en) data processing method and device
CN112579156A (en) Processing system, processing method, processing device and processing equipment of business event
CN113900729A (en) Tracking equipment parameter configuration method and device of SteamVR system
CN113326046A (en) Method and device for acquiring compiling time length
CN112947991A (en) Method and device for acquiring version difference code file, computer equipment and medium
CN113031956A (en) Program compiling method and device and program running method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant after: Tiktok vision (Beijing) Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant before: BEIJING BYTEDANCE NETWORK TECHNOLOGY Co.,Ltd.

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant after: Douyin Vision Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant before: Tiktok vision (Beijing) Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant