WO2022199111A1 - Procédé et appareil pour mettre en oeuvre des fonctions dans un programme d'application, dispositif électronique et support de stockage - Google Patents

Procédé et appareil pour mettre en oeuvre des fonctions dans un programme d'application, dispositif électronique et support de stockage Download PDF

Info

Publication number
WO2022199111A1
WO2022199111A1 PCT/CN2021/135062 CN2021135062W WO2022199111A1 WO 2022199111 A1 WO2022199111 A1 WO 2022199111A1 CN 2021135062 W CN2021135062 W CN 2021135062W WO 2022199111 A1 WO2022199111 A1 WO 2022199111A1
Authority
WO
WIPO (PCT)
Prior art keywords
application program
platform
program interface
event
cross
Prior art date
Application number
PCT/CN2021/135062
Other languages
English (en)
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 WO2022199111A1 publication Critical patent/WO2022199111A1/fr

Links

Images

Classifications

    • 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/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4482Procedural
    • G06F9/4484Executing subprograms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • G06F8/427Parsing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/76Adapting program code to run in a different environment; Porting

Definitions

  • the embodiments of the present disclosure relate to the field of electronic technologies, and in particular, to a method, an apparatus, an electronic device, and a storage medium for implementing functions in an application program.
  • the present disclosure relates to a method, device, server and readable storage medium for implementing functions in an application program, which can safely implement a set of codes to support a development scheme of multiple different platforms without using a native platform.
  • a method for implementing functions in an application program including: monitoring and acquiring a first event of an application program; determining a cross-platform application program interface corresponding to the first event; At least one platform application program interface of the function corresponding to the event is encapsulated, and each platform application program interface corresponds to one operating environment; the platform application program interface corresponding to the current operating environment is called through the cross-platform application program interface, so as to realize the first event corresponding function.
  • calling the platform application program interface corresponding to the current operating environment through the cross-platform application program interface to realize the function of the target event including: using the preset engine to call the platform application corresponding to the current operating environment through the cross-platform application program interface
  • the program interface is used to realize the function corresponding to the first event.
  • the method further includes: obtaining a software package corresponding to the application; compiling and parsing the software package to construct a cross-platform application interface layer including multiple cross-platform application interfaces, including multiple platform application programs.
  • first platform application program interface in at least one platform application program interface; the first platform application program interface is obtained by extending corresponding functions on the basis of the native application program interface.
  • the method further includes: monitoring and acquiring a second event of the application; determining a plug-in corresponding to the second event; and running the plug-in to implement a function corresponding to the second event.
  • calling the platform application program interface corresponding to the current operating environment through the cross-platform application program interface to realize the function corresponding to the first event including: calling the platform application program interface corresponding to the current operating environment through the cross-platform application program interface , obtain the platform resources required for the first event; the platform resources include any one or more of the following: network resources, GPU resources, CPU resources, file IO resources, memory resources, and cross-process communication resources; load platform resources to achieve The function corresponding to the first event.
  • an apparatus for implementing functions in an application program including a monitoring module, a determination module and a processing module.
  • the monitoring module is configured to monitor and obtain the first event of the application;
  • the determining module is configured to determine the cross-platform application program interface corresponding to the first event obtained by the monitoring module;
  • the function corresponding to an event is obtained by encapsulating at least one platform application program interface, and each platform application program interface corresponds to one operating environment;
  • the processing module is configured to call the current operating environment through the cross-platform application program interface determined by the determination module.
  • the platform application program interface is used to realize the function corresponding to the first event.
  • the processing module is specifically configured to use the preset engine to call the platform application program interface corresponding to the current operating environment through the cross-platform application program interface determined by the determination module, so as to realize the function corresponding to the first event.
  • the device further includes an acquisition module; the acquisition module is configured to: acquire a software package corresponding to the application; compile and parse the software package to construct a cross-platform application interface layer including multiple cross-platform application interfaces , including a platform API layer with multiple platform APIs and an engine layer including a preset engine; each cross-platform API corresponds to an event, and each platform API can implement a function corresponding to an event , each event corresponds to multiple target platform application program interfaces, and each target platform application program interface corresponds to one operating environment.
  • the acquisition module is configured to: acquire a software package corresponding to the application; compile and parse the software package to construct a cross-platform application interface layer including multiple cross-platform application interfaces , including a platform API layer with multiple platform APIs and an engine layer including a preset engine; each cross-platform API corresponds to an event, and each platform API can implement a function corresponding to an event , each event corresponds to multiple target platform application program interfaces, and each target platform application program interface corresponds to one operating
  • first platform application program interface in at least one platform application program interface; the first platform application program interface is obtained by extending corresponding functions on the basis of the native application program interface.
  • the monitoring module is also configured to monitor and acquire the second event of the application; the determination module is also configured to determine the plug-in corresponding to the second event acquired by the monitoring module; the processing module is also configured to run the event determined by the determination module.
  • a plug-in to implement the function corresponding to the second event.
  • the processing module is specifically configured to: call the platform application program interface corresponding to the current operating environment through the cross-platform application program interface to obtain the platform resources required by the first event;
  • the platform resources include any one or more of the following: Network resources, GPU resources, CPU resources, file IO resources, memory resources, and cross-process communication resources; load platform resources to implement the function corresponding to the first event.
  • the present disclosure provides an electronic device, the electronic device comprising a processor and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions, so as to implement any of the methods provided in the first aspect and any thereof.
  • the present disclosure provides a computer-readable storage medium on which instructions are stored, and when the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is made to execute the In one aspect, a method for implementing functions in an application program of any possible implementation manner thereof is provided.
  • an embodiment of the present application further provides a computer program product, including one or more instructions, and the one or more instructions can be executed on an electronic device, so that the electronic device executes the first aspect and any of its possibilities.
  • the device for implementing the method for implementing the functions in the application will first determine the cross-platform application corresponding to the first time. program interface; because the cross-platform application program interface is encapsulated by at least one platform application program interface having the function corresponding to the first event, and each platform application program interface corresponds to one operating environment; The platform application program interface corresponding to the running environment of the platform where the application program is currently located is called through the cross-platform application program interface, thereby realizing the function corresponding to the first time.
  • the application program can normally implement corresponding functions on various platforms or operating environments, thereby improving user experience.
  • developers can develop corresponding applications for applications that need to be cross-platform without relying on multiple native platforms, which improves development efficiency.
  • FIG. 1 is a schematic diagram of an implementation environment provided by an embodiment of the present disclosure
  • FIG. 2 is a schematic flowchart 1 of a method for implementing functions in an application program provided by an embodiment of the present disclosure
  • FIG. 3 is a second schematic flowchart of a method for implementing functions in an application program provided by an embodiment of the present disclosure
  • FIG. 4 is a schematic flowchart three of a method for implementing functions in an application program provided by an embodiment of the present disclosure
  • FIG. 5 is a schematic flowchart 1 of an application development method provided by an embodiment of the present disclosure.
  • FIG. 6 is a schematic structural diagram of a runtime container according to an embodiment of the present disclosure.
  • FIG. 7 is a second schematic flowchart of an application development method provided by an embodiment of the present disclosure.
  • FIG. 8 is a third schematic flowchart of an application development method provided by an embodiment of the present disclosure.
  • FIG. 9 is a fourth schematic flowchart of a method for developing an application program provided by an embodiment of the present disclosure.
  • FIG. 10 is a supplementary flowchart diagram 1 of a method for implementing functions in an application program provided by an embodiment of the present disclosure
  • FIG. 11 is a schematic flowchart five of a method for developing an application program provided by an embodiment of the present disclosure.
  • FIG. 12 is a second supplementary flowchart of a method for implementing functions in an application program provided by an embodiment of the present disclosure
  • FIG. 13 is a schematic structural diagram of an apparatus for implementing functions in an application program provided by an embodiment of the present disclosure
  • FIG. 14 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
  • FIG. 15 is a schematic structural diagram of another electronic device according to an embodiment of the present disclosure.
  • the data involved in this disclosure may be data authorized by the user or fully authorized by all parties.
  • Flutter It is Google's open source UI (user interface, user interface) toolkit, which helps developers efficiently build multi-platform beautiful applications through a set of code bases, supporting mobile, Web (world wide web, World Wide Web), desktop and embedded platforms.
  • Flutter Engine is a portable runtime for running high-quality mobile applications. It implements Flutter's core libraries, animation and graphics, file and network I/O, supports accessibility, a plugin architecture, and the Dart runtime and development tools for developing, compiling, and running Flutter applications.
  • API The full name is application programming interface, that is, application programming interface or application programming interface. It is some pre-defined interfaces (such as functions, HTTP interfaces), or refers to the conventions for the connection of different components of a software system, which are used to provide application programs and development. A set of routines that a person can access based on a piece of software or hardware without having access to the source code or understanding the details of the inner workings.
  • Runtime container The runtime environment required by the software during the runtime, and the runtime environment contains various functions required for the software to run.
  • SDK The full name is software development kit, that is, software development kit, which is a collection of development tools used by software engineers to create application software for specific software packages, software frameworks, hardware platforms, operating systems, etc.
  • Dart A computer programming language developed by Google. It is an object-oriented, class-defined, and single-inheritance language.
  • FIG. 1 it is a schematic diagram of an implementation environment that the technical solutions provided by the embodiments of the present disclosure may involve.
  • the implementation environment may include a client 01 and a server 02, and the client 01 communicates with the server 02 through wired communication or wireless communication.
  • the client 01 in the embodiment of the present disclosure may be a mobile phone, a tablet computer, a desktop type, a laptop type, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, and Cell phones, personal digital assistants (personal digital assistants, PDAs), augmented reality (augmented reality, AR) ⁇ virtual reality (virtual reality, VR) devices and other devices that can be used for project development, the specific form of the client in the embodiments of the present application No special restrictions are imposed.
  • the server 02 in the present disclosure may be a server, a server cluster composed of multiple servers, or a cloud computing service center, which is not limited in the present disclosure.
  • the server 02 is mainly used to receive the content request of the application program sent by the client and return the corresponding content, as well as to receive the development request and code sent by the client, and use the framework set by itself to complete the construction of the application.
  • the present disclosure provides a method for implementing functions in an application program, which can conveniently realize the normal use of an application program in different operating environments by using a cross-platform application program interface.
  • the specific execution body of the method may be the above-mentioned client or the above-mentioned server, which is determined according to actual needs.
  • client refers to a terminal used by developers
  • server may be a terminal used by developers or communicate with developers through a terminal used by themselves, depending on the situation Interactive server.
  • an embodiment of the present disclosure provides a schematic flowchart of a method for implementing functions in an application program.
  • the method is executed by means for implementing functions in the application, and when the means for implementing functions in the application is a client or a part of the client, the method may include 201-203:
  • the first event may be a click on a control (for example, "play”, “share”, “forward”, etc.) in the display interface of the application when the user is using a certain application; or the application Relevant events generated by the program after receiving the corresponding function triggered by the user; there is no specific limitation on this in this application, and it depends on the actual situation.
  • a control for example, "play”, “share”, “forward”, etc.
  • step 201 may also be to acquire the record information of the first event to represent the first event.
  • the record information of the first event may be acquired from a database that records record information for storing various events.
  • the record information of the first event may be description information of the first event.
  • the recording information of the first event may include the recording time of the first event, the attribute of the first event, the content description of the first event, and the like.
  • the cross-platform application program interface is encapsulated and obtained by at least one platform application program interface having a function corresponding to the first event, and each platform application program interface corresponds to a running surroundings.
  • the fast platform application program interface corresponding to the first event may be a platform capable of rendering the target image in the Android platform, the ios platform and the Microsoft platform.
  • Application program interface package is obtained.
  • the specific packaging manner can be any feasible manner.
  • the operating environment and the platform are in one-to-one correspondence, that is, each platform only corresponds to its own operating environment.
  • the device for implementing the method for implementing the functions in the application will first determine the cross-platform application interface corresponding to the first time; because The cross-platform application program interface is encapsulated by at least one platform application program interface having a function corresponding to the first event, and each platform application program interface corresponds to one operating environment; therefore, the device can pass the cross-platform application program interface.
  • the application program interface invokes the platform application program interface corresponding to the running environment of the platform where the application program is currently located, so as to realize the function corresponding to the first time.
  • the application program can normally implement corresponding functions on various platforms or operating environments, thereby improving user experience.
  • developers can develop corresponding applications for applications that need to be cross-platform without relying on multiple native platforms, which improves development efficiency.
  • step 203 may specifically be:
  • the preset engine may be a flutter engine.
  • step 203 may specifically include steps 2031 and 2032:
  • the platform resources include any one or more of the following: network resources, GPU resources, CPU resources, file IO resources, memory resources, and cross-process communication resources;
  • the corresponding platform API can be obtained at the first time to obtain the corresponding platform resources to smoothly implement the corresponding functions.
  • the platform API is not called directly, it needs to go through the flutter engine, and the flutter engine will pre-set the calling rules, which cannot be called arbitrarily, which ensures the security of the application during use.
  • step 201 in order to enable the client to implement the technical solutions provided by the foregoing embodiments, with reference to FIG. 2 and as shown in FIG. 3 , before step 201 , 200A and 200B may also be included:
  • the software packages here can be jar packages and so files.
  • each cross-platform application program interface corresponds to an event
  • each platform application program interface can implement a function corresponding to an event
  • each event corresponds to a variety of target platform application program interfaces
  • each target platform application program interface corresponds to a an operating environment.
  • each platform application program interface in the platform application program interface layer can be lazily loaded, and subsequent application and occupation of related resources will be performed when they need to be used.
  • the required cross-platform application program interface can be constructed when the application runs on the client or other electronic devices, so that the application can run smoothly and normally no matter what the current platform or operating environment is. Implement your own functionality.
  • the following steps 301 and 302, and steps 301 and 302 need to be implemented before the implementation method of the functions in the application program provided by the present disclosure is implemented.
  • the execution body of the corresponding technical solution may be the client or the server used by the developer.
  • each platform API corresponds to an operating system/platform/running environment, and each platform API is used to implement a function corresponding to an event.
  • each platform API may specifically be one of the following APIs with functions at the operating system level: picture decoding, video encoding and decoding, custom network communication protocol, and inter-process memory copy.
  • development requirements it can be a specific function list, and the functions required in the function list can be various functions that need to be used in the development process, such as drawing windows, obtaining memory information, reading and writing data, etc. function
  • platform APIs corresponding to development requirements from at least one operating system.
  • each operating system has a description document corresponding to its platform API, so here you can select the corresponding one according to each function in the function list and the platform API description document of each operating system.
  • Platform API Platform API.
  • the platform API corresponding to each underlying function can be obtained according to the technical documents of the operating system, etc. After obtaining the platform API, a corresponding platform API list is formed according to the platform API, and then the All platform APIs are encapsulated according to different functions or categories.
  • the platform API obtained in the present disclosure can be encapsulated to form the platform application program interface layer in the functional layering of the runtime container as shown in FIG. 6; The specifications that must be complied with when the runtime container shown in Figure 6 is running on different platforms to realize the capabilities corresponding to each API in the platform API layer.
  • the platform API may be encapsulated according to its corresponding function, or may be any other feasible manner, which is not specifically limited in this application.
  • the preset container may be a flutter runtime container
  • the preset engine may be a flutter engine.
  • the present disclosure rewrites the flutter engine, and changes the implementation of the original flutter dependency to a platform application that can be formed by using 301 steps Program interface layer, while adding, modifying, and deleting some APIs exposed to the framework framework layer to the flutter engine, so that in the runtime container for flutter, the flutter engine (in this disclosure, the flutter engine can be the flutter engine layer ) can encapsulate the platform API in the platform API layer to form some APIs in the flutter framework api (flutter framework application program interface, that is, the aforementioned cross-platform application program interface) in the uppermost layer (referred to as the cross-platform API layer in this disclosure).
  • flutter technology will also provide a set of widget systems similar to web page widgets to build UI, and widgets can be freely expanded, so when this disclosure uses the flutter engine and the flutter runtime container, developers can also Build the UI more freely to ensure the rich display effect of the application to improve the user experience.
  • exposure is a special vocabulary in software engineering, and specifically refers to an interface provided to developers that can be called. If the API is not exposed, developers will not be able to call corresponding functions during development.
  • the platform APIs in this disclosure may only have APIs corresponding to those functions that affect the key performance of the operating system.
  • the preset engine when it exposes the platform API, it will encapsulate and expose the platform API belonging to different operating systems according to the corresponding functions according to the difference of different operating platforms, so that developers can call the unified cross-platform API, that is, When a developer calls a cross-platform API, he actually calls multiple platform APIs belonging to different operating systems, thereby ensuring that the developed code can be applied to multiple different operating systems.
  • the platform API is exposed through the preset engine in the preset container, the security of the platform API is guaranteed.
  • the platform API in the above technical solution corresponds to multiple operating systems, the developer is required to pass
  • the developed application code can call different APIs for different operating systems according to its own needs, so the final developed code can be applied to a variety of different operating systems. It is efficient and does not need to rely on the native platform for development, so it can achieve a set of code support for a variety of different platforms without using the native platform.
  • the platform API at the operating system level can be called, and the platform API has the ability to directly exchange and communicate data between processes without serializing communication through communication, which improves development.
  • the performance of the application after completion improves the user experience.
  • the usage requirements of the engine itself can also include 303 after step 301:
  • the core API is located in the second layer (referred to as the platform extension layer in this disclosure).
  • this layer can encapsulate the core API contained in itself into a part of the application program interface of the flutter framework of the uppermost layer (cross-platform application program interface layer) for developers to use.
  • step 302 can include 3021-3023:
  • the modification instruction is used to instruct to modify the platform API.
  • the modification instruction may also include an identifier of the platform API that needs to be modified. Specific modifications can add optional parameters to add new functions to the original platform API.
  • the flutter engine exposes the platform API of the platform API layer, if it receives the If the modification instructions are modified, some of the platform APIs will be modified according to the modification instructions and encapsulated to form the customized framework API of the second layer (platform extension layer), and then combined with the unmodified platform APIs and core APIs.
  • the API is encapsulated together as part of the application program interface of the flutter framework in the top layer (cross-platform API layer).
  • the target platform API in the above step 3022 includes some modified platform APIs and unmodified platform APIs, and for the unmodified platform APIs, it can be considered that the modification instruction indicates that the modification is empty.
  • the present disclosure there is a first platform application program interface in at least one platform application program interface; the first platform application program interface is a native application program interface. Based on the program interface, it is obtained by extending the corresponding functions.
  • the inherent platform API of the platform can be expanded with more functions, which is convenient for users to use and improves user experience.
  • the plug-in establishment instruction carries plug-in establishment information; the plug-in establishment instruction is used to instruct to establish a plug-in.
  • the plug-in can be registered at the top layer (that is, the cross-platform API layer).
  • the plug-in is completely written in dart code
  • the plugin is not only implemented by dart code but also needs to encapsulate the functions of a certain kind of native platform, it can be called a flutter plugin.
  • a plug-in here can be a brand-new function, or can be a comprehensive coverage of the platform API or core API (corresponding to the flutter engine) (that is, including the original function and the new function).
  • the plug-in API can be a plug-in interface (pluin-insservice api), when the plug-in interface is used by developers , it can provide the plugin functions corresponding to its corresponding flutter module and flutter plugin.
  • the X3 step is mainly implemented by the top cross-platform API layer.
  • the developed applications also include plug-ins that can realize unique functions, which ensures the smooth progress of development and improves the experience of subsequent applications.
  • the method for implementing functions in the application program provided by the present disclosure may further include S1-S3:
  • the plug-in may be the plug-in in the technical solution corresponding to FIG. 9 .
  • the software package obtained in step 200A should contain the code corresponding to the platform expansion layer as shown in FIG. 9
  • the platform extension layer can be constructed to ensure that the second event generated when the subsequent application is used can be called by the corresponding plug-in.
  • the plug-in uses its own function to realize the corresponding function or uses the platform API to realize the corresponding function, this disclosure does not specifically show it, and it depends on the actual demand.
  • the third-party SDK software development kit (SDK, software development kit) is used for at least one or more of the following: calling preset APIs in all platform APIs, calling third-party APIs in third-party open source databases; preset APIs For an API whose stability parameter is greater than a preset value, the stability parameter is used to represent the stability and data security degree of the application corresponding to the API when the API is called.
  • the third-party SDK that can implement the function of calling the preset API in all platform APIs can be located in the second Layer (Platform Expansion Layer), which can specifically be "Direct SDK", and a third-party SDK that can call third-party APIs in third-party open source databases can be "Plat specific implementation”.
  • Platinum Expansion Layer a third-party SDK that can call third-party APIs in third-party open source databases
  • the present disclosure designs the above-mentioned “Direct Tuning SDK” ”, which is convenient for developers to directly call the preset API in the platform API layer when using a certain third-party SDK, improving development efficiency.
  • the platform APIs of multiple operating systems are first obtained, and then the platform APIs are exposed in the preset container through the preset engine. Because the platform API is exposed through the preset engine in the preset container, the security of the platform API is guaranteed.
  • developers can When developing an application, the platform API can make the developed application code call different APIs for different operating systems according to its own needs, so the final developed code can be applied to a variety of different operating systems, and the development efficiency is high And it does not need to rely on the native platform for development, so it is possible to achieve a development scheme that supports a variety of different platforms with a set of code without the security of the native platform.
  • the application package when the application package is compiled on any platform (operating system, such as ios system), it will be compiled into two parts according to the characteristics of the platform.
  • the first part Including the flutter engine corresponding to the platform and the platform API corresponding to the platform, the second part includes AOT (aheadof) running in the runtime environment (flutter runtime container and dart virtual machine (generated by the flutter engine)) created in the first part time) compile the product snapshot.
  • the flutter engine in the first part When the application is started, the flutter engine in the first part will be loaded and initialized immediately, forming the flutter engine layer and platform API layer in the flutter runtime container, and providing APIs that can be called by the platform extension layer (convenient for the platform extension layer to call ); the platform API in the platform API layer will apply for the underlying resources to the platform.
  • the platform APIs in the platform API layer In order to ensure that the underlying resources (memory resources, CPU resources, etc.) are applied for too much by the application, some of the platform APIs in the platform API layer here will be lazy loaded. , that is, only some platform APIs will apply for underlying resources during initialization, and the other part will apply for underlying resources only when they need to be used.
  • the second part of the AOT compilation product snapshot will complete the initialization of the cross-platform API layer and the platform extension layer in the running environment formed by the initialization of the flutter engine layer and the platform API layer. Then the application starts successfully.
  • the flutter engine will control the rendering of the page UI and monitor the user's operation.
  • the flutter engine will trigger the corresponding callback event and send it to the cross-platform
  • the corresponding upper-layer API in the API layer (for example, the flutter framework api in the foregoing embodiment)
  • the cross-platform API layer will use the ability to call different layers according to the upper-layer API that receives the event to call the resources of the platform (including network resources, GPU resources, CPU resources, file IO resources, memory resources, cross-process communication resources, etc.), and functions such as image editing and video transcoding corresponding to user operations have been completed.
  • the application developed through the solution of the present application will produce the flutter runtime container in the foregoing embodiment in the platform, and the container takes over the tasks of the native process similar to the native application, and can transfer the platform to the platform through different layers in the container.
  • the capabilities or resources are encapsulated layer by layer, and finally the easy-to-use upper-layer API is exposed through the cross-platform API layer for the application to use. Therefore, the technical solution provided in this application can ensure that the finally developed cross-platform application can be successfully implemented on different platforms. The corresponding palace.
  • L1-L3 may also be included:
  • the server can implement the above-mentioned functions respectively through means for implementing functions in the application program configured therein.
  • the implementation device of the functions in the application program includes corresponding hardware structures and/or software modules for performing each function, and these corresponding hardware structures and/or software modules for performing each function can constitute a terminal.
  • the present disclosure can be implemented in hardware or a combination of hardware and computer software in conjunction with the algorithm steps of the examples described in the embodiments disclosed herein. Whether a function is performed by hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of this disclosure.
  • the server may be divided into functional modules according to the foregoing method examples.
  • the server may include a device for implementing functions in an application program, and the device for implementing functions in an application program may divide each function module corresponding to each function, or may divide the two One or more functions are integrated in one processing module.
  • the above-mentioned integrated modules can be implemented in the form of hardware, and can also be implemented in the form of software function modules. It should be noted that, the division of modules in the embodiments of the present disclosure is schematic, and is only a logical function division, and there may be other division manners in actual implementation.
  • FIG. 13 shows a possible structural schematic diagram of the device 03 for implementing the functions in the application program in the client 01 shown in FIG. 1 .
  • the functions in the application program The implementation device 03 includes: a monitoring module 31 , a determination module 32 and a processing module 33 .
  • the monitoring module 31 is configured to monitor and obtain the first event of the application; the determining module 32 is configured to determine the cross-platform application program interface corresponding to the first event obtained by the monitoring module 31; the cross-platform application program interface It is encapsulated and obtained by at least one platform application program interface having the function corresponding to the first event, and each platform application program interface corresponds to one operating environment; the processing module 33 is configured as a cross-platform application program interface determined by the determining module 32.
  • the platform application program interface corresponding to the current operating environment is called to realize the function corresponding to the first event.
  • the processing module 33 is specifically configured to use the preset engine to call the platform application program interface corresponding to the current operating environment through the cross-platform application program interface determined by the determination module 32 to realize the function corresponding to the first event.
  • the device further includes an acquisition module; the acquisition module is configured to: acquire a software package corresponding to the application; compile and parse the software package to construct a cross-platform application interface layer including multiple cross-platform application interfaces , including a platform API layer with multiple platform APIs and an engine layer including a preset engine; each cross-platform API corresponds to an event, and each platform API can implement a function corresponding to an event , each event corresponds to multiple target platform application program interfaces, and each target platform application program interface corresponds to one operating environment.
  • the acquisition module is configured to: acquire a software package corresponding to the application; compile and parse the software package to construct a cross-platform application interface layer including multiple cross-platform application interfaces , including a platform API layer with multiple platform APIs and an engine layer including a preset engine; each cross-platform API corresponds to an event, and each platform API can implement a function corresponding to an event , each event corresponds to multiple target platform application program interfaces, and each target platform application program interface corresponds to one operating
  • first platform application program interface in at least one platform application program interface; the first platform application program interface is obtained by extending corresponding functions on the basis of the native application program interface.
  • the monitoring module 31 is also configured to monitor and obtain the second event of the application; the determining module 32 is also configured to determine the plug-in corresponding to the second event obtained by the monitoring module 31; the processing module 33 is also configured to run The plug-in determined by the determining module 32 is to implement the function corresponding to the second event.
  • the processing module 33 is specifically configured to: call the platform application program interface corresponding to the current operating environment through the cross-platform application program interface to obtain the platform resources required for the first event;
  • the platform resources include any one or more of the following: : Network resources, GPU resources, CPU resources, file IO resources, memory resources, and cross-process communication resources; load platform resources to implement the function corresponding to the first event.
  • FIG. 14 is a schematic diagram showing a possible structure of the electronic device shown according to an exemplary embodiment.
  • the client or server that contains the device.
  • the electronic device includes a processor 41 and a memory 42 .
  • the memory 42 is used for storing the executable instructions of the processor 41, and the processor 41 can realize the functions of each module in the device 03 for realizing the functions in the application program in the above-mentioned embodiment.
  • the processor 41 may include one or more CPUs, such as CPU0 and CPU1 shown in FIG. 14 .
  • the control device of the air conditioner may include a plurality of processors 41, such as the processor 41-1 and the processor 41-2 shown in FIG. 14 .
  • Each of these processors 41 may be a single-core processor (Single-CPU) or a multi-core processor (Multi-CPU).
  • Processor 41 herein may refer to one or more devices, circuits, and/or processing cores for processing data (eg, computer program instructions).
  • Memory 42 may be read-only memory (ROM) or other types of static storage devices that can store static information and instructions, random access memory (RAM) or other types of static storage devices that can store information and instructions.
  • ROM read-only memory
  • RAM random access memory
  • dynamic storage devices which can also be electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM), or other optical storage, CD-ROM storage (including compact discs, laser discs, compact discs, digital versatile discs, Blu-ray discs, etc.), disk-readable storage media or other magnetic storage devices, or capable of carrying or storing desired program code in the form of instructions or data structures and Any other medium that can be accessed by a computer, but is not limited to this.
  • the memory 42 may exist independently, and is connected to the processor 41 through the bus 43 .
  • the memory 42 may also be integrated with the processor 41 .
  • the bus 43 can be an industry standard architecture (industry standard architecture, ISA) bus, a peripheral component interconnect (peripheral component interconnect, PCI) bus or an extended industry standard architecture (extended industry standard architecture, EISA) bus or the like.
  • the bus 43 can be divided into an address bus, a data bus, a control bus, and the like. For ease of presentation, only one thick line is shown in FIG. 14, but it does not mean that there is only one bus or one type of bus.
  • the electronic device in order to facilitate information interaction between the electronic device and other devices (such as a server or a client), the electronic device includes a communication interface 44 .
  • Communication interface 44 using any transceiver-like device, for communicating with other devices or communication networks, such as control systems, radio access networks (RAN), wireless local area networks (WLAN), etc. .
  • the communication interface 44 may include a receiving unit to implement a receiving function, and a transmitting unit to implement a transmitting function.
  • the electronic device may be a client, and in this case, the electronic device may further optionally include: a peripheral device interface 45 and at least one peripheral device.
  • the processor 41, the memory 42 and the peripheral device interface 45 can be connected through a bus 43 or a signal line.
  • Each peripheral device can be connected to the peripheral device interface 45 through a bus 43, a signal line or a circuit board.
  • the peripheral devices include: at least one of a radio frequency circuit 46 , a display screen 47 , a camera 48 , an audio circuit 49 , a positioning component 50 and a power supply 51 .
  • the peripheral device interface 45 may be used to connect at least one peripheral device related to I/O (input/output) to the processor 41 and the memory 42 .
  • processor 41, memory 42, and peripherals interface 45 are integrated on the same chip or circuit board; in some other embodiments, any one of processor 41, memory 42, and peripherals interface 45 or The two may be implemented on a separate chip or circuit board, which is not limited in this embodiment.
  • the radio frequency circuit 46 is used for receiving and transmitting RF (radio frequency, radio frequency) signals, also called electromagnetic signals.
  • the radio frequency circuit 46 communicates with the communication network and other communication devices via electromagnetic signals.
  • the radio frequency circuit 46 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals.
  • the radio frequency circuit 404 includes an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber identity module card, and the like.
  • Radio frequency circuitry 46 may communicate with other terminals via at least one wireless communication protocol.
  • the wireless communication protocol includes but is not limited to: metropolitan area network, mobile communication networks of various generations (2G, 3G, 4G and 5G), wireless local area network and/or Wi-Fi (wireless fidelity, wireless fidelity) network.
  • the radio frequency circuit 46 may further include a circuit related to NFC (near field communication, short-range wireless communication), which is not limited in the present disclosure.
  • the display screen 47 is used to display UI (user interface, user interface).
  • the UI can include graphics, text, icons, video, and any combination thereof.
  • display screen 47 also has the ability to capture touch signals on or over the surface of display screen 47 .
  • the touch signal can be input to the processor 41 as a control signal for processing.
  • the display screen 47 may also be used to provide virtual buttons and/or virtual keyboards, also referred to as soft buttons and/or soft keyboards.
  • the display screen 47 may be one, and the front panel of the client is provided; the display screen 47 may be made of materials such as LCD (liquid crystal display, liquid crystal display), OLED (organic light-emitting diode, organic light-emitting diode) and the like .
  • the camera assembly 48 is used to capture images or video.
  • the camera assembly 48 includes a front camera and a rear camera.
  • the front camera is arranged on the front panel of the terminal, and the rear camera is arranged on the back of the terminal.
  • Audio circuitry 49 may include a microphone and speakers.
  • the microphone is used to collect the sound waves of the user and the environment, convert the sound waves into electrical signals, and input them to the processor 41 for processing, or to the radio frequency circuit 46 to realize voice communication.
  • the microphone may also be an array microphone or an omnidirectional collection microphone.
  • the speaker is used to convert electrical signals from the processor 41 or the radio frequency circuit 46 into sound waves.
  • the loudspeaker can be a traditional thin-film loudspeaker or a piezoelectric ceramic loudspeaker.
  • the speaker is a piezoelectric ceramic speaker, it can not only convert electrical signals into sound waves audible to humans, but also convert electrical signals into sound waves that cannot be heard by humans for distance measurement and other purposes.
  • audio circuitry 49 may also include a headphone jack.
  • the positioning component 50 is used to locate the current geographic location of the client to implement navigation or LBS (location based service).
  • the positioning component 50 may be a positioning component based on the GPS (global positioning system, global positioning system) of the United States, the Beidou system of China, the Grenas system of Russia, or the Galileo system of the European Union.
  • the power supply 51 is used to power various components in the client.
  • the power source 51 may be alternating current, direct current, disposable batteries or rechargeable batteries.
  • the rechargeable battery can support wired charging or wireless charging.
  • the rechargeable battery can also be used to support fast charging technology.
  • the electronic device also includes one or more sensors 410 .
  • the one or more sensors 410 include, but are not limited to, acceleration sensors, gyroscope sensors, pressure sensors, fingerprint sensors, optical sensors, and proximity sensors.
  • the acceleration sensor can detect the acceleration on the three coordinate axes of the coordinate system established by the client.
  • the gyroscope sensor can detect the direction and rotation angle of the client's body, and the gyroscope sensor can cooperate with the acceleration sensor to collect the user's 3D actions on the client.
  • the pressure sensor may be disposed on the side frame of the client and/or the lower layer of the display screen 47 . When the pressure sensor is arranged on the side frame of the terminal 01, the user's holding signal on the client terminal can be detected.
  • the fingerprint sensor is used to collect the user's fingerprint.
  • Optical sensors are used to collect ambient light intensity.
  • Proximity sensors also called distance sensors, are usually located on the front panel of the client. Proximity sensors are used to capture the distance between the user and the front of the client.
  • FIG. 14 or FIG. 15 does not constitute a limitation on the electronic device, and may include more or less components than the one shown, or combine some components, or use different components layout.
  • Embodiments of the present disclosure further provide a computer-readable storage medium, where instructions are stored on the computer-readable storage medium.
  • the instructions on the readable storage medium are executed by a processor of an electronic device, the electronic device can perform the foregoing implementation.
  • the example provides a method for implementing functions in an application program on an apparatus for implementing functions in an application program in an electronic device.
  • Embodiments of the present disclosure also provide a computer program product containing instructions, which, when executed on an electronic device, enable the electronic device to execute the method for implementing the functions in the application program provided by the foregoing embodiments.
  • the disclosed apparatus and method may be implemented in other manners.
  • the apparatus embodiments described above are only illustrative.
  • the division of modules or units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components may be combined or May be integrated into another device, or some features may be omitted, or not implemented.
  • the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
  • Units described as separate components may or may not be physically separated, and components shown as units may be one physical unit or multiple physical units, that is, may be located in one place, or may be distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
  • each functional unit in each embodiment of the present application 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 above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a readable storage medium.
  • a readable storage medium including several instructions to make a device (may be a single chip microcomputer, a chip, etc.) or a processor (processor) to execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage medium includes: a U disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk and other mediums that can store program codes.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

L'invention concerne un procédé et un appareil pour mettre en oeuvre des fonctions dans un programme d'application, un dispositif électronique et un support de stockage, qui se rapportent au domaine technique de l'électronique, et peuvent aisément mettre en oeuvre l'utilisation normale d'un programme d'application dans différents environnements d'exécution en utilisant une interface de programme d'application inter-plateforme. Le procédé consiste à : surveiller et acquérir un premier événement d'un programme d'application (201) ; déterminer une interface de programme d'application inter-plateforme correspondant au premier événement, l'interface de programme d'application inter-plateforme étant obtenue par empaquetage d'au moins une interface de programme d'application de plateforme équipée d'une fonction correspondant au premier événement, et chaque interface de programme d'application de plateforme correspondant à un environnement d'exécution (202) ; et au moyen de l'interface de programme d'application inter-plateforme, appeler l'interface de programme d'application de plateforme qui correspond à l'environnement d'exécution courant de façon à mettre en oeuvre une fonction correspondant au premier événement (203).
PCT/CN2021/135062 2021-03-23 2021-12-02 Procédé et appareil pour mettre en oeuvre des fonctions dans un programme d'application, dispositif électronique et support de stockage WO2022199111A1 (fr)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110310126.9 2021-03-23
CN202110310126.9A CN113094123A (zh) 2021-03-23 2021-03-23 应用程序中功能的实现方法、装置、电子设备和存储介质

Publications (1)

Publication Number Publication Date
WO2022199111A1 true WO2022199111A1 (fr) 2022-09-29

Family

ID=76669111

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/135062 WO2022199111A1 (fr) 2021-03-23 2021-12-02 Procédé et appareil pour mettre en oeuvre des fonctions dans un programme d'application, dispositif électronique et support de stockage

Country Status (2)

Country Link
CN (1) CN113094123A (fr)
WO (1) WO2022199111A1 (fr)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113094123A (zh) * 2021-03-23 2021-07-09 北京达佳互联信息技术有限公司 应用程序中功能的实现方法、装置、电子设备和存储介质
CN113608801A (zh) * 2021-07-19 2021-11-05 上海浦东发展银行股份有限公司 接口调用方法、装置、计算机设备和存储介质
CN113485746B (zh) * 2021-07-28 2024-02-06 山石网科通信技术股份有限公司 应用程序接口文档的生成方法及装置
CN113608803A (zh) * 2021-08-16 2021-11-05 上海万物新生环保科技集团有限公司 一种用于多运行环境下实现功能操作的方法与设备
CN113766318A (zh) * 2021-09-09 2021-12-07 世纪龙信息网络有限责任公司 视频生成方法、装置、存储介质及计算机设备
CN113722019B (zh) * 2021-11-04 2022-02-08 海尔数字科技(青岛)有限公司 平台程序的显示方法、装置及设备
WO2023245526A1 (fr) * 2022-06-23 2023-12-28 广州视源电子科技股份有限公司 Procédé de fonctionnement d'élément de bureau, dispositif électronique et tablette d'interaction intelligente
CN115866248B (zh) * 2022-11-08 2024-01-19 格兰菲智能科技有限公司 视频转码方法、装置、计算机设备、存储介质
CN117009029A (zh) * 2023-05-26 2023-11-07 阿里巴巴(中国)有限公司 Xr应用与内容运行方法、设备及存储介质
CN117555645B (zh) * 2024-01-12 2024-04-05 腾讯科技(深圳)有限公司 基于多端应用平台的数据处理方法、装置、设备及介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110143741A1 (en) * 2005-07-19 2011-06-16 AOL Inc., System and method for cross-platform applications on a wireless phone
CN102681893A (zh) * 2011-03-09 2012-09-19 腾讯科技(深圳)有限公司 可执行程序的跨平台实现方法及移动终端
CN103761087A (zh) * 2014-01-03 2014-04-30 北京京东尚科信息技术有限公司 一种移动应用程序跨平台开发方法及装置
CN103823697A (zh) * 2014-02-27 2014-05-28 百度在线网络技术(北京)有限公司 应用的跨平台实现方法、系统以及插件管理器
CN113094123A (zh) * 2021-03-23 2021-07-09 北京达佳互联信息技术有限公司 应用程序中功能的实现方法、装置、电子设备和存储介质

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108279952A (zh) * 2018-01-23 2018-07-13 浙江科澜信息技术有限公司 一种跨平台窗口管理的实现方法及系统

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110143741A1 (en) * 2005-07-19 2011-06-16 AOL Inc., System and method for cross-platform applications on a wireless phone
CN102681893A (zh) * 2011-03-09 2012-09-19 腾讯科技(深圳)有限公司 可执行程序的跨平台实现方法及移动终端
CN103761087A (zh) * 2014-01-03 2014-04-30 北京京东尚科信息技术有限公司 一种移动应用程序跨平台开发方法及装置
CN103823697A (zh) * 2014-02-27 2014-05-28 百度在线网络技术(北京)有限公司 应用的跨平台实现方法、系统以及插件管理器
CN113094123A (zh) * 2021-03-23 2021-07-09 北京达佳互联信息技术有限公司 应用程序中功能的实现方法、装置、电子设备和存储介质

Also Published As

Publication number Publication date
CN113094123A (zh) 2021-07-09

Similar Documents

Publication Publication Date Title
WO2022199111A1 (fr) Procédé et appareil pour mettre en oeuvre des fonctions dans un programme d'application, dispositif électronique et support de stockage
US11853820B2 (en) Cross-process communication method, apparatus, and device
KR101215230B1 (ko) 다중-컨텍스트 그래픽 처리
US9058193B2 (en) Methods and systems for providing compatibility of applications with multiple versions of an operating system
WO2019178869A1 (fr) Procédé d'ouverture de compte de carte esim et terminal
US20090235189A1 (en) Native support for manipulation of data content by an application
US20090199213A1 (en) Automatic Connections Between Application Components
WO2019227450A1 (fr) Procédé de mise en œuvre de fonction d'application et dispositif électronique
CN109213613B (zh) 图像信息的传输方法、装置、存储介质及电子设备
US10474479B1 (en) Preventing framework conflicts for multi-OS applications
CN110990075A (zh) 快应用的启动方法、装置、设备及存储介质
CN112420217B (zh) 消息推送方法、装置、设备及存储介质
CN113190362B (zh) 服务调用方法、装置、计算机设备及存储介质
CN108376066B (zh) 代码处理装置及代码处理方法
CN111125602B (zh) 页面构建方法、装置、设备和存储介质
US10599444B2 (en) Extensible input stack for processing input device data
EP4095723B1 (fr) Procédé de réutilisation d'autorisation, procédé d'accès à une ressource basé sur une réutilisation d'autorisation et dispositif associé
US20190213015A1 (en) Extensible input stack for processing input device data
JP2022141683A (ja) アプリケーション機能の実施方法及び電子装置
CN114385723A (zh) 数据读取方法、装置、电子设备及存储介质
TWI556167B (zh) 用於多重本機軟體應用程式使用者介面組成之系統及方法
CN111290746A (zh) 对象访问方法、装置、设备及存储介质
WO2023169212A1 (fr) Procédé d'identification de sdk dans une application, terminal et serveur
US20230393820A1 (en) MVVM Architecture-Based Application Development Method and Terminal
WO2023169157A1 (fr) Procédé et appareil d'exécution de sous-application, dispositif électronique, produit de programme et support de stockage

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE