WO2023179298A1 - Application program updating method and apparatus, application program development method and apparatus, and computer device - Google Patents

Application program updating method and apparatus, application program development method and apparatus, and computer device Download PDF

Info

Publication number
WO2023179298A1
WO2023179298A1 PCT/CN2023/078022 CN2023078022W WO2023179298A1 WO 2023179298 A1 WO2023179298 A1 WO 2023179298A1 CN 2023078022 W CN2023078022 W CN 2023078022W WO 2023179298 A1 WO2023179298 A1 WO 2023179298A1
Authority
WO
WIPO (PCT)
Prior art keywords
target
function
target function
application
flutter
Prior art date
Application number
PCT/CN2023/078022
Other languages
French (fr)
Chinese (zh)
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 WO2023179298A1 publication Critical patent/WO2023179298A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/656Updates while running
    • 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
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/658Incremental updates; Differential updates
    • 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/451Execution arrangements for user interfaces

Definitions

  • the present disclosure relates to the field of computer technology, and specifically to an application program update, application program development method, device and computer equipment.
  • Embodiments of the present disclosure at least provide an application program update, application program development method, device and computer equipment.
  • embodiments of the present disclosure provide an application update method, which is applied to Flutter applications with an interpreter installed, including:
  • the target bytecode file of the target function is run through the interpreter to display a page corresponding to the target function.
  • the method further includes:
  • Target modification flag for the target function; wherein the target modification flag is used to indicate that the target function is a new function;
  • the target modification tag is added to the mapping information, where the target mapping table is used to indicate whether each function of the Flutter application includes a corresponding bytecode file.
  • mapping information corresponding to the target function is determined based on the found function tag, and the mapping information is Find the target modification identifier of the target function in
  • the interpreter of the Flutter application is called, and the target bytecode file of the target function is run through the interpreter.
  • the method further includes:
  • the function information includes at least one of the following: function type information of the target function, update time of the target function, and effective time of the target function;
  • update prompt information of the target function Based on the function information, generate update prompt information of the target function; wherein the update prompt information is used to indicate that the user has received the bytecode file of the new function of the Flutter application;
  • the detected running instructions for the target function include:
  • the page corresponding to the target function is displayed on the display interface of the terminal device.
  • embodiments of the present disclosure provide an application development method, applied to a server, where the server includes a Dart compiler, including:
  • the target bytecode file is sent to the Flutter application, so that the Flutter application runs the target bytecode file through the interpreter.
  • obtaining the intermediate product corresponding to the compilation operation includes:
  • sending the target bytecode file to the Flutter application includes:
  • an embodiment of the present disclosure also provides a program updating device, including:
  • a receiving unit configured to receive an update resource package regarding the Flutter application sent by the server
  • a decompression unit configured to perform a decompression operation based on the updated resource package to obtain a target bytecode file of a target function in the Flutter application; the target function is a new function in the Flutter application;
  • An execution unit configured to run the target bytecode file of the target function through the interpreter to display the page corresponding to the target function when an execution instruction for the target function is detected.
  • embodiments of the present disclosure also provide an application development device, including:
  • a determination unit used to determine the Dart code of the function to be compiled in the Flutter application, and compile the Dart code through the Dart compiler;
  • An acquisition unit configured to acquire an intermediate product corresponding to the compilation operation, and generate a target bytecode file of the function to be compiled based on the intermediate product;
  • a sending unit configured to send the target bytecode file to the Flutter application, so that the Flutter application runs the target bytecode file through an interpreter.
  • 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.
  • embodiments of the present disclosure also provide a computer program product.
  • the computer program product includes program code.
  • the program code is executed by a processor, any one of the possible implementations of the first to second aspects can be implemented. steps in the way.
  • the update resource package of the Flutter application sent by the server can be decompressed to obtain the target bytecode of the target function. file, and then, when the running instruction for the target function is detected, the target bytecode file can be run through the interpreter to display the page corresponding to the target function, thus realizing the dynamic operation of the Flutter application. Update, shorten the update process and improve the update efficiency.
  • Figure 1 shows a flow chart of an application update method provided by an embodiment of the present disclosure
  • Figure 2 shows a flow chart of an application development method provided by an embodiment of the present disclosure
  • Figure 3 shows a flow chart of Dart code compilation by the Dart compiler provided by the embodiment of the present disclosure
  • Figure 4 shows a schematic diagram of the interaction between the server and the Flutter application provided by the embodiment of the present disclosure
  • Figure 5 shows a schematic diagram of an application updating device provided by an embodiment of the present disclosure
  • Figure 6 shows a schematic diagram of an application development device provided by an embodiment of the present disclosure
  • Figure 7 shows a schematic diagram of a computer device provided by an embodiment of the present disclosure
  • FIG. 8 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 update, application development method, device and computer equipment.
  • the updated resource package of the Flutter application sent by the server can first be decompressed to obtain the target bytecode file of the target function. Then, when the running instruction for the target function is detected, The target bytecode file is run through the interpreter to display the page corresponding to the target function, thereby realizing dynamic updates for the Flutter application, shortening the update process, and improving update efficiency.
  • the execution subject of the application update and application development method provided by this embodiment of the disclosure is generally: Computer equipment with certain computing capabilities.
  • the computer equipment includes, for example, terminal equipment or servers or other processing equipment.
  • the application updating and application development methods can be implemented by the processor calling computer readable instructions stored in the memory.
  • a flow chart of an application update method is provided according to an embodiment of the present disclosure.
  • the method includes steps S101 to S105, wherein:
  • S101 Receive an update resource package about the Flutter application sent by the server.
  • the updated resource package can be actively sent to the Flutter application, or in response to the Flutter application's acquisition request for the updated resource package, Send an update resource package to the Flutter application.
  • the server when the server responds to the Flutter application's request for obtaining the updated resource package and sends the updated resource package to the Flutter application, after detecting that the Flutter application is updated in the server, the Flutter application can ask the user whether it needs to obtain it. After the user determines to obtain the update resource package, the user can send a request for obtaining the update resource package to the server.
  • S103 Perform a decompression operation based on the updated resource package to obtain the target bytecode file of the target function in the Flutter application; the target function is a new function in the Flutter application.
  • the above-mentioned update resource package may be in SDK (Software Development Kit) format. Therefore, the Flutter application receives the After the resource package is updated, the updated resource package can be decompressed first to obtain a decompressed file, where the decompressed file can include a target bytecode file of the target function and/or a function tag of the target function.
  • SDK Software Development Kit
  • the target bytecode file can be stored in a local file.
  • a function entrance of the target function can be added to the existing function page of the Flutter application, where the function entrance can be The target function identifier of the target function.
  • a target function identifier of "short video” for example, short video button
  • the target bytecode file of the target function After detecting the trigger operation for the function entry, it can be determined that the running instruction for the above target function is detected. Then, you can get the target bytecode file of the target function and load the target bytecode file into the interpreter (for example, the Dart interpreter) to run the target bytecode file through the interpreter, thereby running The page corresponding to the target function is displayed on the display interface.
  • the interpreter for example, the Dart interpreter
  • the update resource package of the Flutter application sent by the server can be decompressed to obtain the target bytecode file of the target function, and then, after the operation instruction for the target function is detected,
  • the target bytecode file can be run through the interpreter to display the page corresponding to the target function, thereby realizing dynamic updates for the Flutter application, shortening the update process, and improving update efficiency.
  • the above method further includes the following process:
  • a target mapping table can be established for the Flutter application, where the target mapping table is used to indicate whether each function of the Flutter application includes a corresponding bytecode file. Therefore, after detecting the trigger operation for the specified function in the Flutter application, the target mapping table can be obtained, and based on the target mapping table, it is determined whether the specified function corresponds to the bytecode file, where the specified function corresponds to the bytecode In the case of a file, you can run the bytecode file.
  • the function tag of the target function can be added to the target mapping table, and mapping information corresponding to the target function can be established. Then, the target modification tag can be added to the mapping information.
  • mapping information is used to indicate the running file corresponding to the target function in the local file, where the running file can be a bytecode file or an AOT (Ahead Of Time) 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.
  • a target mapping table can be established for the Flutter application, and based on the obtained target bytecode of the target function, the mapping information of the target function is updated in the target mapping table, so that when the target function in the Flutter application is detected, After the specified function is triggered, the target mapping table can be obtained, and based on the target mapping table, it is determined whether the specified function corresponds to a bytecode file, which improves the efficiency of searching for bytecode files and the speed of device response.
  • step S105 when an execution instruction for the target function is detected, the target bytecode file of the target function is run through the interpreter to display the target function.
  • the page corresponding to the function specifically includes the following processes:
  • the target mapping table corresponding to the Flutter application can be obtained, and the function mark of the target function can be searched in the target mapping table.
  • the target mapping table can be traversed through a traversal instruction to obtain the function tag.
  • S1052 Determine the mapping information corresponding to the target function based on the found function tag, and search for the target modification identifier of the target function in the mapping information.
  • the target modification identifier when the target modification identifier is found, it can be determined that the target function has a corresponding target bytecode file. Next, based on the above mapping information, the target function corresponding to the target function can be determined. The storage location of the target bytecode file in the local file.
  • the target bytecode file After determining the storage location of the above target bytecode file in the local file, the target bytecode file can be found based on the storage location, and the target bytecode file can be run by calling the interpreter of the Flutter application.
  • the target bytecode file can be parsed first. After obtaining the parsing result, the runnable bytecode information in the target bytecode file can be obtained, where the runnable bytecode information can be It is the information indicated by the library, function, field and other fields in the target bytecode file.
  • the target mapping table of the Flutter application can be obtained, and the target bytecode file corresponding to the specified function is determined based on the target mapping table, improving This improves the efficiency of finding bytecode files and the speed of device response.
  • the above method further includes the following process:
  • the function information includes at least one of the following: function type information of the target function, update time of the target function, and effective time of the target function;
  • update prompt information for the target function; wherein the update prompt information is used to indicate that the user has received the bytecode file of the new function of the Flutter application;
  • the function information of the target function corresponding to the update resource package can be obtained.
  • the function type information of the target function can be used to characterize the function type of the target function, for example, shopping, gaming, reading, etc., where the function type information can also include function introduction information of the target function.
  • the update time of the above target function can be the time when the server sends the update resource package of the target function to the Flutter application.
  • the effective time of the above target function is used to indicate the effective start and end dates and end dates of the target function. For example, if the target function is a Christmas-limited event, then the effective date of the target function can be 2021.12.24-2021.12.31.
  • the update prompt information of the target function can be generated based on the above function information, and the update prompt information can be displayed on the display interface.
  • an update prompt window may be established, and the update prompt information may be displayed on the display interface of the terminal device through the update prompt window.
  • the above update prompt information may include at least part of the function information.
  • the function information of the target function can be determined, and the update prompt information of the target function can be generated based on the function information, so that the user can follow the update prompt
  • the information understands the basic information of the target function, which reduces the possibility of users missing updates of the target function and improves the user experience.
  • step S105 detects an operation instruction for the target function, which specifically includes the following process:
  • the update prompt window may also include query information, where the query information may be used to ask the user whether to jump to the page corresponding to the target function. After detecting the user's confirmation operation for the query information, it can be determined that the first trigger operation for the update prompt information is detected.
  • the page jump identifier of the page corresponding to the target function can be determined, wherein the page jump identifier can be the target page link of the page corresponding to the target function.
  • the function entrance can be indicated by the indicator in the page to which the function entrance belongs, so that the user triggers the function entrance and enters the page corresponding to the target function. , thereby making it easier for users to understand the access path to the target function.
  • the above-mentioned page jump identification can be the target page link of the page corresponding to the target function, and the user can trigger the page jump identification through the second triggering operation, thereby opening The page corresponding to the target function.
  • the page jump identification can be a page link to the page to which the function entrance belongs.
  • the function can be indicated by an indicator in the page to which the function entrance belongs. Entrance, so that the user can trigger the function entrance and enter the page corresponding to the target function, thereby making it easier for the user to understand the access path of the target function.
  • the user can open the page corresponding to the target function by updating the prompt window, thereby shortening the user's browsing path to a certain extent and making it easier for the user to experience the target function more quickly.
  • a flow chart of an application development method is provided according to an embodiment of the present disclosure.
  • the method includes steps S201 to S205, wherein:
  • S201 Determine the Dart code of the function to be compiled in the Flutter application, and compile the Dart code through the Dart compiler.
  • the function to be compiled can be the above-mentioned target function.
  • the resulting development product can be the above Dart code.
  • the Dart code can be compiled.
  • the Dart code can be loaded into the Dart compiler, so that the Dart code can be identified and compiled by the Dart compiler.
  • S203 Obtain the intermediate product corresponding to the compilation operation, and generate the function to be compiled based on the intermediate product.
  • the process of compiling Dart code by the Dart compiler is shown in Figure 3.
  • syntax analysis and lexical analysis can be performed on the Dart code to obtain an intermediate product.
  • the Dart code is The process of syntax analysis and lexical analysis is described below and will not be repeated here.
  • the final compiled product obtained is an AOT compiled file
  • the AOT compiled file is a binary related to the processor type. code.
  • the Flutter application described in the embodiment of the present disclosure is an application that can support the interpretation of the target bytecode file. Therefore, if the existing Flutter application cannot interpret the target bytecode file, it needs to be recompiled to obtain a new one.
  • a Flutter application that can interpret the target bytecode file. The specific compilation process is described as follows:
  • the target command line parameters where the target command line parameters are used to determine the Flutter engine for compiling Flutter applications.
  • Different Flutter engines can compile Flutter applications with different functions.
  • the Flutter application is compiled into an application that can support running the target bytecode file through the target command line parameters.
  • interpreter functions for example, add a Dart interpreter.
  • the interpreter for example, the Dart interpreter
  • the interpreter that compiles the Flutter application can be controlled through macros, so that the Flutter application can run the bytecode file through the interpreter at runtime.
  • S205 Send the target bytecode file to the Flutter application, so that the Flutter application runs the target bytecode file through the interpreter.
  • an updated resource package for the target bytecode file in response to the Flutter application's acquisition request for the target bytecode file, an updated resource package for the target bytecode file can be generated, and the updated resource package can be sent to the Flutter application.
  • the Flutter application obtains the updated resource package, it can use the above application update method to process the updated resource package. The specific processing will not be described in detail here, and is subject to the above embodiment.
  • the Dart code of the function to be compiled can first be obtained, and the Dart code can be compiled. Then, the target bytecode file can be generated based on the intermediate product of the compilation operation, and the target bytecode file can be generated. The target bytecode file is sent to the Flutter application, so that the target bytecode file in the Flutter application can be run, thereby realizing the function corresponding to the target bytecode file, thereby shortening the update process of the Flutter application and improving the efficiency of the Flutter application. Update efficiency.
  • step S203 obtaining the intermediate product corresponding to the compilation operation, specifically includes the following process:
  • the intermediate product can be obtained by performing syntax analysis and lexical analysis on the Dart code.
  • the dynamic link library file that is, the dill file
  • the dynamic link library file can be determined as an intermediate product.
  • the dynamic link library file can be an intermediate compiled file (ie: kernel product).
  • the above syntax analysis can be used to identify the word sequence of the Dart code, and separately analyze whether the word sequence of the Dart code conforms to the grammar of the Dart language.
  • the above lexical analysis can be used to identify characters in Dart code and analyze whether the characters in the Dart code meet the requirements of Dart code.
  • the Dart code can be modified so that the modified Dart code can be Compiles normally.
  • the Dart code After performing syntax analysis and lexical analysis on the above Dart code, the Dart code can be compiled to obtain the dynamic link library file (that is, the dill file) of the Dart code, and the dynamic link library file is determined as the intermediate product.
  • the dynamic link library file that is, the dill file
  • the dynamic link library file can be determined as an intermediate product, so that the above Dart compiler can compile the intermediate product and obtain the target word Section code file.
  • step S205 sending the target bytecode file to the Flutter application, specifically includes the following process:
  • S2051 Receive the trigger operation for the target function identifier in the Flutter application, and determine the target function corresponding to the trigger operation.
  • the target function identifier may be the above-mentioned function entry. After the Flutter application detects the trigger operation for the target function identifier, it will first determine the target function corresponding to the target function identifier, and search for the target bytecode file corresponding to the target function in the local file.
  • an acquisition request for the target bytecode file can be sent to the server, where the acquisition request carries the function tag of the target function corresponding to the target function identifier, So that the server determines the target function corresponding to the trigger operation based on the acquisition request.
  • S2052 Obtain the target bytecode file corresponding to the target function, and transmit the target bytecode file to the Flutter application for decoding.
  • Figure 4 is a schematic diagram of the interaction between the server and the Flutter application.
  • the target function can contain multiple pages.
  • the server can generate an update resource package of the target bytecode file and transmit the update resource package. to Flutter application.
  • the Flutter application can obtain the target bytecode file in the updated resource package through decompression operation, and run the target bytecode file through the interpreter.
  • the Flutter application consists of multiple pages.
  • the Flutter application should also include running files such as AOT compilation files, Flutter software development toolkit, Dart software development toolkit, etc.
  • the target bytecode file corresponding to the trigger operation can be determined, and the target bytecode file can be transferred to the Flutter application to Enable the Flutter application to run the target bytecode file, thereby realizing the target function corresponding to the target bytecode file.
  • the Dart compiler compiles the Dart code file to be processed.
  • the process includes steps S301 to S304. in:
  • the attribute information of each component in the intermediate product can first be obtained, and the intermediate product can be compiled according to the preset bytecode format indicated by the attribute information to obtain the target bytecode file.
  • the update resource package of the Flutter application sent by the server can be decompressed to obtain the target bytecode file of the target function, and then, when the running instruction for the target function is detected , the target bytecode file can be run through the interpreter to display the page corresponding to the target function, thereby realizing dynamic updates for the Flutter application, shortening the update process, and improving update efficiency.
  • 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 The internal logic is determined.
  • the embodiment of the present disclosure also provides an application update device corresponding to the application update method. Since the principle of solving the problem of the device in the embodiment of the present disclosure is similar to the above-mentioned application update method of the embodiment of the present disclosure, therefore For the implementation of the device, please refer to the implementation of the method, and repeated details will not be repeated.
  • the device includes: a receiving unit 51, a decompression unit 52, and an execution unit 53; wherein,
  • Receiving unit 51 configured to receive an update resource package regarding the Flutter application sent by the server;
  • the decompression unit 52 is configured to perform a decompression operation based on the updated resource package to obtain the target bytecode file of the target function in the Flutter application; the target function is a new function in the Flutter application;
  • the execution unit 53 is configured to, when an execution instruction for the target function is detected, run the target bytecode file of the target function through the interpreter to display the page corresponding to the target function.
  • the updated resource package of the Flutter application sent by the server can first be decompressed to obtain the target bytecode file of the target function. Then, when the running instruction for the target function is detected, The target bytecode file is run through the interpreter to display the page corresponding to the target function, thereby realizing dynamic updates for the Flutter application, shortening the update process, and improving update efficiency.
  • the device after performing a decompression operation based on the updated resource package to obtain the target bytecode file of the target function in the Flutter application, the device is also used to:
  • Target modification flag for the target function; wherein the target modification flag is used to indicate that the target function is a new function;
  • the target modification tag is added to the mapping information, where the target mapping table is used to indicate whether each function of the Flutter application includes a corresponding bytecode file.
  • the operation unit 53 is also used to:
  • mapping information corresponding to the target function based on the found function tag, and search the target modification identifier of the target function in the mapping information
  • the interpreter of the Flutter application is called, and the target bytecode file of the target function is run through the interpreter.
  • the device after performing a decompression operation based on the updated resource package to obtain the target bytecode file of the target function in the Flutter application, the device is also used to:
  • the function information includes at least one of the following: function type information of the target function, update time of the target function, and effective time of the target function;
  • update prompt information of the target function Based on the function information, generate update prompt information of the target function; wherein the update prompt information is used to indicate that the user has received the bytecode file of the new function of the Flutter application;
  • the operation unit 53 is also used to:
  • the page corresponding to the target function is displayed on the display interface of the terminal device.
  • the device includes: a determination unit 61, an acquisition unit 62, and a sending unit 63; wherein,
  • the determination unit 61 is used to determine the Dart code of the function to be compiled in the Flutter application, and compile the Dart code through the Dart compiler;
  • the acquisition unit 62 is used to acquire the intermediate product corresponding to the compilation operation, and generate the target bytecode file of the function to be compiled based on the intermediate product;
  • the sending unit 63 is used to send the target bytecode file to the Flutter application, so that the Flutter application runs the target bytecode file through the interpreter.
  • the Dart code of the function to be compiled can be obtained, and the Dart code can be compiled.
  • the target bytecode file can be generated based on the intermediate product of the compilation operation, and the target bytecode can be The file is sent to the Flutter application so that the target bytecode file in the Flutter application can be run, thereby realizing the function corresponding to the target bytecode file, thereby shortening the update process of the Flutter application and improving the update efficiency.
  • the acquisition unit 62 is also used to:
  • the sending unit 63 is also used to:
  • an embodiment of the present disclosure also provides a computer device 700.
  • Figure 7 is a schematic structural diagram of the computer device 700 provided by an embodiment of the present disclosure, it includes:
  • Processor 71 memory 72, and bus 73; memory 72 is used to store execution instructions, including memory 721 and external memory 722; memory 721 here is also called internal memory, and is used to temporarily store operation data in processor 71, and with The processor 71 exchanges data with the external memory 722 such as a hard disk through the memory 721 and the external memory 722.
  • the processor 71 and the memory 72 communicate through the bus 73, so that The processor 71 executes the following instructions:
  • the target bytecode file of the target function is run through the interpreter to display a page corresponding to the target function.
  • the embodiment of the present disclosure also provides another computer device 800.
  • Figure 8 which is a schematic structural diagram of the computer device 800 provided by the embodiment of the present disclosure, it includes:
  • the processor 81 and the memory 82 communicate through the bus 83, so that The processor 81 executes the following instructions:
  • the target bytecode file is sent to the Flutter application, so that the Flutter application runs the target bytecode file through an interpreter.
  • Embodiments of the present disclosure also provide a computer-readable storage medium.
  • a computer program is stored on the computer-readable storage medium.
  • the application update and application development described in the above method embodiments are executed. Method steps.
  • 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 The instructions included in the program code can be used to execute the steps of the application update and application development methods described in the above method embodiments. For details, please refer to the above method embodiments, which 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 separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or they may be distributed to 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)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Human Computer Interaction (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

The present disclosure provides an application program updating method and apparatus, an application program development method and apparatus, and a computer device. The application program updating method comprises: receiving an updating resource packet about a Flutter application sent by a server; performing a decompression operation on the basis of the updating resource packet to obtain a target bytecode file of a target function in the Flutter application; and when a running instruction for the target function is detected, running the target bytecode file of the target function by means of an interpreter so as to display a page corresponding to the target function. In embodiments of the present disclosure, first, decompression may be carried out on the basis of the updating resource packet of the Flutter application sent by the server, so as to obtain the target bytecode file of the target function. Then, when the running instruction for the target function is detected, the target bytecode file may be run by means of the interpreter so as to display the page corresponding to the target function. Therefore, dynamic updating for the Flutter application is achieved, the updating process is shortened, and the updating efficiency is increased.

Description

应用程序更新、应用程序开发方法、装置及计算机设备Application updates, application development methods, devices and computer equipment
本公开要求于2022年3月22日提交的申请号为202210290010.8、申请名称为“应用程序更新、应用程序开发方法、装置及计算机设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This disclosure claims priority to the Chinese patent application with application number 202210290010.8 and the application name "Application update, application development method, device and computer equipment" filed on March 22, 2022, the entire content of which is incorporated by reference. in this application.
技术领域Technical field
本公开涉及计算机技术领域,具体而言,涉及一种应用程序更新、应用程序开发方法、装置及计算机设备。The present disclosure relates to the field of computer technology, and specifically to an application program update, application program development method, device and computer equipment.
背景技术Background technique
随着Flutter跨端技术的普及,基于该Flutter跨端技术开发的Flutter应用也越来越多,因此,针对Flutter应用更新效率的需求也越来越普遍。然而,在现有的针对Flutter应用的更新方案中,如果开发人员在Flutter应用中添加了或者更改了功能,那么,开发人员需要将更新之后的Flutter应用上传至应用商店,以使用户在应用商店中重新下载该更新之后的Flutter应用,从而完成Flutter应用的更新。因此,现有的针对Flutter应用的更新方案更新流程较为冗长,更新效率较低。With the popularity of Flutter cross-end technology, more and more Flutter applications are developed based on this Flutter cross-end technology. Therefore, the demand for Flutter application update efficiency is becoming more and more common. However, in the existing update scheme for Flutter applications, if developers add or change functions in the Flutter application, then the developers need to upload the updated Flutter application to the app store so that users can view it in the app store. Re-download the updated Flutter application to complete the update of the Flutter application. Therefore, the existing update solution for Flutter applications has a lengthy update process and low update efficiency.
发明内容Contents of the invention
本公开实施例至少提供一种应用程序更新、应用程序开发方法、装置及计算机设备。Embodiments of the present disclosure at least provide an application program update, application program development method, device and computer equipment.
第一方面,本公开实施例提供了一种应用程序更新方法,应用于安装有解释器的Flutter应用,包括:In the first aspect, embodiments of the present disclosure provide an application update method, which is applied to Flutter applications with an interpreter installed, including:
接收服务器发送的关于所述Flutter应用的更新资源包;Receive an updated resource package about the Flutter application sent by the server;
基于所述更新资源包进行解压操作,得到所述Flutter应用中目标功能的目标字节码文件;所述目标功能为所述Flutter应用中的新增功能;Perform a decompression operation based on the updated resource package to obtain the target bytecode file of the target function in the Flutter application; the target function is a new function in the Flutter application;
在检测到针对所述目标功能的运行指令的情况下,通过所述解释器运行所述目标功能的目标字节码文件,以显示所述目标功能所对应的页面。When an execution instruction for the target function is detected, the target bytecode file of the target function is run through the interpreter to display a page corresponding to the target function.
一种可选的实施方式中,在基于所述更新资源包进行解压操作,得到所述Flutter应用中目标功能的目标字节码文件之后,所述方法还包括:In an optional implementation, after performing a decompression operation based on the updated resource package to obtain the target bytecode file of the target function in the Flutter application, the method further includes:
为所述目标功能生成目标修改标识;其中,所述目标修改标记用于指示所述目标功能为新增功能;Generate a target modification flag for the target function; wherein the target modification flag is used to indicate that the target function is a new function;
在目标映射表中查找所述目标功能的功能标记,并基于所述功能标记确定所述目标功能所对应的映射信息;Search the function tag of the target function in the target mapping table, and determine the mapping information corresponding to the target function based on the function tag;
将所述目标修改标记添加至所述映射信息中,其中,所述目标映射表用于指示所述Flutter应用的各功能是否包含对应的字节码文件。The target modification tag is added to the mapping information, where the target mapping table is used to indicate whether each function of the Flutter application includes a corresponding bytecode file.
一种可选的实施方式中,所述在检测到针对所述目标功能的运行指令的情况下,通过所述解释器运行所述目标功能的目标字节码文件,以显示所述目标功能所对应的页面,包括:In an optional implementation, when an execution instruction for the target function is detected, the target bytecode file of the target function is run through the interpreter to display the target function. Corresponding pages include:
在检测到针对所述目标功能的运行指令的情况下,在所述目标映射表中查找所述目标功能的功能标记;When an execution instruction for the target function is detected, searching for the function tag of the target function in the target mapping table;
基于查找到的所述功能标记确定所述目标功能所对应的映射信息,并在所述映射信息 中查找所述目标功能的目标修改标识;The mapping information corresponding to the target function is determined based on the found function tag, and the mapping information is Find the target modification identifier of the target function in
在查找到所述目标修改标识的情况下,调用所述Flutter应用的解释器,并通过所述解释器运行所述目标功能的目标字节码文件。When the target modification identifier is found, the interpreter of the Flutter application is called, and the target bytecode file of the target function is run through the interpreter.
一种可选的实施方式中,在基于所述更新资源包进行解压操作,得到所述Flutter应用中目标功能的目标字节码文件之后,所述方法还包括:In an optional implementation, after performing a decompression operation based on the updated resource package to obtain the target bytecode file of the target function in the Flutter application, the method further includes:
确定所述目标功能所对应的功能信息;所述功能信息包括以下至少之一:所述目标功能的功能类型信息,所述目标功能的更新时间,所述目标功能的生效时间;Determine the function information corresponding to the target function; the function information includes at least one of the following: function type information of the target function, update time of the target function, and effective time of the target function;
基于所述功能信息,生成所述目标功能的更新提示信息;其中,所述更新提示信息用于指示用户已接收到所述Flutter应用的新增功能的字节码文件;Based on the function information, generate update prompt information of the target function; wherein the update prompt information is used to indicate that the user has received the bytecode file of the new function of the Flutter application;
在所述Flutter应用所在终端设备的显示界面上显示更新提示窗口,并在所述更新提示窗口中展示所述更新提示信息。Display an update prompt window on the display interface of the terminal device where the Flutter application is located, and display the update prompt information in the update prompt window.
一种可选的实施方式中,所述检测到针对所述目标功能的运行指令,包括:In an optional implementation, the detected running instructions for the target function include:
检测用户对所述更新提示窗口中更新提示信息的第一触发操作;Detecting the user's first triggering operation on the update prompt information in the update prompt window;
基于检测到的所述第一触发操作确定所述目标功能所对应页面的页面跳转标识,并在所述更新提示窗口中展示所述页面跳转标识;Determine the page jump identifier of the page corresponding to the target function based on the detected first trigger operation, and display the page jump identifier in the update prompt window;
在检测到用户对所述页面跳转标识的第二触发操作的情况下,在所述终端设备的显示界面上显示所述目标功能所对应页面。When the user's second triggering operation on the page jump identification is detected, the page corresponding to the target function is displayed on the display interface of the terminal device.
第二方面,本公开实施例提供了一种应用程序开发方法,应用于服务器,所述服务器中包含Dart编译器,包括:In the second aspect, embodiments of the present disclosure provide an application development method, applied to a server, where the server includes a Dart compiler, including:
确定Flutter应用中的待编译功能的Dart代码,并通过所述Dart编译器对所述Dart代码进行编译操作;Determine the Dart code of the function to be compiled in the Flutter application, and compile the Dart code through the Dart compiler;
获取所述编译操作所对应的中间产物,并基于所述中间产物生成所述待编译功能的目标字节码文件;Obtain the intermediate product corresponding to the compilation operation, and generate the target bytecode file of the function to be compiled based on the intermediate product;
将所述目标字节码文件发送至Flutter应用,以使所述Flutter应用通过解释器运行所述目标字节码文件。The target bytecode file is sent to the Flutter application, so that the Flutter application runs the target bytecode file through the interpreter.
一种可选的实施方式中,所述获取所述编译操作所对应的中间产物,包括:In an optional implementation, obtaining the intermediate product corresponding to the compilation operation includes:
获取所述Dart代码文件编译过程中的动态链接库文件,并将所述动态链接库文件确定为所述编译操作所对应的中间产物。Obtain the dynamic link library file during the compilation process of the Dart code file, and determine the dynamic link library file as the intermediate product corresponding to the compilation operation.
一种可选的实施方式中,所述将所述目标字节码文件发送至Flutter应用,包括:In an optional implementation, sending the target bytecode file to the Flutter application includes:
接收所述Flutter应用中针对目标功能标识的触发操作,并确定所述触发操作所对应的目标功能;Receive the trigger operation for the target function identifier in the Flutter application, and determine the target function corresponding to the trigger operation;
获取所述目标功能所对应的目标字节码文件,并将所述目标字节码文件传输至所述Flutter应用进行解码。Obtain the target bytecode file corresponding to the target function, and transfer the target bytecode file to the Flutter application for decoding.
第三方面,本公开实施例还提供一种用程序更新装置,包括:In a third aspect, an embodiment of the present disclosure also provides a program updating device, including:
接收单元,用于接收服务器发送的关于所述Flutter应用的更新资源包;A receiving unit, configured to receive an update resource package regarding the Flutter application sent by the server;
解压单元,用于基于所述更新资源包进行解压操作,得到所述Flutter应用中目标功能的目标字节码文件;所述目标功能为所述Flutter应用中的新增功能; A decompression unit, configured to perform a decompression operation based on the updated resource package to obtain a target bytecode file of a target function in the Flutter application; the target function is a new function in the Flutter application;
运行单元,用于在检测到针对所述目标功能的运行指令的情况下,通过所述解释器运行所述目标功能的目标字节码文件,以显示所述目标功能所对应的页面。An execution unit, configured to run the target bytecode file of the target function through the interpreter to display the page corresponding to the target function when an execution instruction for the target function is detected.
第四方面,本公开实施例还提供一种应用程序开发装置,包括:In a fourth aspect, embodiments of the present disclosure also provide an application development device, including:
确定单元,用于确定Flutter应用中的待编译功能的Dart代码,并通过所述Dart编译器对所述Dart代码进行编译操作;A determination unit, used to determine the Dart code of the function to be compiled in the Flutter application, and compile the Dart code through the Dart compiler;
获取单元,用于获取所述编译操作所对应的中间产物,并基于所述中间产物生成所述待编译功能的目标字节码文件;An acquisition unit, configured to acquire an intermediate product corresponding to the compilation operation, and generate a target bytecode file of the function to be compiled based on the intermediate product;
发送单元,用于将所述目标字节码文件发送至Flutter应用,以使所述Flutter应用通过解释器运行所述目标字节码文件。A sending unit, configured to send the target bytecode file to the Flutter application, so that the Flutter application runs the target bytecode file through an interpreter.
第五方面,本公开实施例还提供一种计算机设备,包括:处理器、存储器和总线,所述存储器存储有所述处理器可执行的机器可读指令,当计算机设备运行时,所述处理器与所述存储器之间通过总线通信,所述机器可读指令被所述处理器执行时执行上述第一方面至第二方面中任一种可能的实施方式中的步骤。In a fifth aspect, 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. When the computer device is running, 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.
第六方面,本公开实施例还提供一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序,该计算机程序被处理器运行时执行上述第一方面至第二方面中任一种可能的实施方式中的步骤。In a sixth aspect, 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.
第七方面,本公开实施例还提供一种计算机程序产品,所述计算机程序产品包括程序代码,所述程序代码被处理器执行时实现上述第一方面至第二方面中任一种可能的实施方式中的步骤。In a seventh aspect, embodiments of the present disclosure also provide a computer program product. The computer program product includes program code. When the program code is executed by a processor, any one of the possible implementations of the first to second aspects can be implemented. steps in the way.
本公开实施例提供的应用程序更新、应用程序开发方法、装置及计算机设备,在本公开实施例中,首先可以基于服务器发送的Flutter应用的更新资源包进行解压,得到目标功能的目标字节码文件,然后,在检测到针对该目标功能的运行指令的情况下,就可以通过解释器运行该目标字节码文件,以显示该目标功能所对应的页面,从而实现了针对该Flutter应用的动态更新,缩短了更新流程,提高了更新效率。In the application update, application development method, device and computer equipment provided by the embodiments of the disclosure, in the embodiments of the disclosure, first, the update resource package of the Flutter application sent by the server can be decompressed to obtain the target bytecode of the target function. file, and then, when the running instruction for the target function is detected, the target bytecode file can be run through the interpreter to display the page corresponding to the target function, thus realizing the dynamic operation of the Flutter application. Update, shorten the update process and improve the update efficiency.
为使本公开的上述目的、特征和优点能更明显易懂,下文特举较佳实施例,并配合所附附图,作详细说明如下。In order to make the above-mentioned objects, features and advantages of the present disclosure more obvious and understandable, preferred embodiments are given below and described in detail with reference to the accompanying drawings.
附图说明Description of the drawings
为了更清楚地说明本公开实施例的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,此处的附图被并入说明书中并构成本说明书中的一部分,这些附图示出了符合本公开的实施例,并与说明书一起用于说明本公开的技术方案。应当理解,以下附图仅示出了本公开的某些实施例,因此不应被看作是对范围的限定,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他相关的附图。In order to explain the technical solutions of the embodiments of the present disclosure more clearly, the drawings required to be used in the embodiments will be briefly introduced below. The drawings here are incorporated into the specification and constitute a part of this specification. These drawings are The drawings illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the technical solutions of the present disclosure. It should be understood that the following drawings only illustrate certain embodiments of the present disclosure, and therefore should not be regarded as limiting the scope. For those of ordinary skill in the art, without exerting creative efforts, they can also Other relevant drawings are obtained based on these drawings.
图1示出了本公开实施例所提供的一种应用程序更新方法的流程图;Figure 1 shows a flow chart of an application update method provided by an embodiment of the present disclosure;
图2示出了本公开实施例所提供的一种应用程序开发方法的流程图;Figure 2 shows a flow chart of an application development method provided by an embodiment of the present disclosure;
图3示出了本公开实施例所提供的Dart编译器对Dart代码进行编译的流程图;Figure 3 shows a flow chart of Dart code compilation by the Dart compiler provided by the embodiment of the present disclosure;
图4示出了本公开实施例所提供的服务器和Flutter应用之间交互的示意图;Figure 4 shows a schematic diagram of the interaction between the server and the Flutter application provided by the embodiment of the present disclosure;
图5示出了本公开实施例所提供的一种应用程序更新装置的示意图; Figure 5 shows a schematic diagram of an application updating device provided by an embodiment of the present disclosure;
图6示出了本公开实施例所提供的一种应用程序开发装置的示意图;Figure 6 shows a schematic diagram of an application development device provided by an embodiment of the present disclosure;
图7示出了本公开实施例所提供的一种计算机设备的示意图;Figure 7 shows a schematic diagram of a computer device provided by an embodiment of the present disclosure;
图8示出了本公开实施例所提供的另一种计算机设备的示意图。FIG. 8 shows a schematic diagram of another computer device provided by an embodiment of the present disclosure.
具体实施方式Detailed ways
为使本公开实施例的目的、技术方案和优点更加清楚,下面将结合本公开实施例中附图,对本公开实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本公开一部分实施例,而不是全部的实施例。通常在此处附图中描述和示出的本公开实施例的组件可以以各种不同的配置来布置和设计。因此,以下对在附图中提供的本公开的实施例的详细描述并非旨在限制要求保护的本公开的范围,而是仅仅表示本公开的选定实施例。基于本公开的实施例,本领域技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本公开保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only These are some embodiments of the present disclosure, but not all embodiments. The components of the embodiments of the present disclosure generally described and illustrated in the figures herein may be arranged and designed in a variety of different configurations. Therefore, the following detailed description of the embodiments of the disclosure provided in the appended drawings is not intended to limit the scope of the claimed disclosure, but rather to represent selected embodiments of the disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without any creative efforts shall fall within the scope of protection of the present disclosure.
应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步定义和解释。It should be noted that similar reference numerals and letters represent similar items in the following figures, therefore, once an item is defined in one figure, it does not need further definition and explanation in subsequent figures.
本文中术语“和/或”,仅仅是描述一种关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中术语“至少一种”表示多种中的任意一种或多种中的至少两种的任意组合,例如,包括A、B、C中的至少一种,可以表示包括从A、B和C构成的集合中选择的任意一个或多个元素。The term "and/or" in this article only describes an association relationship, indicating that three relationships can exist. For example, A and/or B can mean: A alone exists, A and B exist simultaneously, and B alone exists. situation. 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, and C, which can mean including from A, Any one or more elements selected from the set composed of B and C.
经研究发现,在现有的针对Flutter应用的更新方案中,如果开发人员在Flutter应用中添加了或者更改了功能,那么,开发人员需要将更新之后的Flutter应用上传至应用商店,以使用户在应用商店中重新下载该更新之后的Flutter应用,从而完成Flutter应用的更新。因此,现有的针对Flutter应用的更新方案更新流程较为冗长,更新效率较低。Research has found that in the existing update scheme for Flutter applications, if developers add or change functions in Flutter applications, developers need to upload the updated Flutter applications to the app store so that users can Re-download the updated Flutter application from the App Store to complete the update of the Flutter application. Therefore, the existing update solution for Flutter applications has a lengthy update process and low update efficiency.
基于上述研究,本公开提供了一种应用程序更新、应用程序开发方法、装置及计算机设备。在本公开实施例中,首先可以基于服务器发送的Flutter应用的更新资源包进行解压,得到目标功能的目标字节码文件,然后,在检测到针对该目标功能的运行指令的情况下,就可以通过解释器运行该目标字节码文件,以显示该目标功能所对应的页面,从而实现了针对该Flutter应用的动态更新,缩短了更新流程,提高了更新效率。Based on the above research, the present disclosure provides an application update, application development method, device and computer equipment. In the embodiment of the present disclosure, the updated resource package of the Flutter application sent by the server can first be decompressed to obtain the target bytecode file of the target function. Then, when the running instruction for the target function is detected, The target bytecode file is run through the interpreter to display the page corresponding to the target function, thereby realizing dynamic updates for the Flutter application, shortening the update process, and improving update efficiency.
为便于对本实施例进行理解,首先对本公开实施例所公开的一种应用程序更新、应用程序开发方法进行详细介绍,本公开实施例所提供的应用程序更新、应用程序开发方法的执行主体一般为具有一定计算能力的计算机设备,该计算机设备例如包括:终端设备或服务器或其它处理设备。在一些可能的实现方式中,该应用程序更新、应用程序开发方法可以通过处理器调用存储器中存储的计算机可读指令的方式来实现。In order to facilitate understanding of this embodiment, an application update and application development method disclosed in this embodiment of the present disclosure are first introduced in detail. The execution subject of the application update and application development method provided by this embodiment of the disclosure is generally: Computer equipment with certain computing capabilities. The computer equipment includes, for example, terminal equipment or servers or other processing equipment. In some possible implementations, the application updating and application development methods can be implemented by the processor calling computer readable instructions stored in the memory.
参见图1所示,为本公开实施例提供的一种应用程序更新方法的流程图,所述方法包括步骤S101~S105,其中:Referring to Figure 1, a flow chart of an application update method is provided according to an embodiment of the present disclosure. The method includes steps S101 to S105, wherein:
S101:接收服务器发送的关于所述Flutter应用的更新资源包。S101: Receive an update resource package about the Flutter application sent by the server.
在本公开实施例中,在服务器中对Flutter应用进行更新得到更新资源包后,可以主动向Flutter应用发送该更新资源包,或者,响应于Flutter应用针对该更新资源包的获取请求, 向该Flutter应用发送更新资源包。In the embodiment of the present disclosure, after the Flutter application is updated in the server to obtain the updated resource package, the updated resource package can be actively sent to the Flutter application, or in response to the Flutter application's acquisition request for the updated resource package, Send an update resource package to the Flutter application.
这里,在服务器响应于Flutter应用针对更新资源包的获取请求,向该Flutter应用发送更新资源包的情况下,在检测到服务器中针对Flutter应用进行更新后,该Flutter应用就可以询问用户是否需要获取该更新资源包,在用户确定获取该更新资源包后,就可以向服务器发送该更新资源包的获取请求。Here, when the server responds to the Flutter application's request for obtaining the updated resource package and sends the updated resource package to the Flutter application, after detecting that the Flutter application is updated in the server, the Flutter application can ask the user whether it needs to obtain it. After the user determines to obtain the update resource package, the user can send a request for obtaining the update resource package to the server.
S103:基于所述更新资源包进行解压操作,得到所述Flutter应用中目标功能的目标字节码文件;所述目标功能为所述Flutter应用中的新增功能。S103: Perform a decompression operation based on the updated resource package to obtain the target bytecode file of the target function in the Flutter application; the target function is a new function in the Flutter application.
在本公开实施例中,为了提高文件传输效率以及在一定程度上保证传输安全性,上述更新资源包可以为SDK(Software Development Kit,软件开发工具包)格式的,因此,Flutter应用在接收到该更新资源包后,可以首先对该更新资源包进行解压操作,得到解压文件,其中,该解压文件中可以包含目标功能的目标字节码文件和/或目标功能的功能标记。In this disclosed embodiment, in order to improve file transmission efficiency and ensure transmission security to a certain extent, the above-mentioned update resource package may be in SDK (Software Development Kit) format. Therefore, the Flutter application receives the After the resource package is updated, the updated resource package can be decompressed first to obtain a decompressed file, where the decompressed file can include a target bytecode file of the target function and/or a function tag of the target function.
在得到Flutter应用中目标功能的目标字节码文件之后,就可以将该目标字节码文件存储在本地文件中。具体实施时,首先,可以获取Flutter应用在本地文件中的存储目录,并基于目标功能的功能标记,在该存储目录下建立目标功能的存储文件,然后,就可以将上述目标字节码文件存储到该存储文件中。After obtaining the target bytecode file of the target function in the Flutter application, the target bytecode file can be stored in a local file. During specific implementation, first, you can obtain the storage directory of the Flutter application in the local file, and based on the function tag of the target function, create the storage file of the target function in the storage directory, and then, you can store the above target bytecode file. into this storage file.
S105:在检测到针对所述目标功能的运行指令的情况下,通过所述解释器运行所述目标功能的目标字节码文件,以显示所述目标功能所对应的页面。S105: When an execution instruction for the target function is detected, run the target bytecode file of the target function through the interpreter to display the page corresponding to the target function.
在本公开实施例中,在将上述目标字节码文件存储到本地文件中之后,就可以在Flutter应用已有的功能页面中新增一个目标功能的功能入口,其中,该功能入口可以为该目标功能的目标功能标识。例如,在该目标功能为短视频的情况下,就可以在该Flutter应用的主页面中新增一个“短视频”的目标功能标识(例如,短视频按钮)作为目标功能的功能入口。In the embodiment of the present disclosure, after the above target bytecode file is stored in a local file, a function entrance of the target function can be added to the existing function page of the Flutter application, where the function entrance can be The target function identifier of the target function. For example, if the target function is short video, a target function identifier of "short video" (for example, short video button) can be added to the main page of the Flutter application as the function entrance of the target function.
接下来,在检测到针对该功能入口的触发操作后,就可以确定检测到针对上述目标功能的运行指令。然后,就可以获取该目标功能的目标字节码文件,并将该目标字节码文件加载到解释器(例如,Dart解释器)中,以通过解释器运行该目标字节码文件,从而在显示界面上显示该目标功能所对应的页面。Next, after detecting the trigger operation for the function entry, it can be determined that the running instruction for the above target function is detected. Then, you can get the target bytecode file of the target function and load the target bytecode file into the interpreter (for example, the Dart interpreter) to run the target bytecode file through the interpreter, thereby running The page corresponding to the target function is displayed on the display interface.
通过上述描述可知,在本公开实施例中,首先可以基于服务器发送的Flutter应用的更新资源包进行解压,得到目标功能的目标字节码文件,然后,在检测到针对该目标功能的运行指令的情况下,就可以通过解释器运行该目标字节码文件,以显示该目标功能所对应的页面,从而实现了针对该Flutter应用的动态更新,缩短了更新流程,提高了更新效率。As can be seen from the above description, in the embodiment of the present disclosure, first, the update resource package of the Flutter application sent by the server can be decompressed to obtain the target bytecode file of the target function, and then, after the operation instruction for the target function is detected, In this case, the target bytecode file can be run through the interpreter to display the page corresponding to the target function, thereby realizing dynamic updates for the Flutter application, shortening the update process, and improving update efficiency.
在一个可选的实施方式中,在基于所述更新资源包进行解压操作,得到所述Flutter应用中目标功能的目标字节码文件之后,上述方法还包括如下过程:In an optional implementation, after performing a decompression operation based on the updated resource package to obtain the target bytecode file of the target function in the Flutter application, the above method further includes the following process:
(1)、为所述目标功能生成目标修改标识;其中,所述目标修改标记用于指示所述目标功能为新增功能;(1), generate a target modification flag for the target function; wherein the target modification flag is used to indicate that the target function is a new function;
(2)、在目标映射表中查找所述目标功能的功能标记,并基于所述功能标记确定所述目标功能所对应的映射信息;(2) Search the function tag of the target function in the target mapping table, and determine the mapping information corresponding to the target function based on the function tag;
(3)、将所述目标修改标记添加至所述映射信息中,其中,所述目标映射表用于指示 所述Flutter应用的各功能是否包含对应的字节码文件。(3) Add the target modification mark to the mapping information, where the target mapping table is used to indicate Whether each function of the Flutter application contains corresponding bytecode files.
在本公开实施例中,可以为Flutter应用建立目标映射表,其中,该目标映射表用于指述Flutter应用的各功能是否包含对应的字节码文件。因此,在检测到针对Flutter应用中的指定功能的触发操作后,就可以获取该目标映射表,并基于该目标映射表确定该指定功能是否对应字节码文件,在该指定功能对应字节码文件的情况下,就可以运行该字节码文件。In the embodiment of the present disclosure, a target mapping table can be established for the Flutter application, where the target mapping table is used to indicate whether each function of the Flutter application includes a corresponding bytecode file. Therefore, after detecting the trigger operation for the specified function in the Flutter application, the target mapping table can be obtained, and based on the target mapping table, it is determined whether the specified function corresponds to the bytecode file, where the specified function corresponds to the bytecode In the case of a file, you can run the bytecode file.
在得到Flutter应用中目标功能的目标字节码文件之后,就可以为该目标功能生成修改标识,并在目标映射表中查找该目标功能的功能标记。After obtaining the target bytecode file of the target function in the Flutter application, you can generate a modification identifier for the target function and search for the function tag of the target function in the target mapping table.
这里,在该目标映射表中不包含该目标功能的功能标记的情况下,可以在该目标映射表中增加该目标功能的功能标记,并建立该目标功能所对应的映射信息。然后,就可以将目标修改标记添加到该映射信息之中。Here, if the target mapping table does not include the function tag of the target function, the function tag of the target function can be added to the target mapping table, and mapping information corresponding to the target function can be established. Then, the target modification tag can be added to the mapping information.
需要说明的是,上述映射信息用于指示该目标功能在本地文件中所对应的运行文件,其中,该运行文件中可以为字节码文件或者AOT(Ahead Of Time)编译文件。这里,该在构建上述Flutter应用时得到的编译产物为AOT编译文件,该AOT编译文件为和处理器类型相关的二进制代码。It should be noted that the above mapping information is used to indicate the running file corresponding to the target function in the local file, where the running file can be a bytecode file or an AOT (Ahead Of Time) compiled file. Here, the compiled product obtained when building the above Flutter application is an AOT compiled file, and the AOT compiled file is a binary code related to the processor type.
通过上述描述可知,可以为Flutter应用建立目标映射表,并基于获取到的目标功能的目标字节码,在该目标映射表中更新该目标功能的映射信息,从而在检测到针对Flutter应用中的指定功能的触发操作后,就可以获取该目标映射表,并基于该目标映射表确定该指定功能是否对应字节码文件,提高了查找字节码文件的效率以及设备响应的速度。As can be seen from the above description, a target mapping table can be established for the Flutter application, and based on the obtained target bytecode of the target function, the mapping information of the target function is updated in the target mapping table, so that when the target function in the Flutter application is detected, After the specified function is triggered, the target mapping table can be obtained, and based on the target mapping table, it is determined whether the specified function corresponds to a bytecode file, which improves the efficiency of searching for bytecode files and the speed of device response.
在一个可选的实施方式中,上述步骤S105,在检测到针对所述目标功能的运行指令的情况下,通过所述解释器运行所述目标功能的目标字节码文件,以显示所述目标功能所对应的页面,具体包括如下过程:In an optional implementation, in step S105 above, when an execution instruction for the target function is detected, the target bytecode file of the target function is run through the interpreter to display the target function. The page corresponding to the function specifically includes the following processes:
S1051:在检测到针对所述目标功能的运行指令的情况下,在所述目标映射表中查找所述目标功能的功能标记。S1051: When an operation instruction for the target function is detected, search the function tag of the target function in the target mapping table.
在本公开实施例中,在检测到针对目标功能的运行指令的情况下,就可以获取Flutter应用所对应的目标映射表,并在该目标映射表中查找目标功能的功能标记。In the embodiment of the present disclosure, when an execution instruction for a target function is detected, the target mapping table corresponding to the Flutter application can be obtained, and the function mark of the target function can be searched in the target mapping table.
具体实施时,可以通过遍历指令遍历该目标映射表,从而获取该功能标记。或者,首先确定该运行指令所指示的目标功能的功能标记,并通过匹配指令在该目标映射表中匹配该功能标记。During specific implementation, the target mapping table can be traversed through a traversal instruction to obtain the function tag. Alternatively, first determine the function tag of the target function indicated by the run instruction, and match the function tag in the target mapping table through the matching instruction.
S1052:基于查找到的所述功能标记确定所述目标功能所对应的映射信息,并在所述映射信息中查找所述目标功能的目标修改标识。S1052: Determine the mapping information corresponding to the target function based on the found function tag, and search for the target modification identifier of the target function in the mapping information.
S1053:在查找到所述目标修改标识的情况下,调用所述Flutter应用的解释器,并通过所述解释器运行所述目标功能的目标字节码文件。S1053: When the target modification identifier is found, call the interpreter of the Flutter application, and run the target bytecode file of the target function through the interpreter.
在本公开实施例中,在查找到目标修改标识的情况下,就可以确定该目标功能存在对应的目标字节码文件,接下来,就可以基于上述映射信息中,确定该目标功能所对应的目标字节码文件在本地文件中的存储位置。In the embodiment of the present disclosure, when the target modification identifier is found, it can be determined that the target function has a corresponding target bytecode file. Next, based on the above mapping information, the target function corresponding to the target function can be determined. The storage location of the target bytecode file in the local file.
在确定出上述目标字节码文件在本地文件中的存储位置之后,就可以基于该存储位置查找该目标字节码文件,并通过调用Flutter应用的解释器来运行该目标字节码文件。 After determining the storage location of the above target bytecode file in the local file, the target bytecode file can be found based on the storage location, and the target bytecode file can be run by calling the interpreter of the Flutter application.
具体实施时,可以首先对该目标字节码文件进行解析,在得到解析结果后,就可以得到该目标字节码文件中的可运行字节码信息,其中,该可运行字节码信息可以为该目标字节码文件中的library、function、field等字段所指示的信息。During specific implementation, the target bytecode file can be parsed first. After obtaining the parsing result, the runnable bytecode information in the target bytecode file can be obtained, where the runnable bytecode information can be It is the information indicated by the library, function, field and other fields in the target bytecode file.
通过上述描述可知,在检测到针对Flutter应用中的目标功能的运行指令后,就可以获取该Flutter应用的目标映射表,并基于该目标映射表确定该指定功能对应的目标字节码文件,提高了查找字节码文件的效率以及设备响应的速度。As can be seen from the above description, after detecting the running instructions for the target function in the Flutter application, the target mapping table of the Flutter application can be obtained, and the target bytecode file corresponding to the specified function is determined based on the target mapping table, improving This improves the efficiency of finding bytecode files and the speed of device response.
在一个可选的实施方式中,在基于所述更新资源包进行解压操作,得到所述Flutter应用中目标功能的目标字节码文件之后,上述方法还包括如下过程:In an optional implementation, after performing a decompression operation based on the updated resource package to obtain the target bytecode file of the target function in the Flutter application, the above method further includes the following process:
(1)、确定所述目标功能所对应的功能信息;所述功能信息包括以下至少之一:所述目标功能的功能类型信息,所述目标功能的更新时间,所述目标功能的生效时间;(1) Determine the function information corresponding to the target function; the function information includes at least one of the following: function type information of the target function, update time of the target function, and effective time of the target function;
(2)、基于所述功能信息,生成所述目标功能的更新提示信息;其中,所述更新提示信息用于指示用户已接收到所述Flutter应用的新增功能的字节码文件;(2) Based on the function information, generate update prompt information for the target function; wherein the update prompt information is used to indicate that the user has received the bytecode file of the new function of the Flutter application;
(3)、在所述Flutter应用所在终端设备的显示界面上显示更新提示窗口,并在所述更新提示窗口中展示所述更新提示信息。(3) Display an update prompt window on the display interface of the terminal device where the Flutter application is located, and display the update prompt information in the update prompt window.
在本公开实施例中,在基于上述更新资源包进行解压后,就可以得到该更新资源包所对应的目标功能的功能信息。In the embodiment of the present disclosure, after decompression based on the above update resource package, the function information of the target function corresponding to the update resource package can be obtained.
这里,上述目标功能的功能类型信息可以用于表征该目标功能的功能类型,例如,购物类,游戏类,阅读类等,其中,该功能类型信息中还可以包含该目标功能的功能介绍信息。上述目标功能的更新时间可以为服务器将该目标功能的更新资源包发送至Flutter应用中的时间。上述目标功能的生效时间用于指示该目标功能的生效起止日期以及结束日期。例如,该目标功能为圣诞限定活动,那么,该目标功能的生效日期就可以为2021.12.24-2021.12.31。Here, the function type information of the target function can be used to characterize the function type of the target function, for example, shopping, gaming, reading, etc., where the function type information can also include function introduction information of the target function. The update time of the above target function can be the time when the server sends the update resource package of the target function to the Flutter application. The effective time of the above target function is used to indicate the effective start and end dates and end dates of the target function. For example, if the target function is a Christmas-limited event, then the effective date of the target function can be 2021.12.24-2021.12.31.
接下来,就可以基于上述功能信息生成目标功能的更新提示信息,并将该更新提示信息展示在显示界面上。具体实施时,可以建立更新提示窗口,并通过该更新提示窗口将该更新提示信息展示在终端设备的显示界面上。这里,上述更新提示信息可以包含至少部分功能信息。Next, the update prompt information of the target function can be generated based on the above function information, and the update prompt information can be displayed on the display interface. During specific implementation, an update prompt window may be established, and the update prompt information may be displayed on the display interface of the terminal device through the update prompt window. Here, the above update prompt information may include at least part of the function information.
通过上述描述可知,在得到Flutter应用中目标功能的目标字节码文件之后,就可以确定该目标功能的功能信息,并基于该功能信息生成目标功能的更新提示信息,以便用户能根据该更新提示信息了解该目标功能的基本信息,减少了用户错过目标功能的更新的可能性,提高了用户的使用体验。From the above description, it can be seen that after obtaining the target bytecode file of the target function in the Flutter application, the function information of the target function can be determined, and the update prompt information of the target function can be generated based on the function information, so that the user can follow the update prompt The information understands the basic information of the target function, which reduces the possibility of users missing updates of the target function and improves the user experience.
在一个可选的实施方式中,上述步骤S105,检测到针对所述目标功能的运行指令,具体包括如下过程:In an optional implementation, the above-mentioned step S105 detects an operation instruction for the target function, which specifically includes the following process:
(1)、检测用户对所述更新提示窗口中更新提示信息的第一触发操作;(1) Detect the user's first triggering operation on the update prompt information in the update prompt window;
(2)、基于检测到的所述第一触发操作确定所述目标功能所对应页面的页面跳转标识,并在所述更新提示窗口中展示所述页面跳转标识;(2) Determine the page jump identifier of the page corresponding to the target function based on the detected first trigger operation, and display the page jump identifier in the update prompt window;
(3)、在检测到用户对所述页面跳转标识的第二触发操作的情况下,在所述终端设备的显示界面上显示所述目标功能所对应页面。 (3) When the user's second triggering operation on the page jump mark is detected, display the page corresponding to the target function on the display interface of the terminal device.
在本公开实施例中,上述更新提示窗口中还可以包含询问信息,其中,该询问信息可以用于询问用户是否跳转至目标功能所对应页面。在检测到用户针对该询问信息的确认操作后,就可以确定检测到针对该更新提示信息的第一触发操作。In this embodiment of the present disclosure, the update prompt window may also include query information, where the query information may be used to ask the user whether to jump to the page corresponding to the target function. After detecting the user's confirmation operation for the query information, it can be determined that the first trigger operation for the update prompt information is detected.
在检测到针对该更新提示信息的第一触发操作之后,就可以确定上述目标功能所对应页面的页面跳转标识,其中,该页面跳转标识可以为该目标功能对应页面的目标页面链接。After detecting the first trigger operation for the update prompt information, the page jump identifier of the page corresponding to the target function can be determined, wherein the page jump identifier can be the target page link of the page corresponding to the target function.
具体实施时,在用户通过该页面跳转标识跳转至目标功能所对应页面的过程中,可以基于用户当前时刻的浏览内容,分为以下几种情况:During specific implementation, when the user jumps to the page corresponding to the target function through the page jump identification, it can be divided into the following situations based on the user's browsing content at the current moment:
情况一:Situation one:
在当前时刻用户浏览的内容不是上述Flutter应用中内容的情况下,可以首先确定该目标功能所对应的功能入口在Flutter应用中所属的页面,并基于该功能入口所属页面的页面链接生成上述页面跳转标识。在用户基于该页面跳转标识跳转至功能入口所属页面内之后,就可以在该功能入口所属页面内通过指示标识指示该功能入口,以使用户触发该功能入口,从而进入该目标功能对应页面,从而便于用户了解该目标功能的访问路径。If the content the user is browsing at the current moment is not the content in the above-mentioned Flutter application, you can first determine the page in the Flutter application to which the function entrance corresponding to the target function belongs, and generate the above page jump based on the page link of the page to which the function entrance belongs. Turn logo. After the user jumps to the page to which the function entrance belongs based on the page jump identification, the function entrance can be indicated by the indicator in the page to which the function entrance belongs, so that the user triggers the function entrance and enters the page corresponding to the target function. , thereby making it easier for users to understand the access path to the target function.
应理解的是,在用户通过上述页面跳转标识跳转至Flutter应用之前,可以首先询问用户是否需要打开该Flutter应用,再响应于用户的确定操作打开该Flutter应用。It should be understood that before the user jumps to the Flutter application through the above page jump identification, the user can first be asked whether the Flutter application needs to be opened, and then the Flutter application can be opened in response to the user's confirmation operation.
情况二:Situation two:
在当前时刻用户浏览的内容是上述Flutter应用中内容的情况下,上述页面跳转标识可以为该目标功能对应页面的目标页面链接,用户可以通过第二触发操作触发该页面跳转标识,从而打开该目标功能所对应页面。或者,该页面跳转标识可以为功能入口所属页面的页面链接,在用户基于该页面跳转标识跳转至功能入口所属页面内之后,就可以在该功能入口所属页面内通过指示标识指示该功能入口,以使用户触发该功能入口,从而进入该目标功能对应页面,从而便于用户了解该目标功能的访问路径。When the content the user is browsing at the current moment is the content in the above-mentioned Flutter application, the above-mentioned page jump identification can be the target page link of the page corresponding to the target function, and the user can trigger the page jump identification through the second triggering operation, thereby opening The page corresponding to the target function. Alternatively, the page jump identification can be a page link to the page to which the function entrance belongs. After the user jumps to the page to which the function entrance belongs based on the page jump identification, the function can be indicated by an indicator in the page to which the function entrance belongs. Entrance, so that the user can trigger the function entrance and enter the page corresponding to the target function, thereby making it easier for the user to understand the access path of the target function.
通过上述描述可知,用户可以通过更新提示窗口打开目标功能所对应页面,从而在一定程度上缩短用户的浏览路径,便于用户更快捷的体验目标功能。It can be seen from the above description that the user can open the page corresponding to the target function by updating the prompt window, thereby shortening the user's browsing path to a certain extent and making it easier for the user to experience the target function more quickly.
参见图2所示,为本公开实施例提供的一种应用程序开发方法的流程图,所述方法包括步骤S201~S205,其中:Referring to Figure 2, a flow chart of an application development method is provided according to an embodiment of the present disclosure. The method includes steps S201 to S205, wherein:
S201:确定Flutter应用中的待编译功能的Dart代码,并通过所述Dart编译器对所述Dart代码进行编译操作。S201: Determine the Dart code of the function to be compiled in the Flutter application, and compile the Dart code through the Dart compiler.
在本公开实施例中,首先需要获取Flutter应用中待编译功能的Dart代码,其中,待编译功能可以为上述目标功能。这里,在针对Flutter应用进行新功能开发的情况下,得到的开发产物就可以为上述Dart代码。In the embodiment of the present disclosure, it is first necessary to obtain the Dart code of the function to be compiled in the Flutter application, where the function to be compiled can be the above-mentioned target function. Here, when developing new functions for Flutter applications, the resulting development product can be the above Dart code.
应理解的是,由于上述Flutter应用的编译语言为Dart语言,因此,在对该Flutter应用进行新功能开发后,得到的开发产物就为上述Dart代码。It should be understood that since the compilation language of the above-mentioned Flutter application is the Dart language, after developing new functions for the Flutter application, the development product obtained will be the above-mentioned Dart code.
在本公开实施例中,在获取到上述Dart代码之后,就可以对该Dart代码进行编译。具体实施时,可以将该Dart代码加载到Dart编译器中,以通过该Dart编译器对该Dart代码进行识别并编译。In the embodiment of the present disclosure, after obtaining the above Dart code, the Dart code can be compiled. During specific implementation, the Dart code can be loaded into the Dart compiler, so that the Dart code can be identified and compiled by the Dart compiler.
S203:获取所述编译操作所对应的中间产物,并基于所述中间产物生成所述待编译功 能的目标字节码文件。S203: Obtain the intermediate product corresponding to the compilation operation, and generate the function to be compiled based on the intermediate product. A capable target bytecode file.
在本公开实施例中,Dart编译器对Dart代码进行编译的过程如图3所示,其中,首先可以对该Dart代码进行语法分析以及词法分析,从而得到中间产物,这里,对该Dart代码进行语法分析以及词法分析的过程如下所述,此处不再赘述。In this embodiment of the present disclosure, the process of compiling Dart code by the Dart compiler is shown in Figure 3. First, syntax analysis and lexical analysis can be performed on the Dart code to obtain an intermediate product. Here, the Dart code is The process of syntax analysis and lexical analysis is described below and will not be repeated here.
应理解的是,由图3可知,上述Dart编译器在对上述中间产物依次进行中间优化、指令生成之后,得到的最终编译产物为AOT编译文件,该AOT编译文件为和处理器类型相关的二进制代码。It should be understood that, as can be seen from Figure 3, after the above-mentioned Dart compiler sequentially performs intermediate optimization and instruction generation on the above-mentioned intermediate products, the final compiled product obtained is an AOT compiled file, and the AOT compiled file is a binary related to the processor type. code.
在本公开实施例中所描述的Flutter应用为能够支持对该目标字节码文件进行解释的应用,因此,如果现有Flutter应用无法对该目标字节码文件进行解释,则需要重新编译得到新的能够对该目标字节码文件进行解释的Flutter应用,具体编译过程描述如下:The Flutter application described in the embodiment of the present disclosure is an application that can support the interpretation of the target bytecode file. Therefore, if the existing Flutter application cannot interpret the target bytecode file, it needs to be recompiled to obtain a new one. A Flutter application that can interpret the target bytecode file. The specific compilation process is described as follows:
首先,可以获取目标命令行参数,其中,该目标命令行参数用于确定编译Flutter应用的Flutter引擎,不同的Flutter引擎能够编译得到具有不同功能的Flutter应用。之后,就通过目标命令行参数将该Flutter应用编译为能够支持运行目标字节码文件的应用。具体实施时,可以在现有版本的Flutter应用中新增解释器功能(例如,新增Dart解释器)。接下来,在封装该Flutter应用的过程中,可以通过宏控制编译该Flutter应用的解释器(例如,Dart解释器),以使该Flutter应用在运行时能够通过解释器运行字节码文件。First, you can obtain the target command line parameters, where the target command line parameters are used to determine the Flutter engine for compiling Flutter applications. Different Flutter engines can compile Flutter applications with different functions. After that, the Flutter application is compiled into an application that can support running the target bytecode file through the target command line parameters. During specific implementation, you can add interpreter functions to existing versions of Flutter applications (for example, add a Dart interpreter). Next, in the process of encapsulating the Flutter application, the interpreter (for example, the Dart interpreter) that compiles the Flutter application can be controlled through macros, so that the Flutter application can run the bytecode file through the interpreter at runtime.
S205:将所述目标字节码文件发送至Flutter应用,以使所述Flutter应用通过解释器运行所述目标字节码文件。S205: Send the target bytecode file to the Flutter application, so that the Flutter application runs the target bytecode file through the interpreter.
在本公开实施例中,可以响应于Flutter应用针对目标字节码文件的获取请求,生成该目标字节码文件的更新资源包,并将该更新资源包发送至Flutter应用。或者,在确定出该目标字节码文件后,就可以直接生成该目标字节码文件的更新资源包,并将该更新资源包主动下发至Flutter应用。Flutter应用在获取到该更新资源包之后,就可以利用上述应用程序更新方法对该更新资源包进行处理,具体处理此处不再详细描述,以上述实施例为准。In the embodiment of the present disclosure, in response to the Flutter application's acquisition request for the target bytecode file, an updated resource package for the target bytecode file can be generated, and the updated resource package can be sent to the Flutter application. Alternatively, after determining the target bytecode file, you can directly generate an update resource package for the target bytecode file, and actively deliver the update resource package to the Flutter application. After the Flutter application obtains the updated resource package, it can use the above application update method to process the updated resource package. The specific processing will not be described in detail here, and is subject to the above embodiment.
通过上述描述可知,在本公开实施例中,首先可以获取待编译功能的Dart代码,并对该Dart代码进行编译操作,然后,就可以基于编译操作的中间产物生成目标字节码文件,并将该目标字节码文件发送至Flutter应用,以使Flutter应用中的该目标字节码文件进行运行,从而实现该目标字节码文件所对应的功能,进而缩短了Flutter应用的更新流程,提高了更新效率。As can be seen from the above description, in the embodiment of the present disclosure, the Dart code of the function to be compiled can first be obtained, and the Dart code can be compiled. Then, the target bytecode file can be generated based on the intermediate product of the compilation operation, and the target bytecode file can be generated. The target bytecode file is sent to the Flutter application, so that the target bytecode file in the Flutter application can be run, thereby realizing the function corresponding to the target bytecode file, thereby shortening the update process of the Flutter application and improving the efficiency of the Flutter application. Update efficiency.
在一个可选的实施方式中,上述步骤S203,获取所述编译操作所对应的中间产物,具体包括如下过程:In an optional implementation, the above step S203, obtaining the intermediate product corresponding to the compilation operation, specifically includes the following process:
获取所述Dart代码文件编译过程中的动态链接库文件,并将所述动态链接库文件确定为所述编译操作所对应的中间产物。Obtain the dynamic link library file during the compilation process of the Dart code file, and determine the dynamic link library file as the intermediate product corresponding to the compilation operation.
在本公开实施例中,由图3可知,在获取到上述Dart代码之后,就可以通过对该Dart代码进行语法分析以及词法分析,从而得到中间产物。具体实施时,对上述Dart代码进行语法分析以及词法分析后,首先可以得到该Dart代码的动态链接库文件(也即,dill文件),然后,就可以将该动态链接库文件确定为中间产物,其中,该动态链接库文件可以为中间编译文件(即:kernel产物)。 In the embodiment of the present disclosure, as can be seen from Figure 3, after obtaining the above Dart code, the intermediate product can be obtained by performing syntax analysis and lexical analysis on the Dart code. During specific implementation, after performing syntax analysis and lexical analysis on the above Dart code, first the dynamic link library file (that is, the dill file) of the Dart code can be obtained, and then the dynamic link library file can be determined as an intermediate product. Among them, the dynamic link library file can be an intermediate compiled file (ie: kernel product).
在本公开实施例中,首先需要对上述Dart代码进行语法分析以及词法分析。具体的,上述语法分析可以用于识别Dart代码的单词序列,并分别分析该Dart代码的单词序列是否符合Dart语言的语法。另外的,上述词法分析可以用于识别Dart代码中的字符,并分析该别Dart代码中的字符是否符合Dart代码的要求。In the embodiment of the present disclosure, it is first necessary to perform syntactic analysis and lexical analysis on the above Dart code. Specifically, the above syntax analysis can be used to identify the word sequence of the Dart code, and separately analyze whether the word sequence of the Dart code conforms to the grammar of the Dart language. In addition, the above lexical analysis can be used to identify characters in Dart code and analyze whether the characters in the Dart code meet the requirements of Dart code.
这里,在该Dart代码中的单词序列不符合Dart语言的语法,或者Dart代码中的字符不符合Dart代码的要求的情况下,可以对该Dart代码进行修改,从而使得修改后的Dart代码能够被正常编译。Here, if the word sequence in the Dart code does not conform to the grammar of the Dart language, or the characters in the Dart code do not meet the requirements of the Dart code, the Dart code can be modified so that the modified Dart code can be Compiles normally.
在对上述Dart代码进行语法分析以及词法分析后,就可以对该Dart代码进行编译,得到该Dart代码的动态链接库文件(也即,dill文件),并将所述动态链接库文件确定为中间产物。After performing syntax analysis and lexical analysis on the above Dart code, the Dart code can be compiled to obtain the dynamic link library file (that is, the dill file) of the Dart code, and the dynamic link library file is determined as the intermediate product.
通过上述描述可知,通过获取Dart代码编译过程中的动态链接库文件的方式,就可以将该动态链接库文件确定为中间产物,从而使得上述Dart编译器能够针对该中间产物进行编译,得到目标字节码文件。It can be seen from the above description that by obtaining the dynamic link library file during the Dart code compilation process, the dynamic link library file can be determined as an intermediate product, so that the above Dart compiler can compile the intermediate product and obtain the target word Section code file.
在一个可选的实施方式中,上述步骤S205,将所述目标字节码文件发送至Flutter应用,具体包括如下过程:In an optional implementation, the above step S205, sending the target bytecode file to the Flutter application, specifically includes the following process:
S2051:接收所述Flutter应用中针对目标功能标识的触发操作,并确定所述触发操作所对应的目标功能。S2051: Receive the trigger operation for the target function identifier in the Flutter application, and determine the target function corresponding to the trigger operation.
在本公开实施例中,目标功能标识可以为上述功能入口。Flutter应用在检测到针对该目标功能标识的触发操作后,首先会确定该目标功能标识所对应的目标功能,并在本地文件中查找该目标功能所对应的目标字节码文件。In this embodiment of the present disclosure, the target function identifier may be the above-mentioned function entry. After the Flutter application detects the trigger operation for the target function identifier, it will first determine the target function corresponding to the target function identifier, and search for the target bytecode file corresponding to the target function in the local file.
在未查找到该目标字节码文件的情况下,就可以向服务器发送针对该目标字节码文件的获取请求,其中,该获取请求中携带该目标功能标识所对应的目标功能的功能标记,以使服务器基于该获取请求确定触发操作所对应的目标功能。If the target bytecode file is not found, an acquisition request for the target bytecode file can be sent to the server, where the acquisition request carries the function tag of the target function corresponding to the target function identifier, So that the server determines the target function corresponding to the trigger operation based on the acquisition request.
S2052:获取所述目标功能所对应的目标字节码文件,并将所述目标字节码文件传输至所述Flutter应用进行解码。S2052: Obtain the target bytecode file corresponding to the target function, and transmit the target bytecode file to the Flutter application for decoding.
在本公开实施例中,如图4所示为服务器和Flutter应用之间交互的示意图。其中,该目标功能中可以包含多个页面,服务器在获取到该目标功能所对应的目标字节码文件之后,就可以生成该目标字节码文件的更新资源包,并将该更新资源包传输至Flutter应用。In this embodiment of the present disclosure, Figure 4 is a schematic diagram of the interaction between the server and the Flutter application. Among them, the target function can contain multiple pages. After obtaining the target bytecode file corresponding to the target function, the server can generate an update resource package of the target bytecode file and transmit the update resource package. to Flutter application.
Flutter应用在接收到该更新资源包后,就可以通过解压操作获取该更新资源包中的目标字节码文件,并通过解释器运行该目标字节码文件。这里,该Flutter应用由多个页面组成,另外,该Flutter应用中还应包含AOT编译文件等运行文件,Flutter软件开发工具包以及Dart软件开发工具包等。After receiving the updated resource package, the Flutter application can obtain the target bytecode file in the updated resource package through decompression operation, and run the target bytecode file through the interpreter. Here, the Flutter application consists of multiple pages. In addition, the Flutter application should also include running files such as AOT compilation files, Flutter software development toolkit, Dart software development toolkit, etc.
通过上述描述可知,在接收到Flutter应用中针对目标功能标识的触发操作后,就可以确定该触发操作所对应的目标字节码文件,并将该目标字节码文件传输至Flutter应用中,以使该Flutter应用能够运行该目标字节码文件,从而实现该目标字节码文件所对应的目标功能。It can be seen from the above description that after receiving the trigger operation for the target function identifier in the Flutter application, the target bytecode file corresponding to the trigger operation can be determined, and the target bytecode file can be transferred to the Flutter application to Enable the Flutter application to run the target bytecode file, thereby realizing the target function corresponding to the target bytecode file.
在一个可选的实施方式中,如图3所示为Dart编译器对待处理Dart代码文件进行编译 的过程,该方法包括步骤S301~S304。其中:In an optional implementation, as shown in Figure 3, the Dart compiler compiles the Dart code file to be processed. The process includes steps S301 to S304. in:
S301:获取待编译功能的Dart代码;S301: Obtain the Dart code of the function to be compiled;
S302:针对上述Dart代码进行语法分析以及词法分析,得到中间产物;S302: Perform syntax analysis and lexical analysis on the above Dart code to obtain an intermediate product;
在本公开实施例中,针对上述Dart代码进行语法分析以及词法分析如上述步骤S203所对应的实施方式所述,此处不再赘述。In this embodiment of the present disclosure, performing syntax analysis and lexical analysis on the above Dart code is as described in the implementation corresponding to the above step S203, and will not be described again here.
S303:获取预先设定的字节码格式,并按照该预先设定的字节码格式对中间产物进行编译,得到并保存目标字节码文件;S303: Obtain the preset bytecode format, compile the intermediate product according to the preset bytecode format, and obtain and save the target bytecode file;
在本公开实施例中,首先可以获取中间产物中各个组成部分的属性信息,并根据该属性信息所指示的预先设定的字节码格式对该中间产物进行编译,得到目标字节码文件。In the embodiment of the present disclosure, the attribute information of each component in the intermediate product can first be obtained, and the intermediate product can be compiled according to the preset bytecode format indicated by the attribute information to obtain the target bytecode file.
S304:针对上述中间产物进行中间优化以及指令生成,得到AOT编译文件。S304: Perform intermediate optimization and instruction generation on the above intermediate product to obtain the AOT compiled file.
综上,在本公开实施例中,首先可以基于服务器发送的Flutter应用的更新资源包进行解压,得到目标功能的目标字节码文件,然后,在检测到针对该目标功能的运行指令的情况下,就可以通过解释器运行该目标字节码文件,以显示该目标功能所对应的页面,从而实现了针对该Flutter应用的动态更新,缩短了更新流程,提高了更新效率。To sum up, in the embodiment of the present disclosure, first, the update resource package of the Flutter application sent by the server can be decompressed to obtain the target bytecode file of the target function, and then, when the running instruction for the target function is detected , the target bytecode file can be run through the interpreter to display the page corresponding to the target function, thereby realizing dynamic updates for the Flutter application, shortening the update process, and improving update efficiency.
本领域技术人员可以理解,在具体实施方式的上述方法中,各步骤的撰写顺序并不意味着严格的执行顺序而对实施过程构成任何限定,各步骤的具体执行顺序应当以其功能和可能的内在逻辑确定。Those skilled in the art can understand that in the above-mentioned methods of specific embodiments, 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 The internal logic is determined.
基于同一发明构思,本公开实施例中还提供了与应用程序更新方法对应的应用程序更新装置,由于本公开实施例中的装置解决问题的原理与本公开实施例上述应用程序更新方法相似,因此装置的实施可以参见方法的实施,重复之处不再赘述。Based on the same inventive concept, the embodiment of the present disclosure also provides an application update device corresponding to the application update method. Since the principle of solving the problem of the device in the embodiment of the present disclosure is similar to the above-mentioned application update method of the embodiment of the present disclosure, therefore For the implementation of the device, please refer to the implementation of the method, and repeated details will not be repeated.
参照图5所示,为本公开实施例提供的一种应用程序更新的示意图,所述装置包括:接收单元51、解压单元52、运行单元53;其中,Referring to Figure 5, which is a schematic diagram of an application update provided by an embodiment of the present disclosure, the device includes: a receiving unit 51, a decompression unit 52, and an execution unit 53; wherein,
接收单元51,用于接收服务器发送的关于所述Flutter应用的更新资源包;Receiving unit 51, configured to receive an update resource package regarding the Flutter application sent by the server;
解压单元52,用于基于所述更新资源包进行解压操作,得到所述Flutter应用中目标功能的目标字节码文件;所述目标功能为所述Flutter应用中的新增功能;The decompression unit 52 is configured to perform a decompression operation based on the updated resource package to obtain the target bytecode file of the target function in the Flutter application; the target function is a new function in the Flutter application;
运行单元53,用于在检测到针对所述目标功能的运行指令的情况下,通过所述解释器运行所述目标功能的目标字节码文件,以显示所述目标功能所对应的页面。The execution unit 53 is configured to, when an execution instruction for the target function is detected, run the target bytecode file of the target function through the interpreter to display the page corresponding to the target function.
在本公开实施例中,首先可以基于服务器发送的Flutter应用的更新资源包进行解压,得到目标功能的目标字节码文件,然后,在检测到针对该目标功能的运行指令的情况下,就可以通过解释器运行该目标字节码文件,以显示该目标功能所对应的页面,从而实现了针对该Flutter应用的动态更新,缩短了更新流程,提高了更新效率。In the embodiment of the present disclosure, the updated resource package of the Flutter application sent by the server can first be decompressed to obtain the target bytecode file of the target function. Then, when the running instruction for the target function is detected, The target bytecode file is run through the interpreter to display the page corresponding to the target function, thereby realizing dynamic updates for the Flutter application, shortening the update process, and improving update efficiency.
一种可能的实施方式中,在基于所述更新资源包进行解压操作,得到所述Flutter应用中目标功能的目标字节码文件之后,该装置还用于:In a possible implementation, after performing a decompression operation based on the updated resource package to obtain the target bytecode file of the target function in the Flutter application, the device is also used to:
为所述目标功能生成目标修改标识;其中,所述目标修改标记用于指示所述目标功能为新增功能;Generate a target modification flag for the target function; wherein the target modification flag is used to indicate that the target function is a new function;
在目标映射表中查找所述目标功能的功能标记,并基于所述功能标记确定所述目标功能所对应的映射信息; Search the function tag of the target function in the target mapping table, and determine the mapping information corresponding to the target function based on the function tag;
将所述目标修改标记添加至所述映射信息中,其中,所述目标映射表用于指示所述Flutter应用的各功能是否包含对应的字节码文件。The target modification tag is added to the mapping information, where the target mapping table is used to indicate whether each function of the Flutter application includes a corresponding bytecode file.
一种可能的实施方式中,运行单元53,还用于:In a possible implementation, the operation unit 53 is also used to:
在检测到针对所述目标功能的运行指令的情况下,在所述目标映射表中查找所述目标功能的功能标记;When an execution instruction for the target function is detected, searching for the function tag of the target function in the target mapping table;
基于查找到的所述功能标记确定所述目标功能所对应的映射信息,并在所述映射信息中查找所述目标功能的目标修改标识;Determine the mapping information corresponding to the target function based on the found function tag, and search the target modification identifier of the target function in the mapping information;
在查找到所述目标修改标识的情况下,调用所述Flutter应用的解释器,并通过所述解释器运行所述目标功能的目标字节码文件。When the target modification identifier is found, the interpreter of the Flutter application is called, and the target bytecode file of the target function is run through the interpreter.
一种可能的实施方式中,在基于所述更新资源包进行解压操作,得到所述Flutter应用中目标功能的目标字节码文件之后,该装置还用于:In a possible implementation, after performing a decompression operation based on the updated resource package to obtain the target bytecode file of the target function in the Flutter application, the device is also used to:
确定所述目标功能所对应的功能信息;所述功能信息包括以下至少之一:所述目标功能的功能类型信息,所述目标功能的更新时间,所述目标功能的生效时间;Determine the function information corresponding to the target function; the function information includes at least one of the following: function type information of the target function, update time of the target function, and effective time of the target function;
基于所述功能信息,生成所述目标功能的更新提示信息;其中,所述更新提示信息用于指示用户已接收到所述Flutter应用的新增功能的字节码文件;Based on the function information, generate update prompt information of the target function; wherein the update prompt information is used to indicate that the user has received the bytecode file of the new function of the Flutter application;
在所述Flutter应用所在终端设备的显示界面上显示更新提示窗口,并在所述更新提示窗口中展示所述更新提示信息。Display an update prompt window on the display interface of the terminal device where the Flutter application is located, and display the update prompt information in the update prompt window.
一种可能的实施方式中,运行单元53,还用于:In a possible implementation, the operation unit 53 is also used to:
检测用户对所述更新提示窗口中更新提示信息的第一触发操作;Detecting the user's first triggering operation on the update prompt information in the update prompt window;
基于检测到的所述第一触发操作确定所述目标功能所对应页面的页面跳转标识,并在所述更新提示窗口中展示所述页面跳转标识;Determine the page jump identifier of the page corresponding to the target function based on the detected first trigger operation, and display the page jump identifier in the update prompt window;
在检测到用户对所述页面跳转标识的第二触发操作的情况下,在所述终端设备的显示界面上显示所述目标功能所对应页面。When the user's second triggering operation on the page jump identification is detected, the page corresponding to the target function is displayed on the display interface of the terminal device.
参照图6所示,为本公开实施例提供的一种应用程序开发装置的示意图,所述装置包括:确定单元61、获取单元62、发送单元63;其中,Referring to Figure 6 , which is a schematic diagram of an application development device provided by an embodiment of the present disclosure, the device includes: a determination unit 61, an acquisition unit 62, and a sending unit 63; wherein,
确定单元61,用于确定Flutter应用中的待编译功能的Dart代码,并通过所述Dart编译器对所述Dart代码进行编译操作;The determination unit 61 is used to determine the Dart code of the function to be compiled in the Flutter application, and compile the Dart code through the Dart compiler;
获取单元62,用于获取所述编译操作所对应的中间产物,并基于所述中间产物生成所述待编译功能的目标字节码文件;The acquisition unit 62 is used to acquire the intermediate product corresponding to the compilation operation, and generate the target bytecode file of the function to be compiled based on the intermediate product;
发送单元63,用于将所述目标字节码文件发送至Flutter应用,以使所述Flutter应用通过解释器运行所述目标字节码文件。The sending unit 63 is used to send the target bytecode file to the Flutter application, so that the Flutter application runs the target bytecode file through the interpreter.
在本公开实施例中,首先可以获取待编译功能的Dart代码,并对该Dart代码进行编译操作,然后,就可以基于编译操作的中间产物生成目标字节码文件,并将该目标字节码文件发送至Flutter应用,以使Flutter应用中的该目标字节码文件进行运行,从而实现该目标字节码文件所对应的功能,进而缩短了Flutter应用的更新流程,提高了更新效率。In the embodiment of the present disclosure, firstly, the Dart code of the function to be compiled can be obtained, and the Dart code can be compiled. Then, the target bytecode file can be generated based on the intermediate product of the compilation operation, and the target bytecode can be The file is sent to the Flutter application so that the target bytecode file in the Flutter application can be run, thereby realizing the function corresponding to the target bytecode file, thereby shortening the update process of the Flutter application and improving the update efficiency.
一种可能的实施方式中,获取单元62,还用于:In a possible implementation, the acquisition unit 62 is also used to:
获取所述Dart代码文件编译过程中的动态链接库文件,并将所述动态链接库文件确定 为所述编译操作所对应的中间产物。Obtain the dynamic link library file during the compilation process of the Dart code file, and determine the dynamic link library file is the intermediate product corresponding to the compilation operation.
一种可能的实施方式中,发送单元63,还用于:In a possible implementation, the sending unit 63 is also used to:
接收所述Flutter应用中针对目标功能标识的触发操作,并确定所述触发操作所对应的目标功能;Receive the trigger operation for the target function identifier in the Flutter application, and determine the target function corresponding to the trigger operation;
获取所述目标功能所对应的目标字节码文件,并将所述目标字节码文件传输至所述Flutter应用进行解码。Obtain the target bytecode file corresponding to the target function, and transfer the target bytecode file to the Flutter application for decoding.
关于装置中的各单元的处理流程、以及各单元之间的交互流程的描述可以参照上述方法实施例中的相关说明,这里不再详述。For descriptions of the processing flow of each unit in the device and the interaction flow between the units, please refer to the relevant descriptions in the above method embodiments, and will not be described in detail here.
对应于图1中的应用程序更新方法,本公开实施例还提供了一种计算机设备700,如图7所示,为本公开实施例提供的计算机设备700结构示意图,包括:Corresponding to the application update method in Figure 1, an embodiment of the present disclosure also provides a computer device 700. As shown in Figure 7, which is a schematic structural diagram of the computer device 700 provided by an embodiment of the present disclosure, it includes:
处理器71、存储器72、和总线73;存储器72用于存储执行指令,包括内存721和外部存储器722;这里的内存721也称内存储器,用于暂时存放处理器71中的运算数据,以及与硬盘等外部存储器722交换的数据,处理器71通过内存721与外部存储器722进行数据交换,当所述计算机设备700运行时,所述处理器71与所述存储器72之间通过总线73通信,使得所述处理器71执行以下指令:Processor 71, memory 72, and bus 73; memory 72 is used to store execution instructions, including memory 721 and external memory 722; memory 721 here is also called internal memory, and is used to temporarily store operation data in processor 71, and with The processor 71 exchanges data with the external memory 722 such as a hard disk through the memory 721 and the external memory 722. When the computer device 700 is running, the processor 71 and the memory 72 communicate through the bus 73, so that The processor 71 executes the following instructions:
接收服务器发送的关于所述Flutter应用的更新资源包;Receive an updated resource package about the Flutter application sent by the server;
基于所述更新资源包进行解压操作,得到所述Flutter应用中目标功能的目标字节码文件;所述目标功能为所述Flutter应用中的新增功能;Perform a decompression operation based on the updated resource package to obtain the target bytecode file of the target function in the Flutter application; the target function is a new function in the Flutter application;
在检测到针对所述目标功能的运行指令的情况下,通过所述解释器运行所述目标功能的目标字节码文件,以显示所述目标功能所对应的页面。When an execution instruction for the target function is detected, the target bytecode file of the target function is run through the interpreter to display a page corresponding to the target function.
对应于图2中的应用程序更新方法,本公开实施例还提供了另一种计算机设备800,如图8所示,为本公开实施例提供的计算机设备800结构示意图,包括:Corresponding to the application update method in Figure 2, the embodiment of the present disclosure also provides another computer device 800. As shown in Figure 8, which is a schematic structural diagram of the computer device 800 provided by the embodiment of the present disclosure, it includes:
处理器81、存储器82、和总线83;存储器82用于存储执行指令,包括内存821和外部存储器822;这里的内存821也称内存储器,用于暂时存放处理器81中的运算数据,以及与硬盘等外部存储器822交换的数据,处理器81通过内存821与外部存储器822进行数据交换,当所述计算机设备800运行时,所述处理器81与所述存储器82之间通过总线83通信,使得所述处理器81执行以下指令: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 and the external memory 822. When the computer device 800 is running, the processor 81 and the memory 82 communicate through the bus 83, so that The processor 81 executes the following instructions:
确定Flutter应用中的待编译功能的Dart代码,并通过所述Dart编译器对所述Dart代码进行编译操作;Determine the Dart code of the function to be compiled in the Flutter application, and compile the Dart code through the Dart compiler;
获取所述编译操作所对应的中间产物,并基于所述中间产物生成所述待编译功能的目标字节码文件;Obtain the intermediate product corresponding to the compilation operation, and generate the target bytecode file of the function to be compiled based on the intermediate product;
将所述目标字节码文件发送至Flutter应用,以使所述Flutter应用通过解释器运行所述目标字节码文件。The target bytecode file is sent to the Flutter application, so that the Flutter application runs the target bytecode file through an interpreter.
本公开实施例还提供一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序,该计算机程序被处理器运行时执行上述方法实施例中所述的应用程序更新、应用程序开发方法的步骤。其中,该存储介质可以是易失性或非易失的计算机可读取存储介质。Embodiments of the present disclosure also provide a computer-readable storage medium. A computer program is stored on the computer-readable storage medium. When the computer program is run by a processor, the application update and application development described in the above method embodiments are executed. Method steps. Wherein, 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 The instructions included in the program code can be used to execute the steps of the application update and application development methods described in the above method embodiments. For details, please refer to the above method embodiments, which will not be described again here.
其中,上述计算机程序产品可以具体通过硬件、软件或其结合的方式实现。在一个可选实施例中,所述计算机程序产品具体体现为计算机存储介质,在另一个可选实施例中,计算机程序产品具体体现为软件产品,例如软件开发包(Software Development Kit,SDK)等等。Among them, the above-mentioned computer program product can be specifically implemented by hardware, software or a combination thereof. In an optional embodiment, the computer program product is embodied as a computer storage medium. In another optional embodiment, the computer program product is embodied as a software product, such as a Software Development Kit (SDK), etc. wait.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统和装置的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。在本公开所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,又例如,多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些通信接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems and devices described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be described again here. In the several embodiments provided in this disclosure, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or can be integrated into another system, or some features can be ignored, or not implemented. On the other hand, the coupling or direct coupling or communication connection between each other shown or discussed may be through some communication interfaces, and the indirect coupling or communication connection of the devices or units may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or they may be distributed to 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.
另外,在本公开各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, 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.
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个处理器可执行的非易失的计算机可读取存储介质中。基于这样的理解,本公开的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本公开各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If 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. Based on this understanding, 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. .
最后应说明的是:以上所述实施例,仅为本公开的具体实施方式,用以说明本公开的技术方案,而非对其限制,本公开的保护范围并不局限于此,尽管参照前述实施例对本公开进行了详细的说明,本领域的普通技术人员应当理解:任何熟悉本技术领域的技术人员在本公开揭露的技术范围内,其依然可以对前述实施例所记载的技术方案进行修改或可轻易想到变化,或者对其中部分技术特征进行等同替换;而这些修改、变化或者替换,并不使相应技术方案的本质脱离本公开实施例技术方案的精神和范围,都应涵盖在本公开的保护范围之内。因此,本公开的保护范围应所述以权利要求的保护范围为准。 Finally, it should be noted that the above-mentioned embodiments are only specific implementations of the present disclosure and are used to illustrate the technical solutions of the present disclosure rather than to limit them. The protection scope of the present disclosure is not limited thereto. Although refer to the foregoing The embodiments describe the present disclosure in detail. Those of ordinary skill in the art should understand that any person familiar with the technical field can still modify the technical solutions recorded in the foregoing embodiments within the technical scope disclosed in the present disclosure. Changes may be easily thought of, or equivalent substitutions may be made to some of the technical features; and these modifications, changes or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and shall be included in the present disclosure. within the scope of protection. Therefore, the protection scope of the present disclosure should be determined by the protection scope of the claims.

Claims (12)

  1. 一种应用程序更新方法,其特征在于,应用于安装有解释器的Flutter应用,包括:An application update method, characterized in that it is applied to a Flutter application with an interpreter installed, including:
    接收服务器发送的关于所述Flutter应用的更新资源包;Receive an updated resource package about the Flutter application sent by the server;
    基于所述更新资源包进行解压操作,得到所述Flutter应用中目标功能的目标字节码文件;所述目标功能为所述Flutter应用中的新增功能;Perform a decompression operation based on the updated resource package to obtain the target bytecode file of the target function in the Flutter application; the target function is a new function in the Flutter application;
    在检测到针对所述目标功能的运行指令的情况下,通过所述解释器运行所述目标功能的目标字节码文件,以显示所述目标功能所对应的页面。When an execution instruction for the target function is detected, the target bytecode file of the target function is run through the interpreter to display a page corresponding to the target function.
  2. 根据权利要求1所述的方法,其特征在于,在基于所述更新资源包进行解压操作,得到所述Flutter应用中目标功能的目标字节码文件之后,所述方法还包括:The method according to claim 1, characterized in that, after performing a decompression operation based on the updated resource package to obtain the target bytecode file of the target function in the Flutter application, the method further includes:
    为所述目标功能生成目标修改标识;其中,所述目标修改标记用于指示所述目标功能为新增功能;Generate a target modification flag for the target function; wherein the target modification flag is used to indicate that the target function is a new function;
    在目标映射表中查找所述目标功能的功能标记,并基于所述功能标记确定所述目标功能所对应的映射信息;Search the function tag of the target function in the target mapping table, and determine the mapping information corresponding to the target function based on the function tag;
    将所述目标修改标记添加至所述映射信息中,其中,所述目标映射表用于指示所述Flutter应用的各功能是否包含对应的字节码文件。The target modification tag is added to the mapping information, where the target mapping table is used to indicate whether each function of the Flutter application includes a corresponding bytecode file.
  3. 根据权利要求2所述的方法,其特征在于,所述在检测到针对所述目标功能的运行指令的情况下,通过所述解释器运行所述目标功能的目标字节码文件,以显示所述目标功能所对应的页面,包括:The method according to claim 2, characterized in that when an execution instruction for the target function is detected, the target bytecode file of the target function is run through the interpreter to display the target function. The pages corresponding to the above target functions include:
    在检测到针对所述目标功能的运行指令的情况下,在所述目标映射表中查找所述目标功能的功能标记;When an execution instruction for the target function is detected, searching for the function tag of the target function in the target mapping table;
    基于查找到的所述功能标记确定所述目标功能所对应的映射信息,并在所述映射信息中查找所述目标功能的目标修改标识;Determine the mapping information corresponding to the target function based on the found function tag, and search the target modification identifier of the target function in the mapping information;
    在查找到所述目标修改标识的情况下,调用所述Flutter应用的解释器,并通过所述解释器运行所述目标功能的目标字节码文件。When the target modification identifier is found, the interpreter of the Flutter application is called, and the target bytecode file of the target function is run through the interpreter.
  4. 根据权利要求1所述的方法,其特征在于,在基于所述更新资源包进行解压操作,得到所述Flutter应用中目标功能的目标字节码文件之后,所述方法还包括:The method according to claim 1, characterized in that, after performing a decompression operation based on the updated resource package to obtain the target bytecode file of the target function in the Flutter application, the method further includes:
    确定所述目标功能所对应的功能信息;所述功能信息包括以下至少之一:所述目标功能的功能类型信息,所述目标功能的更新时间,所述目标功能的生效时间;Determine the function information corresponding to the target function; the function information includes at least one of the following: function type information of the target function, update time of the target function, and effective time of the target function;
    基于所述功能信息,生成所述目标功能的更新提示信息;其中,所述更新提示信息用于指示用户已接收到所述Flutter应用的新增功能的字节码文件;Based on the function information, generate update prompt information of the target function; wherein the update prompt information is used to indicate that the user has received the bytecode file of the new function of the Flutter application;
    在所述Flutter应用所在终端设备的显示界面上显示更新提示窗口,并在所述更新提示窗口中展示所述更新提示信息。Display an update prompt window on the display interface of the terminal device where the Flutter application is located, and display the update prompt information in the update prompt window.
  5. 根据权利要求4所述的方法,其特征在于,所述检测到针对所述目标功能的运行指令,包括:The method according to claim 4, characterized in that the detection of an operation instruction for the target function includes:
    检测用户对所述更新提示窗口中更新提示信息的第一触发操作;Detecting the user's first triggering operation on the update prompt information in the update prompt window;
    基于检测到的所述第一触发操作确定所述目标功能所对应页面的页面跳转标识,并在所述更新提示窗口中展示所述页面跳转标识; Determine the page jump identifier of the page corresponding to the target function based on the detected first trigger operation, and display the page jump identifier in the update prompt window;
    在检测到用户对所述页面跳转标识的第二触发操作的情况下,在所述终端设备的显示界面上显示所述目标功能所对应页面。When the user's second triggering operation on the page jump identification is detected, the page corresponding to the target function is displayed on the display interface of the terminal device.
  6. 一种应用程序开发方法,其特征在于,应用于服务器,所述服务器中包含Dart编译器,包括:An application development method, characterized in that it is applied to a server, and the server contains a Dart compiler, including:
    确定Flutter应用中的待编译功能的Dart代码,并通过所述Dart编译器对所述Dart代码进行编译操作;Determine the Dart code of the function to be compiled in the Flutter application, and compile the Dart code through the Dart compiler;
    获取所述编译操作所对应的中间产物,并基于所述中间产物生成所述待编译功能的目标字节码文件;Obtain the intermediate product corresponding to the compilation operation, and generate the target bytecode file of the function to be compiled based on the intermediate product;
    将所述目标字节码文件发送至Flutter应用,以使所述Flutter应用通过解释器运行所述目标字节码文件。The target bytecode file is sent to the Flutter application, so that the Flutter application runs the target bytecode file through the interpreter.
  7. 根据权利要求6所述的方法,其特征在于,所述获取所述编译操作所对应的中间产物,包括:The method according to claim 6, wherein obtaining the intermediate product corresponding to the compilation operation includes:
    获取所述Dart代码文件编译过程中的动态链接库文件,并将所述动态链接库文件确定为所述编译操作所对应的中间产物。Obtain the dynamic link library file during the compilation process of the Dart code file, and determine the dynamic link library file as the intermediate product corresponding to the compilation operation.
  8. 根据权利要求6所述的方法,其特征在于,所述将所述目标字节码文件发送至Flutter应用,包括:The method of claim 6, wherein sending the target bytecode file to the Flutter application includes:
    接收所述Flutter应用中针对目标功能标识的触发操作,并确定所述触发操作所对应的目标功能;Receive the trigger operation for the target function identifier in the Flutter application, and determine the target function corresponding to the trigger operation;
    获取所述目标功能所对应的目标字节码文件,并将所述目标字节码文件传输至所述Flutter应用进行解码。Obtain the target bytecode file corresponding to the target function, and transfer the target bytecode file to the Flutter application for decoding.
  9. 一种应用程序更新装置,其特征在于,包括:An application updating device, characterized by including:
    接收单元,用于接收服务器发送的关于Flutter应用的更新资源包;The receiving unit is used to receive the updated resource package for the Flutter application sent by the server;
    解压单元,用于基于所述更新资源包进行解压操作,得到所述Flutter应用中目标功能的目标字节码文件;所述目标功能为所述Flutter应用中的新增功能;A decompression unit, configured to perform a decompression operation based on the updated resource package to obtain a target bytecode file of a target function in the Flutter application; the target function is a new function in the Flutter application;
    运行单元,用于在检测到针对所述目标功能的运行指令的情况下,通过解释器运行所述目标功能的目标字节码文件,以显示所述目标功能所对应的页面。An execution unit, configured to run the target bytecode file of the target function through an interpreter to display the page corresponding to the target function when an execution instruction for the target function is detected.
  10. 一种应用程序开发装置,其特征在于,包括:An application development device, characterized by including:
    确定单元,用于确定Flutter应用中的待编译功能的Dart代码,并通过所述Dart编译器对所述Dart代码进行编译操作;A determination unit, used to determine the Dart code of the function to be compiled in the Flutter application, and compile the Dart code through the Dart compiler;
    获取单元,用于获取所述编译操作所对应的中间产物,并基于所述中间产物生成所述待编译功能的目标字节码文件;An acquisition unit, configured to acquire an intermediate product corresponding to the compilation operation, and generate a target bytecode file of the function to be compiled based on the intermediate product;
    发送单元,用于将所述目标字节码文件发送至Flutter应用,以使所述Flutter应用通过解释器运行所述目标字节码文件。A sending unit, configured to send the target bytecode file to the Flutter application, so that the Flutter application runs the target bytecode file through an interpreter.
  11. 一种计算机设备,其特征在于,包括:处理器、存储器和总线,所述存储器存储有所述处理器可执行的机器可读指令,当计算机设备运行时,所述处理器与所述存储器之间通过总线通信,所述机器可读指令被所述处理器执行时执行如权利要求1至5任意一项所述的应用程序更新方法的步骤,或者,执行如权利要求6至8任意一项所述的应用程序 开发方法的步骤。A computer device, characterized in that it includes: a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the computer device is running, the connection between the processor and the memory is Through bus communication, when the machine-readable instructions are executed by the processor, the steps of the application program update method according to any one of claims 1 to 5 are performed, or, the steps of any one of claims 6 to 8 are performed. The application Steps in developing a method.
  12. 一种计算机可读存储介质,其特征在于,该计算机可读存储介质上存储有计算机程序,该计算机程序被处理器运行时执行如权利要求1至5任意一项所述的应用程序更新方法的步骤,或者,执行如权利要求6至8任意一项所述的应用程序开发方法的步骤。 A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, and the computer program executes the application update method as described in any one of claims 1 to 5 when run by a processor. step, or perform the steps of the application development method according to any one of claims 6 to 8.
PCT/CN2023/078022 2022-03-22 2023-02-24 Application program updating method and apparatus, application program development method and apparatus, and computer device WO2023179298A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210290010.8 2022-03-22
CN202210290010.8A CN114610364A (en) 2022-03-22 2022-03-22 Application program updating method, application program developing method, application program updating device, application program developing device and computer equipment

Publications (1)

Publication Number Publication Date
WO2023179298A1 true WO2023179298A1 (en) 2023-09-28

Family

ID=81864684

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/078022 WO2023179298A1 (en) 2022-03-22 2023-02-24 Application program updating method and apparatus, application program development method and apparatus, and computer device

Country Status (2)

Country Link
CN (1) CN114610364A (en)
WO (1) WO2023179298A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114610364A (en) * 2022-03-22 2022-06-10 北京字节跳动网络技术有限公司 Application program updating method, application program developing method, application program updating device, application program developing device and computer equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6637025B1 (en) * 1998-12-03 2003-10-21 International Business Machines Corporation Dynamic selection/definition of which class/methods should or should not be jit'ed using information stored in a jar file
CN107784231A (en) * 2016-08-24 2018-03-09 北京花甲科技有限公司 The execution of instruction and on-the-flier compiler method, apparatus and electronic equipment
CN111381852A (en) * 2020-03-10 2020-07-07 江苏满运软件科技有限公司 Application dynamic updating method and device based on Flutter, storage medium and electronic equipment
CN114610364A (en) * 2022-03-22 2022-06-10 北京字节跳动网络技术有限公司 Application program updating method, application program developing method, application program updating device, application program developing device and computer equipment

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108415719B (en) * 2018-03-29 2019-03-19 网易(杭州)网络有限公司 The hot update method of code and device, storage medium, processor and terminal
CN113918195A (en) * 2021-11-19 2022-01-11 中电金信软件有限公司 Application interface updating method and device, electronic equipment and readable storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6637025B1 (en) * 1998-12-03 2003-10-21 International Business Machines Corporation Dynamic selection/definition of which class/methods should or should not be jit'ed using information stored in a jar file
CN107784231A (en) * 2016-08-24 2018-03-09 北京花甲科技有限公司 The execution of instruction and on-the-flier compiler method, apparatus and electronic equipment
CN111381852A (en) * 2020-03-10 2020-07-07 江苏满运软件科技有限公司 Application dynamic updating method and device based on Flutter, storage medium and electronic equipment
CN114610364A (en) * 2022-03-22 2022-06-10 北京字节跳动网络技术有限公司 Application program updating method, application program developing method, application program updating device, application program developing device and computer equipment

Also Published As

Publication number Publication date
CN114610364A (en) 2022-06-10

Similar Documents

Publication Publication Date Title
US8959106B2 (en) Class loading using java data cartridges
US11599346B2 (en) Accessing a migrated member in an updated type
WO2017067175A1 (en) Method, apparatus and device for loading elf file, and computer storage medium
CN110704063B (en) Method and device for compiling and executing intelligent contract
JP2020509443A (en) System and method for implementing a native contract on a blockchain
US10140119B2 (en) Modular serialization
US20160232017A1 (en) System and Method for Reloading Constructors
CN110688122B (en) Method and device for compiling and executing intelligent contract
CN110704064B (en) Method and device for compiling and executing intelligent contract
US10303449B2 (en) Compiling non-native constants
CN107643893B (en) Program detection method and device
EP3607432B1 (en) Flow-based scoping
WO2023179298A1 (en) Application program updating method and apparatus, application program development method and apparatus, and computer device
US9038033B1 (en) Techniques and mechanisms for web application minification
US7966600B2 (en) Distributed resource understanding tool management
WO2022038461A1 (en) Method and system for identifying and extracting independent services from a computer program
KR20190080445A (en) Whitelist construction method for analyzing malicious code, computer readable medium and device for performing the method
EP3211526A1 (en) Compilation cache with imports scanner
US20170075668A1 (en) Methods and Systems for Generating Client-Server Applications for Target Devices
CN105793864A (en) System and method of detecting malicious multimedia files
US11366657B2 (en) Inferring code deprecation from module deprecation
WO2023169164A1 (en) Method and apparatus for restoring application program, and computer device and storage medium
US8185885B2 (en) Providing recovery data for program code
CN109426546B (en) Application starting method and device, computer storage medium and equipment
US10394610B2 (en) Managing split packages in a module system

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: 23773549

Country of ref document: EP

Kind code of ref document: A1