[go: up one dir, main page]

CN113094123B - Method and device for realizing functions in application program, electronic equipment and storage medium - Google Patents

Method and device for realizing functions in application program, electronic equipment and storage medium Download PDF

Info

Publication number
CN113094123B
CN113094123B CN202110310126.9A CN202110310126A CN113094123B CN 113094123 B CN113094123 B CN 113094123B CN 202110310126 A CN202110310126 A CN 202110310126A CN 113094123 B CN113094123 B CN 113094123B
Authority
CN
China
Prior art keywords
application program
platform
event
program interface
platform application
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110310126.9A
Other languages
Chinese (zh)
Other versions
CN113094123A (en
Inventor
徐祎村
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202110310126.9A priority Critical patent/CN113094123B/en
Publication of CN113094123A publication Critical patent/CN113094123A/en
Priority to PCT/CN2021/135062 priority patent/WO2022199111A1/en
Application granted granted Critical
Publication of CN113094123B publication Critical patent/CN113094123B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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 OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • G06F8/427Parsing
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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

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

The disclosure relates to a method, a device, an electronic device and a storage medium for realizing functions in an application program, relates to the technical field of electronics, and can conveniently realize normal use of the application program in different running environments by utilizing a cross-platform application program interface. The method comprises the following steps: monitoring and acquiring a first event of an application program; determining a cross-platform application program interface corresponding to the first event; the cross-platform application program interfaces are packaged by at least one platform application program interface with functions corresponding to the first event, and each platform application program interface corresponds to one running environment; and calling a platform application program interface corresponding to the current running environment through the cross-platform application program interface so as to realize the function corresponding to the first event.

Description

Method and device for realizing functions in application program, electronic equipment and storage medium
Technical Field
The embodiment of the disclosure relates to the technical field of electronics, in particular to a method, a device, electronic equipment and a storage medium for realizing functions in an application program.
Background
With the vigorous development of the mobile internet, a plurality of different operating systems (terminal platforms or platforms for short) which can be used by terminal equipment exist at present, so in order to improve the development efficiency and reduce the development cost, software applications which are researched and developed by the mobile internet can be used on different platforms, manufacturers of all the software applications often adopt cross-platform development schemes, and a set of technical schemes that codes of the software applications can be operated on different platforms are realized.
However, most of the existing cross-platform development schemes are limited in specific scenes, so that the developed cross-platform software application has limited performance and cannot be used normally in the running environments of different platforms.
Disclosure of Invention
The present disclosure relates to a method, an apparatus, a server, and a readable storage medium for implementing functions in an application program, which are capable of supporting development schemes of a plurality of different platforms without implementing a set of codes through native platform security.
In order to achieve the above purpose, the embodiments of the present disclosure adopt the following technical solutions:
In a first aspect, a method for implementing a function in an application program is provided, including: monitoring and acquiring a first event of an application program; determining a cross-platform application program interface corresponding to the first event; the cross-platform application program interfaces are packaged by at least one platform application program interface with functions corresponding to the first event, and each platform application program interface corresponds to one running environment; and calling a platform application program interface corresponding to the current running environment through the cross-platform application program interface so as to realize the function corresponding to the first event.
Optionally, the function of the target event is realized by calling a platform application program interface corresponding to the current running environment through a cross-platform application program interface, which comprises the following steps: and calling a platform application program interface corresponding to the current running environment through a cross-platform application program interface by using a preset engine so as to realize the function corresponding to the first event.
Optionally, the method further comprises: acquiring a software package corresponding to an application program; compiling and analyzing the software package to construct a cross-platform application program interface layer comprising a plurality of cross-platform application program interfaces, a platform application program interface layer comprising a plurality of platform application program interfaces and an engine layer comprising a preset engine; each cross-platform application program interface corresponds to an event, each platform application program interface can realize a function corresponding to the event, each event corresponds to a plurality of target platform application program interfaces, and each target platform application program interface corresponds to an operating environment.
Optionally, a first platform application program interface exists in the at least one platform application program interface; the first platform application program interface is obtained by expanding corresponding functions on the basis of the original application program interface.
Optionally, the method further comprises: monitoring and acquiring a second event of the application program; determining a plug-in corresponding to the second event; and running the plug-in to realize the function corresponding to the second event.
Optionally, calling, by the cross-platform application program interface, a platform application program interface corresponding to the current running environment to implement a function corresponding to the first event, including: the method comprises the steps of calling a platform application program interface corresponding to a current running environment through a cross-platform application program interface to obtain platform resources required by a first event; platform resources include any one or more of the following: network resources, GPU resources, CPU resources, document IO resources, memory resources, and cross-process communication resources; and loading platform resources to realize the functions corresponding to the first event.
In a second aspect, a device for implementing functions in an application program is provided, including a monitoring module, a determining module and a processing module. The monitoring module is configured to monitor and acquire a first event of the application program; the determining module is configured to determine a cross-platform application program interface corresponding to the first event acquired by the monitoring module; the cross-platform application program interfaces are packaged by at least one platform application program interface with functions corresponding to the first event, and each platform application program interface corresponds to one running environment; and the processing module is configured to call the platform application program interface corresponding to the current running environment through the cross-platform application program interface determined by the determining module so as to realize the function corresponding to the first event.
Optionally, the processing module is specifically configured to: and calling a platform application program interface corresponding to the current running environment by utilizing the cross-platform application program interface determined by the determining module through the preset engine so as to realize the function corresponding to the first event.
Optionally, the device further comprises an acquisition module; the acquisition module is configured to: acquiring a software package corresponding to an application program; compiling and analyzing the software package to construct a cross-platform application program interface layer comprising a plurality of cross-platform application program interfaces, a platform application program interface layer comprising a plurality of platform application program interfaces and an engine layer comprising a preset engine; each cross-platform application program interface corresponds to an event, each platform application program interface can realize a function corresponding to the event, each event corresponds to a plurality of target platform application program interfaces, and each target platform application program interface corresponds to an operating environment.
Optionally, a first platform application program interface exists in the at least one platform application program interface; the first platform application program interface is obtained by expanding corresponding functions on the basis of the original application program interface.
Optionally, the monitoring module is further configured to monitor and acquire a second event of the application program; the determining module is further configured to determine a plug-in corresponding to the second event acquired by the monitoring module; the processing module is further configured to run the plug-in determined by the determining module to implement a function corresponding to the second event.
Optionally, the processing module is specifically configured to: the method comprises the steps of calling a platform application program interface corresponding to a current running environment through a cross-platform application program interface to obtain platform resources required by a first event; platform resources include any one or more of the following: network resources, GPU resources, CPU resources, document IO resources, memory resources, and cross-process communication resources; and loading platform resources to realize the functions corresponding to the first event.
In a third aspect, the present disclosure provides an electronic device comprising a processor and a memory for storing processor-executable instructions; wherein the processor is configured to execute instructions to implement a method of implementing functionality in an application as provided in the first aspect and any of its possible implementations.
In a fourth aspect, the present disclosure provides a computer readable storage medium having instructions stored thereon, which when executed by a processor of an electronic device, cause the electronic device to perform a method of implementing functions in an application as provided in the first aspect and any of its possible embodiments.
In a fifth aspect, embodiments of the present application also provide a computer program product comprising one or more instructions executable on an electronic device to cause the electronic device to perform a method of implementing a function in an application as in the first aspect and any possible implementation thereof.
It can be understood that in the technical solution provided in the present disclosure, after monitoring and acquiring a first time of an application, a device for implementing a method for implementing a function in the application first determines a cross-platform application program interface corresponding to the first time; because the cross-platform application program interface is encapsulated by at least one platform application program interface with the function corresponding to the first event, and each platform application program interface corresponds to one running environment; the device can then call the platform application program interface corresponding to the running environment of the platform where the application program is currently located through the cross-platform application program interface, thereby realizing the function corresponding to the first time. In the technical scheme provided by the disclosure, because the cross-platform application program interface is preset when the application program is developed, the application program can normally realize corresponding functions in various different platforms or running environments, and the user experience is improved. Furthermore, because the cross-platform application program interface exists, a developer can develop a corresponding application program without depending on various original platforms when the cross-platform application program is needed, and the development efficiency is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
FIG. 1 is a schematic illustration of an implementation environment provided by an embodiment of the present disclosure;
Fig. 2 is a schematic flow chart of a method for implementing functions in an application according to an embodiment of the disclosure;
fig. 3 is a second flowchart of a method for implementing functions in an application according to an embodiment of the present disclosure;
Fig. 4 is a flowchart illustrating a method for implementing functions in an application according to an embodiment of the present disclosure;
fig. 5 is a flowchart illustrating a method for developing an application according to an embodiment of the present disclosure;
FIG. 6 is a schematic diagram of a runtime container provided in an embodiment of the present disclosure;
Fig. 7 is a second flowchart of an application development method according to an embodiment of the disclosure;
fig. 8 is a flowchart illustrating a method for developing an application program according to an embodiment of the present disclosure;
Fig. 9 is a flowchart of an application development method according to an embodiment of the present disclosure;
fig. 10 is a schematic diagram of a complementary flow of a method for implementing functions in an application according to an embodiment of the disclosure;
Fig. 11 is a flowchart fifth of an application development method according to an embodiment of the present disclosure;
Fig. 12 is a schematic diagram of a complementary flow chart of a method for implementing functions in an application according to an embodiment of the disclosure;
Fig. 13 is a schematic structural diagram of a device for implementing functions in an application according to an embodiment of the present disclosure;
fig. 14 is a schematic structural diagram of an electronic device according to an embodiment of the disclosure;
Fig. 15 is a schematic structural diagram of another electronic device according to an embodiment of the disclosure.
Detailed Description
In order to enable those skilled in the art to better understand the technical solutions of the present disclosure, the technical solutions of the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the foregoing figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the disclosure described herein may be capable of operation in sequences other than those illustrated or described herein. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as detailed in the accompanying claims.
In addition, in the description of the embodiments of the present disclosure, unless otherwise indicated, "/" means or, for example, a/B may represent a or B; "and/or" herein is merely an association relationship describing an association object, and means that three relationships may exist, for example, a and/or B may mean: a exists alone, A and B exist together, and B exists alone. In addition, in the description of the embodiments of the present disclosure, "a plurality" means two or more than two.
The data referred to in this disclosure may be data authorized by the user or sufficiently authorized by the parties.
First, technical terms related to the present disclosure will be described:
flutter: is a Google open-source UI (user interface) toolkit, helps developers to efficiently construct multi-platform exquisite applications through a set of code libraries, and supports mobile, web, desktop and embedded platforms.
Flutter engine: is a portable runtime for running high quality mobile applications. It implements Flutter's core libraries, animations and graphics, I/O of files and networks, support accessibility (accessibility), plug-in architecture, and Dart runtime and development tools for developing, compiling and running Flutter applications.
Skia: the 2D vector graphics processing function library comprises fonts, coordinate conversion and bitmap, and has high-efficiency and compact performance.
API: all application programming interface, application programming interfaces or application program interfaces, are predefined interfaces (e.g., functions, HTTP interfaces) or conventions that refer to the engagement of different components of a software system to provide a set of routines that an application and developer can access based on certain software or hardware without having access to source code or understanding the details of the internal operating mechanisms.
Run-time container: an operating environment required by the software operation time, wherein the operating environment comprises various functions required by the software operation.
SDK: is collectively referred to as software development kit, a software development kit, and specifically a collection of development tools that are used by software engineers to create application software for a particular software package, software framework, hardware platform, operating system, etc.
Dart: the computer programming language developed by google corporation is an object-oriented, class-defined, single-inherited language.
Referring to fig. 1, a schematic diagram of an implementation environment to which a technical solution provided by an embodiment of the present disclosure may relate is shown. The implementation environment may include a client 01 and a server 02, where the client 01 communicates with the server 02 through a wired communication method or a wireless communication method.
By way of example, the client 01 in the embodiments of the present disclosure may be a mobile phone, a tablet computer, a desktop, a laptop, a handheld computer, a notebook, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a Personal Digital Assistant (PDA), an augmented reality (augmented reality, AR) \virtual reality (VR) device, or the like, which may perform project development, and the embodiment of the present application is not limited to the specific form of the client.
For example, the server 02 in the present disclosure may be one server, a server cluster formed by a plurality of servers, or a cloud computing service center, which is not limited in the present disclosure. The server 02 is mainly used for receiving a content request of an application program sent by a client and returning corresponding content, receiving a development request and a code sent by the client, and completing construction of the application by using a self-set framework.
Most of the existing cross-platform development schemes are limited in aiming scenes, so that some development contents can only be subjected to primary development on a primary platform, further, the performance of the finally developed software application is limited, and corresponding functions cannot be well realized on different platforms.
In view of the above problems, the present disclosure provides a method for implementing functions in an application program, where the method can utilize a cross-platform application program interface to conveniently implement normal use of the application program in different operating environments. The specific implementation main body of the method can be the client or the server, and the specific implementation main body is determined according to actual requirements. In the following description of the embodiments of the present disclosure, a "client" refers to a terminal used by a developer, and a "server" may be a terminal used by the developer according to different situations, or may be a server that performs communication interaction with the developer through a terminal used by the developer.
Referring to fig. 2, a flowchart of a method for implementing functions in an application program is provided in an embodiment of the disclosure. The method is performed by a functional implementation in an application, and when the functional implementation in the application is a client or part of a client, the method may include 201-203:
201. the first event of the application is monitored and acquired.
For example, the first event may be a click of a control (e.g., "play", "share", "forward", etc.) by a user in a display interface of an application while using the application; or related events generated by the application program after receiving the corresponding functions triggered by the user; the present application is not particularly limited, and depends on the actual practice.
In an implementation manner, in practice, since the corresponding record information must be generated in real time when the first event is generated, step 201 may also be to obtain the record information of the first event to be used for characterizing the first event. The record information of the first event may be obtained from a database in which record information for storing the events is recorded. The record information of the first event may be description information of the first event. For example, the recording information of the first event may include a recording time of the first event, an attribute of the first event, a content description of the first event, and the like.
202. Determining a cross-platform application program interface corresponding to the first event; the cross-platform application program interfaces are encapsulated by at least one platform application program interface with functions corresponding to the first event, and each platform application program interface corresponds to one running environment.
For example, taking the function corresponding to the first event as an example of rendering the target image, the fast platform application program interface corresponding to the first event may be obtained by encapsulation of platform application program interfaces capable of rendering the target image in the android platform, the ios platform and the microsoft platform. The specific packaging may be any feasible manner. In the present disclosure, the running environments and the platforms are in one-to-one correspondence, that is, each platform is only corresponding to the respective running environment.
203. And calling a platform application program interface corresponding to the current running environment through the cross-platform application program interface so as to realize the function corresponding to the first event.
In the technical scheme provided by the disclosure, after monitoring and acquiring the first time of an application program, equipment for realizing a method for realizing functions in the application program firstly determines a cross-platform application program interface corresponding to the first time; because the cross-platform application program interface is encapsulated by at least one platform application program interface with the function corresponding to the first event, and each platform application program interface corresponds to one running environment; the device can then call the platform application program interface corresponding to the running environment of the platform where the application program is currently located through the cross-platform application program interface, thereby realizing the function corresponding to the first time. In the technical scheme provided by the disclosure, because the cross-platform application program interface is preset when the application program is developed, the application program can normally realize corresponding functions in various different platforms or running environments, and the user experience is improved. Furthermore, because the cross-platform application program interface exists, a developer can develop a corresponding application program without depending on various original platforms when the cross-platform application program is needed, and the development efficiency is improved.
Alternatively, referring to fig. 3 in conjunction with fig. 2, the step 203 may specifically be:
203. And calling a platform application program interface corresponding to the current running environment through the cross-platform application program interface by using a preset engine so as to realize the function corresponding to the first event.
The preset engine may be, for example, flutter engine.
Optionally, referring to fig. 4 in conjunction with fig. 2, step 203 may specifically further include 2031 and 2032:
2031. And calling a platform application program interface corresponding to the current running environment through a cross-platform application program interface to acquire platform resources required by the first event.
Wherein the platform resources include any one or more of: network resources, GPU resources, CPU resources, document IO resources, memory resources, and cross-process communication resources;
2032. and loading platform resources to realize the functions corresponding to the first event.
In this way, the platform API corresponding to the first time can acquire the corresponding platform resource to smoothly realize the corresponding function.
Therefore, the platform API is not directly called, and the platform API needs to pass through the flutter engine, and the flutter engine is preset with a calling rule and cannot be called at will, so that the safety of the application program in the use process is ensured.
Optionally, in order to enable the client to implement the technical solution provided in the foregoing embodiment, referring to fig. 2, referring to fig. 3, before step 201, the method may further include 200A and 200B:
200A, acquiring a software package corresponding to an application program.
Illustratively, taking android platform as an example, the software packages herein may be jar packages and so files.
200B, compiling and analyzing the software package to construct a cross-platform application program interface layer comprising a plurality of cross-platform application program interfaces, a platform application program interface layer comprising a plurality of platform application program interfaces and an engine layer comprising a preset engine.
Each cross-platform application program interface corresponds to an event, each platform application program interface can realize a function corresponding to the event, each event corresponds to a plurality of target platform application program interfaces, and each target platform application program interface corresponds to an operating environment.
Specifically, taking an android platform as an example, after compiling and analyzing a software package, two parts of contents exist, wherein one part is a compiling product containing a preset engine, and the other part is a compiling product used for starting the preset engine to form an engine layer and capable of loading and forming a platform application program interface layer and a cross-platform application program interface layer. In order to reduce the occupation of the client resources, in the embodiment of the present disclosure, a lazy loading manner may be adopted for each platform application program interface in the platform application program interface layer, and then application and occupation of related resources are performed when needed.
Therefore, when the application program runs in the client or other electronic equipment, a needed cross-platform application program interface is constructed, so that the application program can smoothly and normally implement the functions of the application program no matter what the current platform or running environment is.
In an implementation manner, referring to fig. 5, in order to form the software package, before implementing the implementation method of the functions in the application program provided in the disclosure, the following steps 301 and 302 need to be implemented, and an execution body of the technical solution corresponding to the steps 301 and 302 may be a client or a server used by a developer.
301. At least one platform application program interface is obtained.
Each platform API corresponds to an operating system/platform/operating environment, and each platform API is used for realizing a function corresponding to an event. By way of example, each platform API may be specifically one of the following operating system level functional APIs: picture decoding, video encoding and decoding, custom network communication protocol, and inter-process memory copying.
Specifically, the development requirements (may be a specific function list, and functions required in the function list may be various functions required in the development process, such as drawing a window, acquiring memory information, reading and writing data, etc.) may be acquired first by acquiring at least one platform API, and then the platform API corresponding to the development requirements is acquired from at least one operating system. Taking development requirements as a function list, each operating system has a description document corresponding to its platform API, so that the corresponding platform API can be selected according to each function in the function list and the platform API description document of each operating system.
For example, in this disclosure, for different operating systems, platform APIs corresponding to each bottom layer function may be obtained according to a technical document of the operating system, after the platform APIs are obtained, a corresponding platform API list is formed according to the platform APIs, and then all the platform APIs may be packaged according to different functions or categories. The platform API obtained in the present disclosure may form a platform application program interface layer in the functional hierarchy of the runtime container as shown in fig. 6 after encapsulation; in this disclosure, this layer defines unified APIs and specifications, defining the specifications that the runtime container of fig. 6 must adhere to when running on different platforms to implement the capabilities of the respective APIs in the platform API layer. In addition, it should be noted that, when this layer is formed, the platform API may be encapsulated according to its corresponding function, or any other feasible manner, which is not specifically limited to this application.
302. Exposing the platform application program interface in the preset container through the preset engine.
Illustratively, in the present disclosure, the preset container may be flutter runtime container and the preset engine may be flutter engine. Referring to fig. 6, taking a preset container as a flutter runtime container and a preset engine as a flutter engine as an example, the disclosure changes the implementation of the original flutter dependence into a platform application program interface layer which can be formed by using the step 301 by rewriting the flutter engine, and simultaneously adds, modifies and deletes some APIs exposed to the frame framework layer to the flutter engine, so that in the flutter runtime container, the flutter engine (in the disclosure, the flutter engine may be the flutter engine layer) can encapsulate the platform APIs in the platform API layer to form flutter framework API (flutter frame application program interface in the uppermost layer (in the disclosure, referred to as a cross-platform API layer) in the cross-platform API layer, that is, some APIs are exposed (corresponding to the step 302) in the foregoing cross-platform application program interface), so that a developer can write application codes (that is, codes corresponding to the application programs) according to own requirements by using the flutter framework API exposed in the uppermost layer to implement corresponding functions. Furthermore, since skia is used as a rendering engine in flutter engines, and Skia is not a custom set of components to map UI components of different platforms, but a user completes the design of the UI components according to own requirements, if flutter engines and flutter runtime containers are adopted in the present disclosure, the purpose of freely expanding different scenes can be achieved, and the defect of limited scenes in the existing cross-platform development scheme is avoided. In addition, flutter technologies also provide a set of widget systems similar to web pages to construct a UI, and widgets can be freely expanded, so when the flutter engine and flutter runtime container are adopted in the present disclosure, developers can also construct the UI more freely during development, and the rich display effect of the application is ensured, so as to improve user experience. In the present disclosure, exposing a specific vocabulary belonging to software engineering specifically refers to providing an interface that can be called by a developer, and without exposing an API, the developer cannot call a corresponding function during development.
It should be noted that, in practice, if the platform APIs are too many, the performance requirements of the preset engine are too large, so that the code of the developed application program is too bulky and large, and is inconvenient for debugging and maintenance, so in order to avoid this, the platform APIs in the present disclosure may only have those APIs corresponding to functions that affect the key performance of the operating system. In addition, when the platform APIs are exposed, the platform APIs belonging to different operating systems are exposed after being packaged according to corresponding functions according to the differences of different operating platforms, so that a developer can call a unified cross-platform API, namely, when the developer calls a certain cross-platform API, the developer actually calls a plurality of platform APIs belonging to different operating systems, and the developed codes can be applicable to a plurality of different operating systems.
Based on the above scheme, because the platform API is exposed in the preset container through the preset engine, the safety of the platform API is ensured, and meanwhile, because the platform API in the above technical scheme corresponds to a plurality of operating systems, when a developer develops an application through the exposed platform API, the developed application code can call different APIs aiming at different operating systems according to the self requirement, so the finally developed code can be suitable for a plurality of different operating systems, the development efficiency is high, and the development is not needed to depend on a native platform for development, so that the development scheme of supporting a plurality of different platforms without safely realizing one set of code through the native platform can be achieved. Furthermore, in the technical scheme of the disclosure, the platform API of the operating system level can be called, and the platform API can directly exchange and communicate data between processes without communication serialization communication, so that the performance of the application program after development is improved, and the user experience is improved.
Optionally, referring to fig. 7 in conjunction with fig. 5, since some functions of the preset engine itself are also required for the developer to use when the preset engine is used as an important part of developing the application, in order to meet the use requirement of the developer on the preset engine itself, step 301 may further include 303:
303. And exposing a core application program interface corresponding to the preset engine in the preset container.
By way of example, taking the preset container as flutter runtime container and the preset engine as flutter engine as an example, referring to fig. 6, in the flutter runtime container, the core API is located at a second layer (referred to as a platform extension layer in this disclosure), which may encapsulate the core API contained in itself into a part of the flutter framework application program interface of the uppermost layer (cross-platform application program interface layer) for use by a developer.
Referring to fig. 8 in conjunction with fig. 5, because the functions of the platform API may be relatively fixed in practice, sometimes the developer may need a variant of the corresponding functions of the platform API in the required functions, for example, the original platform API may implement a circle drawing function, and the developer may need a drawing function, at this time, if the platform API cannot be modified, the requirement of the developer may not be met, so step 302 may include 3021 to 3023:
3021. and receiving a modification instruction.
The modification instruction is used for indicating modification to the platform API.
Because not all platform APIs need to be modified for functionality, the modification instructions may also include an identification of the platform APIs that need to be modified. The specific modification may add an optional parameter to the original platform API to add new functionality.
3022. And modifying the platform application program interface according to the modification instruction to obtain the target platform application program interface.
3023. Exposing the target platform application program interface in the preset container through the preset engine.
For example, taking a preset container as flutter runtime container and a preset engine as flutter engine as an example, referring to fig. 6, after exposing the platform API of the platform API layer, if a modification instruction sent by the development client is received by the flutter engine, a part of the platform API in the platform API layer is modified according to the modification instruction and packaged to form a custom architecture application program interface (customized framework API) of a second layer (platform expansion layer), and then packaged together with the unmodified platform API and the core API as a part of the flutter framework application program interface in the uppermost layer (cross-platform API layer). It should be noted that, the target platform API in the step 3022 includes a modified partial platform API and an unmodified platform API, and for the unmodified platform API, the modification instruction may be considered to indicate that the modification is null.
Therefore, the platform API can be conveniently modified by a developer to meet more development requirements.
Further optionally, based on the platform expansion layer in the technical solution corresponding to fig. 8, in the present disclosure, a first platform application program interface exists in at least one platform application program interface; the first platform application program interface is obtained by expanding corresponding functions on the basis of the original application program interface.
Therefore, the inherent platform API of the platform can expand more functions, the use of a user is facilitated, and the user experience is improved.
Referring to fig. 9 in conjunction with fig. 5, because a developer may need to use a function that the platform API does not have at all when developing an application, and at this time, modification of the platform API alone cannot meet the requirement, so that the developer needs to design a corresponding plug-in to complete the corresponding function, in the technical solutions corresponding to 301 and 302, the method further may include X1-X3:
And X1, receiving a plug-in building instruction.
The plug-in building instruction carries plug-in building information; the plug-in establishment instruction is used for indicating to establish the plug-in.
And X2, building a plug-in according to the built plug-in building instruction, and registering the built plug-in to obtain a plug-in application program interface corresponding to the plug-in.
Illustratively, taking the preset container as flutter runtime container and the preset engine as flutter engine as an example, referring to fig. 6, a plug-in may be registered at the uppermost layer (i.e., the cross-platform API layer), which may be referred to as flutter function block (flutter module) when the plug-in is completely written using the dart code, and may be referred to as flutter plug-in (flutter plugin) when the plug-in is implemented not only by the dart code but also needs to encapsulate the functions of some kind of native platform. In this disclosure, the plug-in may be a completely new function, or may be a full coverage (i.e., contain original functions, but also have new functions) of the platform API or the core API (corresponding to flutter engine).
And X3, exposing the plug-in application program interface in the preset container.
Illustratively, taking the preset container as flutter runtime container and the preset engine as flutter engine as examples, referring to fig. 6, the plug-in API may be a plug-in interface (pluin-INSSERVICE API) that may provide plug-in functions corresponding to flutter module and flutter plugin when used by a developer. The X3 step is mainly realized by the uppermost cross-platform API layer.
Therefore, development requirements of developers in different scenes can be guaranteed, and the developed application programs also comprise plug-ins capable of realizing unique functions, so that smooth development is guaranteed, and the use experience of subsequent application programs is improved.
Based on the technical solution corresponding to fig. 9, referring to fig. 10, the method for implementing functions in an application program provided by the present disclosure may further include S1-S3:
s1, monitoring and acquiring a second event of the application program.
S2, determining a plug-in corresponding to the second event.
The plug-in may be a plug-in the technical solution corresponding to fig. 9. Of course, in order to implement the technical solution corresponding to fig. 10, the software package obtained in step 200A should include the code corresponding to the platform expansion layer as shown in fig. 9, and then in step 200B, when the software package is compiled and parsed, the platform expansion layer may be constructed, so as to ensure that the second event generated when the subsequent application is used may be invoked by the corresponding plug-in. Whether the plug-in uses the own function to realize the corresponding function or uses the platform API to realize the corresponding function is specific, the disclosure is not specifically shown, and the disclosure is specific according to the actual requirement.
S3, running the plug-in to realize the function corresponding to the second event.
In this way, because the application program has the plug-in capable of realizing the unique functions, some of the functions can be more diversified and personalized, thereby achieving the purpose of improving the user experience.
Referring to fig. 11 in conjunction with fig. 5, in the technical solutions corresponding to 301 and 302, the method may further include 304:
304. exposing an application program interface of a third party software development kit in a preset container.
Wherein the third party SDK software development kit (SDK, software development kit) is for at least one or more of: calling preset APIs in all platform APIs and calling a third party API in a third party open source database; the preset API is an API with a stability parameter larger than a preset value, and the stability parameter is used for representing the stability and the data security degree of an application program corresponding to the API when the API is called.
By way of example, taking the preset container as flutter runtime container and the preset engine as flutter engine, referring to fig. 6, a third party SDK capable of implementing a function of calling a preset API in all platform APIs may be located at a second layer (platform expansion layer), specifically may be a "direct call SDK", and a third party SDK capable of implementing a function of calling a third party API in a third party open source database may be a "platform specific implementation (PLAT SPECIFIC IMPLEMENT)".
In this way, in addition to the various APIs that can be provided in the present disclosure, if a developer does not want to build a plug-in or modify a platform API, but wants to use an API with another function, the developer can obtain a corresponding API from another open source AIP library, so that the above-mentioned "platform-specific implementation" is required, which can provide more development possibilities for the developer and improve the use experience of the developer. In addition, for the preset API, the security of the application and the operating system where the application is located can be ensured even if the application is not subjected to flutter engines, so that the convenience is considered for the preset API, and the direct-tuning SDK is convenient for a developer to directly call the preset API in the platform API layer when using a certain third-party SDK, so that the development efficiency is improved.
It should be noted that, taking the preset container as flutter runtime container and the preset engine as flutter engine as an example, referring to fig. 6, since the written code corresponding to the flutter technology is the dart code, and the platform APIs of different operating systems are not necessarily written using the dart code, in order to complete the specific implementation of all APIs (platform APIs) and the transcoding of the third party APIs acquired by the "platform specific implementation", the second layer (platform extension layer) further includes "dart implementation".
In the above technical solution, platform APIs of a plurality of operating systems are first obtained, and then the platform APIs are exposed in a preset container through a preset engine. Because the platform API is exposed in the preset container through the preset engine, the safety of the platform API is ensured, and meanwhile, because the platform API in the technical scheme of the disclosure corresponds to a plurality of operating systems, when a developer develops an application through the exposed platform API, the developed application code can call different APIs aiming at different operating systems according to own requirements, so that the finally developed code can be suitable for a plurality of different operating systems, the development efficiency is high, the development is not needed to depend on a native platform, and the development scheme that one set of code supports a plurality of different platforms can be realized without the safety of the native platform.
Based on the foregoing technical solution, after a developer compiles an application using the solution, when the package of the application is compiled in any platform (operating system, such as ios system), two parts are generated according to the characteristics of the platform, wherein the first part includes a flutter engine corresponding to the platform and a platform API corresponding to the platform, and the second part includes AOT (aheadof time) compiled product snapshot running in a running environment (flutter runtime container and dart virtual machine (generated by flutter engine)) created in the first part. When the application is started, the flutter engine in the first part is immediately loaded to finish initialization, a flutter engine layer and a platform API layer in a flutter runtime container are formed, and an API (convenience is brought to the platform expansion layer) which can be called by the platform expansion layer is provided; the platform API in the platform API layer applies for the bottom layer resource to the platform, and in order to ensure that the bottom layer resource (memory resource, CPU resource and the like) is applied for too much by the application, a part of the platform APIs in the platform API layer can be lazy loaded, namely only part of the platform APIs can be applied for the bottom layer resource during initialization, and the other part of the platform APIs can be applied for the bottom layer resource only when the platform APIs need to be used. After the initialization of the engine layer and the platform API layer is finished flutter, the AOT compiling product snapshot of the second part can finish the initialization of the cross-platform API layer and the platform expansion layer in the operation environment formed by the initialization of the engine layer and the platform API layer flutter. And then the application is started successfully, when the application is used by a user, the flutter engine controls the rendering of the page UI and monitors the operation of the user, and for the operation of the user, the flutter engine triggers the corresponding callback event to be sent to the corresponding upper layer API (for example flutter framework API in the previous embodiment) in the cross-platform API layer, and the cross-platform API layer can utilize the capability of calling different layers according to the upper layer API receiving the event to call the resources (including network resources, GPU resources, CPU resources, file IO resources, memory resources, cross-process communication resources and the like) of the platform, so that the functions of picture editing, video transcoding and the like corresponding to the operation of the user are completed. Generally, an application developed through the scheme of the application can produce flutter runtime containers in the foregoing embodiments in a platform, the containers take over tasks similar to native processes in native applications, and the capabilities or resources of the platform can be packaged layer by layer through different layers in the containers, and finally, the application is supplied and used by exposing simple and easy-to-use upper-layer APIs through cross-platform APIs, so that the technical scheme provided by the application can ensure that the finally developed cross-platform application can smoothly realize corresponding palace on different platforms.
Optionally, based on the technical solution corresponding to fig. 11, the method for implementing functions in an application program provided by the present disclosure, as shown in fig. 12, may further include L1-L3:
And L1, monitoring and acquiring a third event of the application program.
And L2, determining a third party software development kit application program interface corresponding to the third event.
And L3, realizing a function corresponding to the third event through a third party software development kit application program interface.
Therefore, when the application program is used, the platform APIs or open source APIs databases outside the operating system, which do not influence the safety and stability of the operating system, can be realized through the third party SDK application program interface, so that the diversity and the freedom of the application program functions are ensured, and the user experience is improved.
The foregoing description has mainly described the solutions provided by the embodiments of the present disclosure from the perspective of the server. It will be appreciated that the server may implement the above functions by implementing means of the functions in the application program configured therein, respectively. In order to implement the above functions, the implementation device of the functions in the application program includes hardware structures and/or software modules that perform the respective functions, and these hardware structures and/or software modules that perform the respective functions may form a terminal. Those of skill in the art will readily appreciate that the algorithm steps of the examples described in connection with the embodiments disclosed herein may be implemented as hardware or a combination of hardware and computer software. Whether a function is implemented as hardware or computer software driven hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present disclosure.
The embodiment of the disclosure may divide functional modules of a server according to the above method example, for example, the server may include a device for implementing functions in an application program, where the device for implementing functions in an application program may divide each functional module corresponding to each function, or may integrate two or more functions into one processing module. The integrated modules may be implemented in hardware or in software functional modules. It should be noted that, in the embodiment of the present disclosure, the division of the modules is merely a logic function division, and other division manners may be implemented in actual practice.
In the case of dividing the respective functional modules by the respective functions, fig. 13 shows a possible configuration diagram of the function implementing apparatus 03 in the application program applied to the client 01 shown in fig. 1, the function implementing apparatus 03 in the application program including: a listening module 31, a determining module 32 and a processing module 33.
Specifically, the monitoring module 31 is configured to monitor and acquire a first event of the application program; a determining module 32 configured to determine a cross-platform application program interface corresponding to the first event acquired by the listening module 31; the cross-platform application program interfaces are packaged by at least one platform application program interface with functions corresponding to the first event, and each platform application program interface corresponds to one running environment; the processing module 33 is configured to call the platform application program interface corresponding to the current running environment through the cross-platform application program interface determined by the determining module 32, so as to implement the function corresponding to the first event.
Optionally, the processing module 33 is specifically configured to: the cross-platform application program interface determined by the determining module 32 through the preset engine is utilized to call the platform application program interface corresponding to the current running environment, so as to realize the function corresponding to the first event.
Optionally, the device further comprises an acquisition module; the acquisition module is configured to: acquiring a software package corresponding to an application program; compiling and analyzing the software package to construct a cross-platform application program interface layer comprising a plurality of cross-platform application program interfaces, a platform application program interface layer comprising a plurality of platform application program interfaces and an engine layer comprising a preset engine; each cross-platform application program interface corresponds to an event, each platform application program interface can realize a function corresponding to the event, each event corresponds to a plurality of target platform application program interfaces, and each target platform application program interface corresponds to an operating environment.
Optionally, a first platform application program interface exists in the at least one platform application program interface; the first platform application program interface is obtained by expanding corresponding functions on the basis of the original application program interface.
Optionally, the listening module 31 is further configured to listen for and acquire a second event of the application; the determining module 32 is further configured to determine a plug-in corresponding to the second event acquired by the listening module 31; the processing module 33 is further configured to run the plug-in determined by the determining module 32 to implement the function corresponding to the second event.
Optionally, the processing module 33 is specifically configured to: the method comprises the steps of calling a platform application program interface corresponding to a current running environment through a cross-platform application program interface to obtain platform resources required by a first event; platform resources include any one or more of the following: network resources, GPU resources, CPU resources, document IO resources, memory resources, and cross-process communication resources; and loading platform resources to realize the functions corresponding to the first event.
The specific manner and relevant advantageous effects of performing the operations by the respective modules in the apparatus for implementing the functions in the application program in the above embodiment have been described in detail in the foregoing embodiment of the method for implementing the functions in the application program, and will not be described in detail herein.
In the case of using integrated units, fig. 14 is a schematic diagram of one possible structure of the electronic device shown in the foregoing embodiment, where the electronic device may be a device for implementing functions in an application program, or may be a client or a server that includes the device. As shown in fig. 14, the electronic device includes a processor 41 and a memory 42. The memory 42 is configured to store instructions executable by the processor 41, and the processor 41 may implement the functions of each module in the implementation device 03 of the functions in the application program in the above embodiment.
Therein, in a specific implementation, as an embodiment, the processor 41 (41-1 and 41-2) may include one or more CPUs, such as CPU0 and CPU1 shown in FIG. 14. And as an example, 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). The processor 41 herein may refer to one or more devices, circuits, and/or processing cores for processing data (e.g., computer program instructions).
The memory 42 may be, but is not limited to, a read-only memory 42 (ROM) or other type of static storage device that can store static information and instructions, a random access memory (random access memory, RAM) or other type of dynamic storage device that can store information and instructions, or an electrically erasable programmable read-only memory (ELECTRICALLY ERASABLE PROGRAMMABLE READ-only memory, EEPROM), a compact disc (compact disc read-only memory) or other optical disc storage, optical disc storage (including compact disc, laser disc, optical disc, digital versatile disc, blu-ray disc, etc.), magnetic disk readable storage media or other magnetic storage devices, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and that can be accessed by a computer. The memory 42 may be stand alone and may be coupled to the processor 41 via a bus 43. Memory 42 may also be integrated with processor 41.
Bus 43 may be an industry standard architecture (industry standard architecture, ISA) bus, an external device interconnect (PERIPHERAL COMPONENT INTERCONNECT, PCI) bus, or an extended industry standard architecture (extended industry standard architecture, EISA) bus, among others. The bus 43 may be classified into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in fig. 14, but not only one bus or one type of bus.
In addition, to facilitate information interaction of the electronic device with other devices (e.g., servers or clients), the electronic device includes a communication interface 44. Communication interface 44, using any transceiver-like device, is used to communicate with other devices or communication networks, such as a control system, a radio access network (radio access network, RAN), a wireless local area network (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.
In some embodiments, referring to fig. 15, the electronic device may be a client, where the electronic device further optionally includes: a peripheral interface 45 and at least one peripheral. The processor 41, memory 42 and peripheral interface 45 may be connected by a bus 43 or signal line. The individual peripheral devices may be connected to the peripheral device interface 45 via a bus 43, signal lines or a circuit board. Specifically, the peripheral device includes: at least one of radio frequency circuitry 46, a display screen 47, a camera 48, audio circuitry 49, a positioning assembly 50, and a power source 51.
Peripheral interface 45 may be used to connect at least one input/output (I/O) related peripheral to processor 41 and memory 42. In some embodiments, processor 41, memory 42, and peripheral interface 45 are integrated on the same chip or circuit board; in some other embodiments, either or both of the processor 41, the memory 42, and the peripheral interface 45 may be implemented on separate chips or circuit boards, which is not limited in this embodiment.
The radio frequency circuit 46 is used to receive and transmit RF (radio frequency) signals, also known as electromagnetic signals. The radio frequency circuit 46 communicates with a communication network and other communication devices via electromagnetic signals. The radio frequency circuit 46 converts the electrical signal to an electromagnetic signal for transmission, or converts the received electromagnetic signal to an electrical signal. Optionally, the radio frequency circuit 404 includes: antenna systems, RF transceivers, one or more amplifiers, tuners, oscillators, digital signal processors, codec chipsets, subscriber identity module cards, and so forth. The radio frequency circuit 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 networks, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and/or Wi-Fi (WIRELESS FIDELITY ) networks. In some embodiments, the radio frequency circuitry 46 may also include NFC (NEAR FIELD communication) related circuitry, which is not limited by this disclosure.
The display screen 47 is used to display a UI (user interface). The UI may include graphics, text, icons, video, and any combination thereof. When the display screen 47 is a display screen, the display screen 47 also has the ability to collect touch signals at or above the surface of the display screen 47. The touch signal may be input as a control signal to the processor 41 for processing. At this time, 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. In some embodiments, the display 47 may be one, providing a front panel of the client; the display screen 47 may be made of LCD (liquid CRYSTAL DISPLAY), OLED (organic light-emitting diode) or other materials.
The camera assembly 48 is used to capture images or video. Optionally, the camera assembly 48 includes a front camera and a rear camera. Typically, the front camera is disposed on the front panel of the terminal and the rear camera is disposed on the rear surface of the terminal. The audio circuit 49 may include a microphone and a speaker. The microphone is used for collecting sound waves of users and the environment, converting the sound waves into electric signals, and inputting the electric signals to the processor 41 for processing, or inputting the electric signals to the radio frequency circuit 46 for voice communication. For the purpose of stereo acquisition or noise reduction, a plurality of microphones can be respectively arranged at different positions of the client. The microphone may also be an array microphone or an omni-directional pickup microphone. The speaker is used to convert electrical signals from the processor 41 or the radio frequency circuit 46 into sound waves. The speaker may be a conventional thin film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, not only the electric signal can be converted into a sound wave audible to humans, but also the electric signal can be converted into a sound wave inaudible to humans for ranging and other purposes. In some embodiments, audio circuit 49 may also include a headphone jack.
The locating component 50 is used to locate the current geographic location of the client to enable navigation or LBS (location based service, location-based services). The positioning component 50 may be a positioning component based on the united states GPS (global positioning system ), the beidou system of china, the grainer system of russia, or the galileo system of the european union.
The power supply 51 is used to power the various components in the client. The power source 51 may be alternating current, direct current, disposable or rechargeable. When the power supply 51 includes a rechargeable battery, the rechargeable battery may support wired or wireless charging. The rechargeable battery may also be used to support fast charge technology.
In some embodiments, the electronic device further includes one or more sensors 410. The one or more sensors 410 include, but are not limited to: acceleration sensor, gyroscope sensor, pressure sensor, fingerprint sensor, optical sensor, and proximity sensor.
The acceleration sensor may detect the magnitudes of accelerations on three coordinate axes of a coordinate system established with the client. The gyroscope sensor can detect the body direction and the rotation angle of the client, and the gyroscope sensor can be cooperated with the acceleration sensor to collect the 3D action of the user on the client. The pressure sensor may be disposed on the side frame of the client and/or under the display screen 47. When the pressure sensor is provided at the side frame of the terminal 01, a user's grip signal to the client can be detected. The fingerprint sensor is used for collecting fingerprints of a user. The optical sensor is used to collect the ambient light intensity. Proximity sensors, also known as distance sensors, are typically provided on the front panel of the client. The proximity sensor is used to collect the distance between the user and the front face of the client.
It will be appreciated by those skilled in the art that the structures shown in fig. 14 or 15 do not constitute a limitation of the electronic device, and may include more or fewer components than shown, or may combine certain components, or employ a different arrangement of components.
The present disclosure also provides a computer-readable storage medium having instructions stored thereon, which when executed by a processor of an electronic device, enable the electronic device to perform the method for implementing the functions in an application provided in the foregoing embodiment on the means for implementing the functions in an application in an electronic device.
The disclosed embodiments also provide a computer program product containing instructions that, when run on an electronic device, cause the electronic device to perform the method of implementing the functions in the application provided in the foregoing embodiments.
It will be apparent to those skilled in the art from this description that, for convenience and brevity of description, only the above-described division of the functional modules is illustrated, and in practical application, the above-described functional allocation may be performed by different functional modules according to needs, i.e. the internal structure of the apparatus is divided into different functional modules to perform all or part of the functions described above.
In the several embodiments provided by the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of modules or units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another apparatus, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and the parts shown as units may be one physical unit or a plurality of physical units, may be located in one place, or may be distributed in a plurality of different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a readable storage medium. Based on such understanding, the technical solution of the embodiments of the present application may be essentially or a part contributing to the prior art or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, including several instructions for causing a device (may be a single-chip microcomputer, a chip or the like) or a processor (processor) to perform all or part of the steps of the method described in the embodiments of the present application. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk, etc.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any adaptations, uses, or adaptations of the disclosure following the general principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

1. A method for implementing a function in an application program, comprising:
acquiring a software package corresponding to an application program;
compiling and analyzing the software package to construct a cross-platform application program interface layer comprising a plurality of cross-platform application program interfaces, a platform application program interface layer comprising a plurality of platform application program interfaces and an engine layer comprising a preset engine; each event corresponds to a plurality of target platform application program interfaces;
Monitoring and acquiring a first event of an application program;
Determining a cross-platform application program interface corresponding to the first event; the cross-platform application program interfaces are packaged by a plurality of platform application program interfaces with functions corresponding to the first event, each platform application program interface corresponds to an operating environment, one platform application program interface is used for realizing the functions corresponding to the event, and the platform application program interfaces are application program interfaces in a platform for running the application program;
and calling a platform application program interface corresponding to the current running environment through the cross-platform application program interface by using a preset engine so as to realize the function corresponding to the first event.
2. The method for implementing functions in an application program according to claim 1, wherein a first platform application program interface exists in the plurality of platform application program interfaces; the first platform application program interface is obtained by expanding corresponding functions on the basis of the original application program interface.
3. The method for implementing functions in an application program according to claim 1, further comprising:
monitoring and acquiring a second event of the application program;
Determining a plug-in corresponding to the second event;
And running the plug-in to realize the function corresponding to the second event.
4. The method for implementing the function in the application program according to claim 1, wherein the calling, through the cross-platform application program interface, the platform application program interface corresponding to the current running environment to implement the function corresponding to the first event includes:
Calling a platform application program interface corresponding to the current running environment through the cross-platform application program interface to acquire platform resources required by the first event; the platform resources include any one or more of the following: network resources, GPU resources, CPU resources, document IO resources, memory resources, and cross-process communication resources;
And loading the platform resource to realize the function corresponding to the first event.
5. An apparatus for implementing a function in an application program, comprising:
The acquisition module is configured to: acquiring a software package corresponding to an application program;
the processing module is configured to compile and analyze the software package to construct a cross-platform application program interface layer comprising a plurality of cross-platform application program interfaces, a platform application program interface layer comprising a plurality of platform application program interfaces and an engine layer comprising a preset engine; each event corresponds to a plurality of target platform application program interfaces;
the monitoring module is configured to monitor and acquire a first event of the application program;
The determining module is configured to determine a cross-platform application program interface corresponding to the first event acquired by the monitoring module; the cross-platform application program interfaces are packaged by a plurality of platform application program interfaces with functions corresponding to the first event, each platform application program interface corresponds to an operating environment, one platform application program interface is used for realizing the functions corresponding to the event, and the platform application program interfaces are application program interfaces in a platform for running the application program;
the processing module is configured to call the platform application program interface corresponding to the current running environment by using the cross-platform application program interface determined by the determining module through the preset engine so as to realize the function corresponding to the first event.
6. The apparatus for implementing functions in an application program according to claim 5, wherein a first platform application program interface exists among the plurality of platform application program interfaces; the first platform application program interface is obtained by expanding corresponding functions on the basis of the original application program interface.
7. The apparatus for implementing functions in an application program as claimed in claim 5, wherein,
The monitoring module is further configured to monitor and acquire a second event of the application program;
The determining module is further configured to determine a plug-in corresponding to the second event acquired by the monitoring module;
The processing module is further configured to run the plug-in determined by the determining module to implement a function corresponding to a second event.
8. The apparatus for implementing functions in an application program according to claim 5, wherein the processing module is specifically configured to:
Calling a platform application program interface corresponding to the current running environment through the cross-platform application program interface to acquire platform resources required by the first event; the platform resources include any one or more of the following: network resources, GPU resources, CPU resources, document IO resources, memory resources, and cross-process communication resources;
And loading the platform resource to realize the function corresponding to the first event.
9. An electronic device, comprising:
A processor;
a memory for storing the processor-executable instructions;
Wherein the processor is configured to execute the instructions to implement a method of implementing a function in an application as claimed in any one of claims 1-4.
10. A computer readable storage medium having instructions stored thereon, which, when executed by a processor of an electronic device, cause the electronic device to perform a method of implementing functions in an application as claimed in any of claims 1-4.
CN202110310126.9A 2021-03-23 2021-03-23 Method and device for realizing functions in application program, electronic equipment and storage medium Active CN113094123B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202110310126.9A CN113094123B (en) 2021-03-23 2021-03-23 Method and device for realizing functions in application program, electronic equipment and storage medium
PCT/CN2021/135062 WO2022199111A1 (en) 2021-03-23 2021-12-02 Method and apparatus for implementing functions in application program, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110310126.9A CN113094123B (en) 2021-03-23 2021-03-23 Method and device for realizing functions in application program, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113094123A CN113094123A (en) 2021-07-09
CN113094123B true CN113094123B (en) 2024-10-25

Family

ID=76669111

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110310126.9A Active CN113094123B (en) 2021-03-23 2021-03-23 Method and device for realizing functions in application program, electronic equipment and storage medium

Country Status (2)

Country Link
CN (1) CN113094123B (en)
WO (1) WO2022199111A1 (en)

Families Citing this family (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113094123B (en) * 2021-03-23 2024-10-25 北京达佳互联信息技术有限公司 Method and device for realizing functions in application program, electronic equipment and storage medium
CN113608801A (en) * 2021-07-19 2021-11-05 上海浦东发展银行股份有限公司 Interface calling method and device, computer equipment and storage medium
CN113485746B (en) * 2021-07-28 2024-02-06 山石网科通信技术股份有限公司 Method and device for generating application program interface document
CN113608803A (en) * 2021-08-16 2021-11-05 上海万物新生环保科技集团有限公司 Method and equipment for realizing functional operation in multi-operation environment
CN113766318A (en) * 2021-09-09 2021-12-07 世纪龙信息网络有限责任公司 Video generation method, device, storage medium and computer equipment
CN113918214A (en) * 2021-09-24 2022-01-11 海宁奕斯伟集成电路设计有限公司 Program running method, device, electronic device and storage medium
CN113722019B (en) * 2021-11-04 2022-02-08 海尔数字科技(青岛)有限公司 Display method, device and equipment of platform program
CN114049416B (en) * 2021-11-16 2025-04-25 珠海金山数字网络科技有限公司 Animation data acquisition method and device
CN114356307A (en) * 2021-12-17 2022-04-15 上海浦东发展银行股份有限公司 Service interaction method and device, electronic equipment and storage medium
CN114398580A (en) * 2022-01-04 2022-04-26 深圳十方融海科技有限公司 Cross-platform recording method and device, electronic equipment and storage medium
CN114385265B (en) * 2022-01-13 2024-07-09 土巴兔集团股份有限公司 Network environment switching method based on cross-platform development technology and related equipment thereof
CN114443123A (en) * 2022-01-29 2022-05-06 北京天玛智控科技股份有限公司 Method, device, electronic device and storage medium for realizing cross-platform support electronic control system
CN114840271B (en) * 2022-05-20 2024-11-26 北京雷石天地电子技术有限公司 Device function conversion method, device and computer readable storage medium
CN116420138A (en) * 2022-06-23 2023-07-11 广州视源电子科技股份有限公司 A desktop element operation method, electronic equipment and intelligent interactive tablet
CN115866248B (en) * 2022-11-08 2024-01-19 格兰菲智能科技有限公司 Video transcoding method, device, computer equipment and storage medium
CN117009029B (en) * 2023-05-26 2024-09-24 浙江天猫技术有限公司 XR application and content operation method, device and storage medium
CN116302366B (en) * 2023-05-26 2023-10-20 阿里巴巴(中国)有限公司 XR application development systems and methods, equipment and media for terminal development
CN117389647B (en) * 2023-10-11 2025-04-29 北京百度网讯科技有限公司 Plug-in generation method, application development method, device, equipment and medium
CN120179304A (en) * 2023-12-19 2025-06-20 华为技术有限公司 Application management method and related device
CN117555645B (en) * 2024-01-12 2024-04-05 腾讯科技(深圳)有限公司 Data processing method, device, equipment and medium based on multi-terminal application platform
CN118426876B (en) * 2024-07-05 2024-09-17 广州六环信息科技有限公司 Application program interface generating device, method, storage medium and system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102681893A (en) * 2011-03-09 2012-09-19 腾讯科技(深圳)有限公司 Cross-platform implementation method for executable programs and mobile terminal
CN103823697A (en) * 2014-02-27 2014-05-28 百度在线网络技术(北京)有限公司 Cross-platform implementing method of application, system and plug-in manager
CN108279952A (en) * 2018-01-23 2018-07-13 浙江科澜信息技术有限公司 A kind of realization method and system of cross-platform window management

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7907966B1 (en) * 2005-07-19 2011-03-15 Aol Inc. System and method for cross-platform applications on a wireless phone
CN103761087B (en) * 2014-01-03 2016-10-12 北京京东尚科信息技术有限公司 A kind of mobile applications cross-platform development method and device
CN113094123B (en) * 2021-03-23 2024-10-25 北京达佳互联信息技术有限公司 Method and device for realizing functions in application program, electronic equipment and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102681893A (en) * 2011-03-09 2012-09-19 腾讯科技(深圳)有限公司 Cross-platform implementation method for executable programs and mobile terminal
CN103823697A (en) * 2014-02-27 2014-05-28 百度在线网络技术(北京)有限公司 Cross-platform implementing method of application, system and plug-in manager
CN108279952A (en) * 2018-01-23 2018-07-13 浙江科澜信息技术有限公司 A kind of realization method and system of cross-platform window management

Also Published As

Publication number Publication date
CN113094123A (en) 2021-07-09
WO2022199111A1 (en) 2022-09-29

Similar Documents

Publication Publication Date Title
CN113094123B (en) Method and device for realizing functions in application program, electronic equipment and storage medium
US11853820B2 (en) Cross-process communication method, apparatus, and device
CN113032766B (en) Application authority management method and device
US12437087B2 (en) Permission reuse method, permission reuse-based resource access method, and related device
CN113190362B (en) Service calling method and device, computer equipment and storage medium
CN112420217B (en) Message pushing method, device, equipment and storage medium
CN108376066B (en) Code processing device and code processing method
CN112988177B (en) Application installation package release method, application program operation method, server and terminal
CN113867848A (en) Graphical interface calling method, apparatus, device and readable storage medium
CN113138771B (en) Data processing method, device, equipment and storage medium
CN111125602B (en) Page construction method, device, equipment and storage medium
CN114138290B (en) Method, device, computer equipment and storage medium for generating application installation package
CN116991532A (en) A method, electronic device and system for displaying a virtual machine window
CN112612539B (en) Data model unloading method and device, electronic equipment and storage medium
US20240036891A1 (en) Sub-application running method and apparatus, electronic device, program product, and storage medium
CN111290746A (en) Object access method, apparatus, device and storage medium
CN113312249A (en) Log data generation method, log data display method and device
CN110751592A (en) Graphic resource conversion method, device, electronic device and storage medium
CN113536387B (en) Terminal and method for detecting integrity of kernel data
CN113448858A (en) Class conflict detection method, device, equipment and readable storage medium
CN113392120A (en) Method and device for acquiring execution information of SQLite
CN113485923A (en) Item code detection method and device and electronic equipment
CN113867999B (en) Application exception handling method, terminal and computer-readable storage medium
CN114385723A (en) Data reading method and device, electronic equipment and storage medium
CN113220396B (en) Embedded page management method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant