CN113094123A - 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 PDFInfo
- Publication number
- CN113094123A CN113094123A CN202110310126.9A CN202110310126A CN113094123A CN 113094123 A CN113094123 A CN 113094123A CN 202110310126 A CN202110310126 A CN 202110310126A CN 113094123 A CN113094123 A CN 113094123A
- Authority
- CN
- China
- Prior art keywords
- application program
- platform
- program interface
- event
- 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.)
- Granted
Links
- 230000006870 function Effects 0.000 title claims abstract description 166
- 238000000034 method Methods 0.000 title claims abstract description 66
- 238000012544 monitoring process Methods 0.000 claims abstract description 18
- 238000004806 packaging method and process Methods 0.000 claims abstract description 10
- 238000004891 communication Methods 0.000 claims description 24
- 238000012545 processing Methods 0.000 claims description 17
- 238000004590 computer program Methods 0.000 claims description 4
- 238000011161 development Methods 0.000 description 46
- 239000008186 active pharmaceutical agent Substances 0.000 description 25
- 230000004048 modification Effects 0.000 description 11
- 238000012986 modification Methods 0.000 description 11
- 230000002093 peripheral effect Effects 0.000 description 11
- 238000010586 diagram Methods 0.000 description 9
- 230000003287 optical effect Effects 0.000 description 6
- 230000008569 process Effects 0.000 description 5
- 230000001133 acceleration Effects 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 4
- 238000009877 rendering Methods 0.000 description 4
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000013461 design Methods 0.000 description 3
- 239000000919 ceramic Substances 0.000 description 2
- 238000006243 chemical reaction Methods 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 230000009471 action Effects 0.000 description 1
- 230000006978 adaptation Effects 0.000 description 1
- 230000003190 augmentative effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 239000011159 matrix material Substances 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/448—Execution paradigms, e.g. implementations of programming paradigms
- G06F9/4482—Procedural
- G06F9/4484—Executing subprograms
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
- G06F8/42—Syntactic analysis
- G06F8/427—Parsing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/76—Adapting 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 and a device for realizing functions in an application program, electronic equipment and a storage medium, which relate 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 interface is obtained by packaging at least one platform application program interface with a function corresponding to the first event, and each platform application program interface corresponds to one running environment; and calling the platform application program interface corresponding to the current operating environment through the cross-platform application program interface so as to realize the function corresponding to the first event.
Description
Technical Field
The embodiment of the disclosure relates to the field of electronic technologies, and in particular, to a method and an apparatus for implementing a function in an application program, an electronic device, and a storage medium.
Background
With the rapid development of the mobile internet, at present, there are a plurality of different operating systems (terminal platforms or platforms for short) that can be used by a terminal device, so in order to improve development efficiency and reduce development cost, software applications developed by the terminal device can be used on different platforms, manufacturers of each software application often adopt a cross-platform development scheme, and a technical scheme that a set of codes of the software applications can be run on different platforms is realized.
However, most of the current cross-platform development schemes are limited in the aimed scenes, so that the developed cross-platform software application has limited performance and cannot be normally used in the operating environments of different platforms well.
Disclosure of Invention
The disclosure relates to a method, a device, a server and a readable storage medium for realizing functions in an application program, which can support development schemes of various different platforms without realizing a set of codes safely through a native platform.
In order to achieve the above purpose, the embodiment of the present disclosure adopts the following technical solutions:
in a first aspect, a method for implementing functions 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 interface is obtained by packaging at least one platform application program interface with a function corresponding to the first event, and each platform application program interface corresponds to one running environment; and calling the platform application program interface corresponding to the current operating 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 implemented by calling a platform application program interface corresponding to the current operating environment through a cross-platform application program interface, where the function includes: and calling a platform application program interface corresponding to the current operating 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 includes: 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 the function corresponding to the event, each event corresponds to various target platform application program interfaces, and each target platform application program interface corresponds to one running environment.
Optionally, 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 native application program interface.
Optionally, the method further includes: monitoring and acquiring a second event of the application program; determining a plug-in corresponding to the second event; and operating the plug-in to realize the function corresponding to the second event.
Optionally, the calling the platform application program interface corresponding to the current operating environment through the cross-platform application program interface is used to implement a function corresponding to the first event, where the function includes: calling a platform application program interface corresponding to the current operating environment through a cross-platform application program interface to acquire platform resources required by a first event; the platform resources include any one or more of: network resources, GPU resources, CPU resources, file IO resources, memory resources, and cross-process communication resources; and loading platform resources to realize the function corresponding to the first event.
In a second aspect, an apparatus for implementing functions in an application program is provided, which includes 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 interface is obtained by packaging at least one platform application program interface with a function 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 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.
Optionally, the processing module is specifically configured to: and calling a platform application program interface corresponding to the current operating environment through the cross-platform application program interface determined by the determination module by using a preset engine so as to realize the function corresponding to the first event.
Optionally, the apparatus further includes an obtaining 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 the function corresponding to the event, each event corresponds to various target platform application program interfaces, and each target platform application program interface corresponds to one running environment.
Optionally, 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 native 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 determination module to realize the function corresponding to the second event.
Optionally, the processing module is specifically configured to: calling a platform application program interface corresponding to the current operating environment through a cross-platform application program interface to acquire platform resources required by a first event; the platform resources include any one or more of: network resources, GPU resources, CPU resources, file IO resources, memory resources, and cross-process communication resources; and loading platform resources to realize the function 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 the instructions to implement the implementation method of the functions in the application program as provided in the first aspect and any one of its possible embodiments.
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 program as provided in the first aspect and any one of its possible implementations.
In a fifth aspect, the present application further provides a computer program product, which includes one or more instructions that can be executed on an electronic device, so that the electronic device executes an implementation method of functions in an application program as in the first aspect and any possible implementation manner thereof.
It can be understood that, in the technical solution provided by the present disclosure, after monitoring and acquiring a first time of an application program, a device for implementing a method for implementing a function in the application program first determines a cross-platform application program interface corresponding to the first time; because the cross-platform application program interface is obtained by packaging 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; therefore, the device can 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, and further realize 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, developers can develop corresponding application programs without depending on various native platforms for the application programs needing cross-platform, 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 diagram of an implementation environment provided by an embodiment of the present disclosure;
fig. 2 is a first flowchart illustrating a method for implementing functions in an application according to an embodiment of the present disclosure;
fig. 3 is a second flowchart illustrating a method for implementing functions in an application according to an embodiment of the present disclosure;
fig. 4 is a third schematic flowchart of a method for implementing functions in an application according to an embodiment of the present disclosure;
fig. 5 is a first flowchart illustrating an application development method according to an embodiment of the present disclosure;
FIG. 6 is a schematic structural diagram of a run-time container according to an embodiment of the disclosure;
fig. 7 is a flowchart illustrating a second method for developing an application according to an embodiment of the present disclosure;
fig. 8 is a third schematic flowchart of an application program development method according to an embodiment of the present disclosure;
fig. 9 is a fourth schematic flowchart of an application program development method according to an embodiment of the present disclosure;
fig. 10 is a first supplementary flowchart illustrating a method for implementing functions in an application according to an embodiment of the present disclosure;
fig. 11 is a schematic flowchart of a method for developing an application according to an embodiment of the present disclosure;
fig. 12 is a schematic supplementary flowchart of a method for implementing functions in an application according to an embodiment of the present disclosure;
fig. 13 is a schematic structural diagram of an apparatus 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 present disclosure;
fig. 15 is a schematic structural diagram of another electronic device according to an embodiment of the present disclosure.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in 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 above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
In addition, in the description of the embodiments of the present disclosure, "/" indicates an inclusive meaning unless otherwise specified, for example, a/B may indicate a or B; "and/or" herein is merely an association describing an associated object, and means that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, 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 to which the present disclosure relates may be data that is authorized by a user or sufficiently authorized by parties.
First, technical terms related to the present disclosure are introduced:
flutter: the system 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 (world wide Web), desktop and embedded platforms.
The Flutter engine: is a portable runtime for running high quality mobile applications. It implements Flutter's core library, 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 method is a 2D vector graphic processing function library which comprises fonts, coordinate conversion and a dot-matrix diagram which have high-efficiency and concise performances.
API: an application programming interface (api), or api, is a predefined interface (e.g., function, HTTP interface), or a convention for linking different components of a software system, and is used to provide a set of routines for an application and a developer to access based on certain software or hardware, without accessing source code or understanding details of internal working mechanisms.
A run-time container: the software running time needs a running environment, and the running environment contains various functions needed by the software running.
And (3) SDK: known collectively as software development kit, a software development kit, and in particular, a collection of development tools used by software engineers to create application software for a particular software package, software framework, hardware platform, operating system, etc.
And (6) Dart: the computer programming language developed by google corporation is an object-oriented, class-defined, single-inheritance language.
Referring to fig. 1, a schematic diagram of an implementation environment that may be involved in the technical solution provided by the embodiment of the present disclosure 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 manner or a wireless communication manner.
By way of example, the client 01 in the embodiment of the present disclosure may be a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a Personal Digital Assistant (PDA), an Augmented Reality (AR) \ Virtual Reality (VR) device, and other devices capable of performing project development, and the embodiment of the present disclosure is not particularly limited to the specific form of the client.
For example, the server 02 in the present disclosure may be one server, or may be a server cluster formed by multiple servers, or one 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, and is also used for receiving a development request and a code sent by the client and completing construction of the application by using a framework set by the server.
Most of the existing cross-platform development schemes are limited in specific scenes, so that some development contents can only be subjected to primary development on a primary platform, the performance of finally developed software application is limited, and corresponding functions cannot be well realized on different platforms.
In order to solve the above problems, the present disclosure provides a method for implementing functions in an application program, which can conveniently implement normal use of the application program in different operating environments by using a cross-platform application program interface. The specific execution main body of the method may be the client or the server, and is determined according to actual requirements. In the following description of the embodiment 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 or a server that performs communication interaction with the terminal used by the developer.
Referring to fig. 2, a flowchart of a method for implementing functions in an application program is provided in the embodiment of the present disclosure. The method is executed by a device for implementing functions in an application program, and when the device for implementing functions in the application program is a client or a part of the client, the method may include 201 and 203:
201. and monitoring and acquiring a first event of the application program.
For example, the first event may be a click of a user clicking a certain control (e.g., "play", "share", "forward", etc.) in a display interface of an application while using the certain application; or the application program generates related events after receiving the corresponding functions triggered by the user; the present application is not particularly limited, and is particularly dependent on the circumstances.
In an implementation manner, in practice, since the first event is generated, corresponding recording information is necessarily generated in real time, step 201 may also be to obtain the recording information of the first event for characterizing the first event. The record information of the first event may be specifically obtained from a database that records record information for storing various events. The recording 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, and 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 interface is obtained by packaging 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.
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 encapsulating a platform application program interface capable of rendering the target image in an android platform, an ios platform, and a microsoft platform. The specific packaging method can be any feasible method. In the present disclosure, the operating environments and the platforms are in one-to-one correspondence, that is, each platform only corresponds to the respective operating environment.
203. And calling the platform application program interface corresponding to the current operating 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 a first time of an application program, a device for implementing a method for implementing functions in the application program first determines a cross-platform application program interface corresponding to the first time; because the cross-platform application program interface is obtained by packaging 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; therefore, the device can 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, and further realize 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, developers can develop corresponding application programs without depending on various native platforms for the application programs needing cross-platform, and the development efficiency is improved.
Optionally, with reference to fig. 3 in combination with fig. 2, the step 203 may specifically be:
203. and calling a platform application program interface corresponding to the current operating environment through the cross-platform application program interface by using a preset engine so as to realize the function corresponding to the first event.
For example, the preset engine may be a flutter engine.
Optionally, with reference to fig. 4 in combination with fig. 2, step 203 may further include 2031 and 2032:
2031. and calling a platform application program interface corresponding to the current operating environment through the 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, file IO resources, memory resources, and cross-process communication resources;
2032. and loading platform resources to realize the function corresponding to the first event.
Therefore, the platform API corresponding to the first time can acquire the corresponding platform resource to smoothly realize the corresponding function.
Therefore, because the platform API is not directly called, the platform API needs to pass through the flutter engine, and the flutter engine is preset with a calling rule and cannot be called randomly, so that the safety of the application program in the using process is ensured.
Optionally, in order to enable the client to implement the technical solution provided by the foregoing embodiment, with reference to fig. 2 and with reference to fig. 3, before the step 201, 200A and 200B may be further included:
200A, acquiring a software package corresponding to the application program.
By way of example, taking the android platform as an example, the software packages can 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 the function corresponding to the event, each event corresponds to various target platform application program interfaces, and each target platform application program interface corresponds to one running environment.
Specifically, taking the android platform as an example, after a software package is compiled and analyzed, two parts of contents exist, one part is a compiled product containing a preset engine, and the other part is a compiled product used for starting the preset engine to form an engine layer and capable of being loaded to form a platform application program interface layer and a cross-platform application program interface layer. In order to reduce the encroachment on the resources of the client, 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 the application and occupation of the related resources are performed when the platform application program interface layer needs to be used.
Therefore, when the application program runs in the client or other electronic equipment, a required cross-platform application program interface can be 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 implementable manner, referring to fig. 5, in order to form the software package, the following steps 301 and 302 need to be implemented before the implementation method of the functions in the application provided by the present disclosure is implemented, and the execution subject of the technical solution corresponding to the steps 301 and 302 can 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. Each platform API may specifically be, for example, one of the following APIs with operating system level functionality: picture decoding, video coding and decoding, user-defined network communication protocol and interprocess memory copying.
Specifically, the obtaining of at least one platform API may obtain a development requirement (may be a specific function list, and the functions required in the function list may be functions required in the development process, such as drawing a window, obtaining memory information, reading and writing data, and the like), and then obtain the platform API corresponding to the development requirement from at least one operating system. Taking development requirements as a function list as an example, 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 the present disclosure, for different operating systems, platform APIs corresponding to respective bottom-layer functions may be obtained according to technical documents of the operating systems, and 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 encapsulated according to different functions or categories. The platform API obtained in the present disclosure may form a platform application program interface layer in the function hierarchy of the runtime container as shown in fig. 6 after being encapsulated; in the present disclosure, this layer defines a unified API and specification, defining the specification that must be followed by the runtime container shown in FIG. 6 when it implements the capabilities corresponding to each API in the platform API layer when running on different platforms. In addition, it should be noted that, when this layer is formed, the platform API may be encapsulated according to its corresponding function, or may be any other feasible manner, and this application is not limited in particular.
302. Exposing the platform application program interface through a preset engine in a preset container.
For example, in the present disclosure, the preset container may be a flutter runtime container, and the preset engine may be a flutter engine. Referring to fig. 6, taking the preset container as a flute runtime container and the preset engine as a flute engine as an example, the present disclosure changes the implementation of original flute dependence into using a platform application program interface layer that can be formed in step 301 by rewriting the flute engine, and adds, modifies and deletes some APIs exposed to the framework layer for the flute engine, so that in the flute runtime container, some APIs in the platform API layer (in the present disclosure, the flute engine may be the flute engine layer) can be exposed (equivalent to step 302) in the flute framework API in the uppermost layer (referred to as cross-platform API layer in the present disclosure), so that a developer can write different APIs (i.e., application programs) according to its own requirements by using the flute framework API exposed at the uppermost layer, and realizing corresponding functions. Furthermore, because the Skia is used as the rendering engine in the flutter engine, and the Skia does not customize a set of components to map the UI components of different platforms, but the user completes the design of the UI components according to the requirements of the user, if the flutter engine and the flutter runtime container are adopted in the method, 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, the flutter technology can also provide a set of widget system similar to a web page to construct the UI, and the widget can be freely expanded, so that when the flutter engine and the flutter runtime container are adopted in the method, developers can construct the UI more freely during development, rich display effect of application is guaranteed, and user experience is improved. In the disclosure, exposing a special vocabulary belonging to a software project specifically means providing an interface that can be called by a developer, and if the API is not exposed, the developer cannot call a corresponding function during development.
It should be noted that, in practice, if the platform API is too much, the performance requirement of the preset engine may be too large, so that the code of the developed application program is too bulky and is inconvenient to debug and maintain, and therefore, to avoid this, the platform API in the present disclosure may only have APIs corresponding to functions that may affect the key performance of the operating system. In addition, when the preset engine exposes the platform API, the platform API which belongs to different operating systems can be exposed after being packaged according to corresponding functions according to the difference of different operating platforms, so that developers can call the uniform cross-platform API, namely, the developers actually call a plurality of platform APIs which belong to different operating systems when calling a certain cross-platform API, and the developed codes can be suitable for a plurality of different operating systems.
Based on the above scheme, because the platform API is exposed through the preset engine in the preset container, the safety of the platform API is ensured, and meanwhile, because the platform API in the technical scheme corresponds to a plurality of operating systems, developers can call different APIs for different operating systems according to their own requirements when developing certain application through the exposed platform API, so that the finally developed codes can be applicable to a plurality of different operating systems, the development efficiency is high, and the development does not need to rely on a native platform for development, so that a development scheme that one set of codes supports a plurality of different platforms without the safety of 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 has the function of directly performing data exchange and communication among processes, so that communication serialization is not required, the performance of the application program after development is completed is improved, and the user experience is improved.
Optionally, as shown in fig. 7 in conjunction with fig. 5, since some functions of the preset engine itself are also needed to be used by the developer 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 step 303:
303. and exposing a core application program interface corresponding to the preset engine in the preset container.
For example, taking the preset container as a flute runtime container and the preset engine as a flute engine as an example, referring to fig. 6, in the flute runtime container, the core API is located in a second layer (referred to as a platform development layer in this disclosure), and the layer can encapsulate the core API included in the layer into a part of a flute framework application program interface of the uppermost layer (a 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 a developer may need a variation of the functions corresponding to 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 square drawing function, and 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-:
3021. a modification instruction is received.
Wherein the modification instruction is used for indicating the modification of 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 can add new optional parameters to add new functions to the original platform API.
3022. And modifying the platform application program interface according to the modification instruction to obtain the target platform application program interface.
3023. And exposing the target platform application program interface in a preset container through a preset engine.
For example, taking the preset container as a flute runtime container and the preset engine as a flute 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, the flute engine modifies and encapsulates a part of the platform API therein according to the modification instruction to form a custom-framed application program interface (custom-framed application program API) of the second layer (platform development layer), and then encapsulates the custom-framed application program interface (custom-framed application program API) of the second layer (platform development layer) together with the unmodified platform API and the core API to form a part of the flute framework application program interface of the uppermost layer (cross-platform API layer). It should be noted that the target platform API in 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 instruction is modified to be null.
Therefore, developers can modify the platform API conveniently 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 native application program interface.
Therefore, the inherent platform API of the platform can develop more functions, the use by a user is facilitated, and the user experience is improved.
With reference to fig. 5 and fig. 9, because a developer may need to use a function that a platform API does not have at all when developing a certain application, and it is impossible to modify the platform API alone at this time, a developer needs to design a corresponding plug-in to complete the corresponding function at this time, so in the technical solutions corresponding to 301 and 302, X1-X3 may further be included:
x1, receiving a plug-in establishment instruction.
The plug-in establishing instruction carries plug-in establishing information; the plug-in set-up instructions are used to instruct the set-up of a plug-in.
And X2, establishing a plug-in according to the plug-in establishing instruction, and registering the established plug-in to acquire a plug-in application program interface corresponding to the plug-in.
For example, taking the default container as a flute runtime container and the default engine as a flute engine as an example, referring to fig. 6, the plug-in may be registered on the uppermost layer (i.e., cross-platform API layer), and when the plug-in is completely written using the dart code, it may be called a flute function block (flute module), and when the plug-in is not only implemented by the dart code but also needs to encapsulate functions of a certain type of native platform, it may be called a flute plug-in (flute plug-in). In the present disclosure, the plug-in may be a completely new function, or may be a full overlay (including an original function and a new function) on a platform API or a core API (corresponding to a flutter engine).
X3, exposing plug-in application interfaces in a preset container.
For example, taking the default container as a flutter runtime container and the default engine as a flutter engine as examples, referring to fig. 6, the plug-in API may be a plug-in-service API (plug-in-service API), and when the plug-in interface is used by a developer, the plug-in interface may provide plug-in functions corresponding to the flutter module and the flutter plug-in. The X3 step is mainly implemented by the uppermost cross-platform API layer.
Therefore, the development requirements of developers in different scenes can be met, and the developed application program also comprises a plug-in capable of realizing a unique function, so that the smooth development is guaranteed, and the use experience of the subsequent application program is improved.
Based on the corresponding technical solution of fig. 9, referring to fig. 10, the method for implementing functions in an application provided by the present disclosure may further include S1-S3:
and S1, monitoring and acquiring a second event of the application program.
And S2, determining the plug-in corresponding to the second event.
The plug-in unit may be a plug-in unit in the technical solution corresponding to fig. 9. Certainly, in order to implement the technical solution corresponding to fig. 10, the software package obtained in step 200A should include a code corresponding to the platform extension layer as shown in fig. 9, and then in step 200B, when the software package is compiled and analyzed, the platform extension layer may be constructed to ensure that a second event generated when a subsequent application program is used can be called by a corresponding plug-in. The plug-in unit realizes corresponding functions by using a self-owned function or realizes corresponding functions by using a platform API (application program interface), and the method is not specifically shown in the disclosure and is specifically determined according to actual requirements.
And S3, executing 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 function, some functions in the application program can be more diversified and personalized, so that the purpose of improving the user experience is achieved.
Referring to fig. 11 in conjunction with fig. 5, in the technical solutions 301 and 302, it may further include 304:
304. exposing an application program interface of the third-party software development kit in a preset container.
Wherein the third party SDK Software Development Kit (SDK) is used for at least one or more of: calling preset APIs in all platform APIs, and calling third party APIs in a third party starting database; the preset API is the API with the stability parameter larger than the preset value, and the stability parameter is used for representing the stability and the data safety degree of the application program corresponding to the API when the API is called.
For example, taking the preset container as a flute runtime container and the preset engine as a flute engine as an example, referring to fig. 6, the third-party SDK capable of implementing the function of calling the preset API in all platform APIs may be located in the second layer (platform development layer), specifically may be a "directly-tuned SDK", and the third-party SDK capable of implementing the function of calling the third-party API in the third-party development database may be a "platform specific implementation".
Thus, in addition to various APIs that can be provided in the present disclosure, in actual development, if a developer does not want to build a plug-in or modify a platform API, but wants to use an API with other functions, the developer can obtain the corresponding API from other open-source AIP libraries, so that the "platform-specific implementation" is needed, which can provide more development possibilities for the developer, and improve the use experience of the developer. In addition, for the preset API, even if the preset API does not pass through a flutter engine, the safety of the application obtained through final development and the operating system where the application is located can be guaranteed, so that the preset API is conveniently considered.
It should be noted that, taking the preset container as a flute runtime container and the preset engine as a flute engine as an example, referring to fig. 6, since the written code corresponding to the flute technology is a dart code, and 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 code conversion of the third party API obtained by the "platform specific implementation", the second layer (platform extension layer) further includes the "dart implementation".
In the technical scheme, the platform APIs of the plurality of operating systems are obtained firstly, 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 safety of the platform API is ensured, meanwhile, because the platform API in the technical scheme disclosed by the invention corresponds to a plurality of operating systems, developers can develop certain application through the exposed platform API, different APIs aiming at different operating systems can be called by the developed application codes according to the requirements of the developers, the finally developed codes can be suitable for various different operating systems, the development efficiency is high, and the development does not need to depend on a native platform for development, so that the development scheme that one set of codes supports various different platforms without the safety of the native platform can be realized.
Based on the foregoing technical solution, after a developer compiles an application using the solution, when a package of the application is compiled on any platform (operating system, e.g., ios system), according to characteristics of the platform, two parts are compiled and generated, a first part includes a flutter engine corresponding to the platform and a platform API corresponding to the platform, and a second part includes an aot (ahead of time) compilation snapshot running in a running environment (flutter runtime container and dart virtual machine (generated by the 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 (application programming interface) which can be called by a platform development layer is provided (the platform development layer is convenient to call); the platform API in the platform API layer applies for the bottom resource to the platform, in order to ensure that the bottom resource (memory resource, CPU resource and the like) is applied too much by the application, a part of platform API in the platform API layer is loaded lazily, namely, only the bottom resource is applied for a part of platform API during initialization, and the bottom resource is applied for the other part of platform API only when the bottom resource is needed to be used. After initialization of the flutter engine layer and the platform API layer is completed, initialization of the cross-platform API layer and the platform expansion layer is completed in a running environment formed by initialization of the flutter engine layer and the platform API layer through the AOT compiled product snapshot of the second part. And then the application is successfully started, when the application is used by a user, the flutter engine can control rendering of the page UI and monitor the operation of the user, for a task which needs to be executed by the application and needs to be changed, the flutter engine can trigger a corresponding callback event to be sent to a corresponding upper API (for example, a flutter frame API in the embodiment) in the cross-platform API layer, the cross-platform API layer can call resources (including network resources, GPU resources, CPU resources, file IO resources, memory resources, cross-process communication resources and the like) of the platform by using the capability of calling different layers according to the upper API which receives the event, and the functions of picture editing, video transcoding and the like corresponding to the operation of the user are completed. Generally, the application developed by the scheme of the application can produce a flutter runtime container in the foregoing embodiment in a platform, the container takes over tasks similar to native processes in native applications, and can encapsulate capabilities or resources of the platform layer by layer through different layers in the container, and finally expose a simple and easy-to-use upper API layer through a cross-platform API layer for use, so that the technical scheme provided by the application can ensure that the finally developed cross-platform application can smoothly realize a corresponding palace on different platforms.
Optionally, based on the above technical solution corresponding to fig. 11, in the implementation method of functions in an application program provided by the present disclosure, as shown in fig. 12, the implementation method may further include L1-L3:
l1, and listens for and acquires a third event of the application program.
L2, determining a third party software development kit application program interface corresponding to the third event.
And L3, realizing the function corresponding to the third event through the third-party software development kit application program interface.
Therefore, when the application program is used, platform APIs which do not affect the safety and the stability of the operating system or open source API databases outside the operating system can be realized through the SDK application program interface of the third party, the diversification and the freedom of the application program function are ensured, and the user experience is improved.
The above description mainly introduces the solution provided by the embodiments of the present disclosure from the perspective of a server. It is understood that the server may implement the above-described functions by implementing means of the functions in the application programs configured therein, respectively. In order to implement the above functions, the implementation means of the functions in the application program includes hardware structures and/or software modules for executing the respective functions, and the hardware structures and/or software modules for executing the respective functions may constitute a terminal. Those of skill in the art will readily appreciate that the present disclosure can be implemented in hardware or a combination of hardware and computer software for implementing the exemplary algorithm steps described in connection with the embodiments disclosed herein. Whether a function is performed as hardware or computer software drives 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 present disclosure may perform the division of the functional modules on the server according to the above method example, for example, the server may include an implementation device of the function in the application program, the implementation device of the function in the application program may divide each functional module corresponding to each function, or may integrate two or more functions into one processing module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. It should be noted that, the division of the modules in the embodiments of the present disclosure is illustrative, and is only one division of logic functions, and there may be another division in actual implementation.
In the case of dividing each functional module by corresponding functions, fig. 13 is a schematic diagram of a possible structure of an implementation apparatus 03 for functions in an application program applied in the client 01 shown in fig. 1, where the implementation apparatus 03 for functions in the application program includes: 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 interface is obtained by packaging at least one platform application program interface with a function corresponding to the first event, and each platform application program interface corresponds to one running environment; and 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 realize the function corresponding to the first event.
Optionally, the processing module 33 is specifically configured to: and calling a platform application program interface corresponding to the current operating environment through the cross-platform application program interface determined by the determination module 32 by using a preset engine so as to realize the function corresponding to the first event.
Optionally, the apparatus further includes an obtaining 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 the function corresponding to the event, each event corresponds to various target platform application program interfaces, and each target platform application program interface corresponds to one running environment.
Optionally, 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 native application program interface.
Optionally, the monitoring module 31 is further configured to monitor 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 monitoring module 31; the processing module 33 is further configured to execute 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: calling a platform application program interface corresponding to the current operating environment through a cross-platform application program interface to acquire platform resources required by a first event; the platform resources include any one or more of: network resources, GPU resources, CPU resources, file IO resources, memory resources, and cross-process communication resources; and loading platform resources to realize the function corresponding to the first event.
With regard to the implementation apparatus of the functions in the application programs in the foregoing embodiments, the specific manner in which each module performs the operation and the related advantages have been described in detail in the foregoing embodiments of the implementation method of the functions in the application programs, and will not be elaborated herein.
In the case of an integrated unit, fig. 14 is a schematic diagram of a possible structure of an electronic device shown according to an exemplary embodiment, where the electronic device may be an implementation apparatus of functions in the application program, or a client or a server including the apparatus. 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 the modules in the implementation apparatus 03 according to the functions in the application programs in the foregoing embodiments.
In particular implementations, among others, processor 41(41-1 and 41-2) may include one or more CPUs, such as CPU0 and CPU1 shown in FIG. 14, as one example. 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). Processor 41 may refer herein to one or more devices, circuits, and/or processing cores that process 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 may store static information and instructions, a Random Access Memory (RAM) or other type of dynamic storage device that may store information and instructions, an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compact disc, laser disc, optical disc, digital versatile disc, blu-ray disc, etc.), a disk-readable storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer. The memory 42 may be self-contained and coupled to the processor 41 via a bus 43. The memory 42 may also be integrated with the processor 41.
The bus 43 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an extended ISA (enhanced industry standard architecture) bus, or the like. The bus 43 may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 14, but this is not intended to represent only one bus or type of bus.
In addition, to facilitate information interaction between the electronic device and other devices (e.g., servers or clients), the electronic device includes a communication interface 44. The communication interface 44 is any device, such as a transceiver, for communicating with other devices or communication networks, such as a control system, a Radio Access Network (RAN), a Wireless Local Area Network (WLAN), and the like. The communication interface 44 may include a receiving unit implementing a receiving function and a transmitting unit implementing a transmitting function.
In some embodiments, referring to fig. 15, the electronic device may be a client, and in this case, the electronic device may further include: 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 lines. Various peripheral devices may be connected to peripheral interface 45 via bus 43, signal lines, or circuit boards. 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 supply 51.
The peripheral interface 45 may be used to connect at least one peripheral related to I/O (input/output) to the processor 41 and the 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, any one or both of the processor 41, the memory 42, and the peripheral interface 45 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) signals, also called electromagnetic signals. The radio frequency circuit 46 communicates with communication networks and other communication devices via electromagnetic signals. The rf circuit 46 converts an electrical signal into an electromagnetic signal for transmission, or converts a received electromagnetic signal into an electrical signal. Optionally, 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 so forth. The radio frequency circuit 46 may communicate with other terminals via at least one wireless communication protocol. The wireless communication protocols include, but are 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 circuit 46 may also include NFC (near field communication) related circuits, which are 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 capture touch signals on or over the surface of the display screen 47. The touch signal may be input to the processor 41 as a control signal for processing. At this point, the display screen 47 may also be used to provide virtual buttons and/or a virtual keyboard, also referred to as soft buttons and/or a soft keyboard. In some embodiments, the display screen 47 may be one, providing the front panel of the client; the display screen 47 may be made of LCD (liquid crystal display), OLED (organic light-emitting diode), and the like.
The location component 50 is used to locate the current geographic location of the client to enable navigation or LBS (location based service). The positioning component 50 may be a positioning component based on a GPS (global positioning system) in the united states, a beidou system in china, a graves system in russia, or a galileo system in the european union.
The power supply 51 is used to supply power to the various components in the client. The power source 51 may be alternating current, direct current, disposable or rechargeable. When the power source 51 comprises a rechargeable battery, the rechargeable battery may support wired charging 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 sensors, gyroscope sensors, pressure sensors, fingerprint sensors, optical sensors, and proximity sensors.
The acceleration sensor can detect the acceleration magnitude on three coordinate axes of a coordinate system established by the client. The gyroscope sensor can detect the body direction and the rotation angle of the client, and the gyroscope sensor and the acceleration sensor can cooperatively acquire the 3D action of the user on the client. The pressure sensors may be located on the side frame of the client and/or underneath the display screen 47. When the pressure sensor is arranged on the side frame of the terminal 01, a holding signal of the user to the client can be detected. The fingerprint sensor is used for collecting fingerprints of users. The optical sensor is used for collecting the intensity of ambient light. Proximity sensors, also known as distance sensors, are usually provided on the front panel of the client. The proximity sensor is used for collecting the distance between the user and the front of the client.
Those skilled in the art will appreciate that the configurations shown in fig. 14 or 15 do not constitute limitations of the electronic device, and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components may be used.
The embodiment of the present disclosure also provides a computer-readable storage medium, where instructions are stored on the computer-readable storage medium, and when the instructions on the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the implementation method of the function in the application program on the implementation apparatus applied to the function in the application program in the electronic device, provided in the foregoing embodiment.
The embodiment of the present disclosure further provides a computer program product containing instructions, which when run on an electronic device, causes the electronic device to execute the implementation method of the functions in the application program provided in the foregoing embodiment.
Through the description of the above embodiments, it is clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device may be divided into different functional modules to complete all or part of the above described functions.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, a module or a unit may be divided into only one logic function, and may be implemented in other ways, for example, a plurality of units or components may be combined or integrated into another apparatus, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may be one physical unit or a plurality of physical units, may be located in one place, or may be distributed to a plurality of different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
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. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially or partially contributed to by the prior art, or all or part of the technical solutions may be embodied in the form of a software product, where the software product is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, or the like) or a processor (processor) to execute all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a U disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.
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 variations, uses, or adaptations of the disclosure following, in general, the 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 will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made 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 functions in an application program is characterized by comprising 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 interface is obtained by packaging 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;
and calling a platform application program interface corresponding to the current operating environment through the cross-platform application program interface 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 the calling a platform application program interface corresponding to a current running environment through the cross-platform application program interface to implement the functions of the target event comprises:
and calling a platform application program interface corresponding to the current operating environment through the cross-platform application program interface by using a preset engine so as to realize the function corresponding to the first event.
3. The method for implementing functions in an application program according to claim 2, further comprising:
acquiring a software package corresponding to the 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 is used for realizing the function corresponding to the event, each event corresponds to various target platform application program interfaces, and each target platform application program interface corresponds to one running environment.
4. The method of claim 1, wherein 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 a native application program interface.
5. 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 operating the plug-in to realize the function corresponding to the second event.
6. The method for implementing functions in an application program according to claim 1, wherein the calling a platform application program interface corresponding to a current operating environment through the cross-platform application program interface to implement the functions corresponding to the first event includes:
calling a platform application program interface corresponding to the current operating 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: network resources, GPU resources, CPU resources, file IO resources, memory resources, and cross-process communication resources;
and loading the platform resource to realize the function corresponding to the first event.
7. An apparatus for implementing functions in an application program, comprising:
the monitoring module is configured to monitor and acquire a first event of the application program;
a determining module configured to determine a cross-platform application program interface corresponding to the first event acquired by the listening module; the cross-platform application program interface is obtained by packaging 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;
and the processing module is configured to call a platform application program interface corresponding to the current operating environment through the cross-platform application program interface determined by the determining module so as to realize the function corresponding to the first event.
8. 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 the method of implementing the functions in the application program according to any one of claims 1-6.
9. A computer-readable storage medium having instructions stored thereon, wherein the instructions in the computer-readable storage medium, when executed by a processor of an electronic device, cause the electronic device to perform a method of implementing functions in an application program according to any one of claims 1-6.
10. A computer program product comprising instructions which, when run on an electronic device, cause the electronic device to perform a method of implementing functions in an application according to any one of claims 1-6.
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 true CN113094123A (en) | 2021-07-09 |
CN113094123B 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) |
Cited By (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113485746A (en) * | 2021-07-28 | 2021-10-08 | 山石网科通信技术股份有限公司 | 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 |
CN113608801A (en) * | 2021-07-19 | 2021-11-05 | 上海浦东发展银行股份有限公司 | Interface calling method and device, computer equipment and storage medium |
CN113722019A (en) * | 2021-11-04 | 2021-11-30 | 海尔数字科技(青岛)有限公司 | Display method, device and equipment of platform program |
CN113766318A (en) * | 2021-09-09 | 2021-12-07 | 世纪龙信息网络有限责任公司 | Video generation method and device, storage medium and computer equipment |
CN114385265A (en) * | 2022-01-13 | 2022-04-22 | 土巴兔集团股份有限公司 | Network environment switching method based on cross-platform development technology and related equipment thereof |
WO2022199111A1 (en) * | 2021-03-23 | 2022-09-29 | 北京卓越乐享网络科技有限公司 | Method and apparatus for implementing functions in application program, electronic device and storage medium |
CN115866248A (en) * | 2022-11-08 | 2023-03-28 | 格兰菲智能科技有限公司 | Video transcoding method and device, computer equipment and storage medium |
CN117009029A (en) * | 2023-05-26 | 2023-11-07 | 阿里巴巴(中国)有限公司 | XR application and content running method, device and storage medium |
WO2023245526A1 (en) * | 2022-06-23 | 2023-12-28 | 广州视源电子科技股份有限公司 | Desktop element operation method, electronic device and intelligent interaction tablet |
CN117555645A (en) * | 2024-01-12 | 2024-02-13 | 腾讯科技(深圳)有限公司 | Data processing method, device, equipment and medium based on multi-terminal application platform |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117389647A (en) * | 2023-10-11 | 2024-01-12 | 北京百度网讯科技有限公司 | Plug-in generation method, application development method, device, equipment and medium |
CN118426876B (en) * | 2024-07-05 | 2024-09-17 | 广州六环信息科技有限公司 | Application program interface generating device, method, storage medium and system |
Citations (5)
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 |
CN102681893A (en) * | 2011-03-09 | 2012-09-19 | 腾讯科技(深圳)有限公司 | Cross-platform implementation method for executable programs and mobile terminal |
CN103761087A (en) * | 2014-01-03 | 2014-04-30 | 北京京东尚科信息技术有限公司 | Method and device for cross-platform development of mobile applications |
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 (1)
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 |
-
2021
- 2021-03-23 CN CN202110310126.9A patent/CN113094123B/en active Active
- 2021-12-02 WO PCT/CN2021/135062 patent/WO2022199111A1/en active Application Filing
Patent Citations (5)
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 |
CN102681893A (en) * | 2011-03-09 | 2012-09-19 | 腾讯科技(深圳)有限公司 | Cross-platform implementation method for executable programs and mobile terminal |
CN103761087A (en) * | 2014-01-03 | 2014-04-30 | 北京京东尚科信息技术有限公司 | Method and device for cross-platform development of mobile applications |
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 |
Cited By (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2022199111A1 (en) * | 2021-03-23 | 2022-09-29 | 北京卓越乐享网络科技有限公司 | Method and apparatus for implementing functions in application program, electronic device and storage medium |
CN113608801A (en) * | 2021-07-19 | 2021-11-05 | 上海浦东发展银行股份有限公司 | Interface calling method and device, computer equipment and storage medium |
CN113485746A (en) * | 2021-07-28 | 2021-10-08 | 山石网科通信技术股份有限公司 | Method and device for generating application program interface document |
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 and device, storage medium and computer equipment |
CN113722019A (en) * | 2021-11-04 | 2021-11-30 | 海尔数字科技(青岛)有限公司 | Display method, device and equipment of platform program |
CN114385265A (en) * | 2022-01-13 | 2022-04-22 | 土巴兔集团股份有限公司 | Network environment switching method based on cross-platform development technology and related equipment thereof |
WO2023245526A1 (en) * | 2022-06-23 | 2023-12-28 | 广州视源电子科技股份有限公司 | Desktop element operation method, electronic device and intelligent interaction tablet |
CN115866248A (en) * | 2022-11-08 | 2023-03-28 | 格兰菲智能科技有限公司 | Video transcoding method and device, computer equipment and storage medium |
CN115866248B (en) * | 2022-11-08 | 2024-01-19 | 格兰菲智能科技有限公司 | Video transcoding method, device, computer equipment and storage medium |
CN117009029A (en) * | 2023-05-26 | 2023-11-07 | 阿里巴巴(中国)有限公司 | XR application and content running method, device and storage medium |
CN117009029B (en) * | 2023-05-26 | 2024-09-24 | 浙江天猫技术有限公司 | XR application and content running method, device and storage medium |
CN117555645A (en) * | 2024-01-12 | 2024-02-13 | 腾讯科技(深圳)有限公司 | Data processing method, device, equipment and medium based on multi-terminal application platform |
CN117555645B (en) * | 2024-01-12 | 2024-04-05 | 腾讯科技(深圳)有限公司 | Data processing method, device, equipment and medium based on multi-terminal application platform |
Also Published As
Publication number | Publication date |
---|---|
WO2022199111A1 (en) | 2022-09-29 |
CN113094123B (en) | 2024-10-25 |
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 | |
CN112052008B (en) | Code checking method, device, computer equipment and computer readable storage medium | |
CN111416756B (en) | Protocol testing method, device, computer equipment and storage medium | |
CN109213613B (en) | Image information transmission method and device, storage medium and electronic equipment | |
US11934814B2 (en) | Application porting method and apparatus, device, and medium | |
CN113190362B (en) | Service calling method and device, computer equipment and storage medium | |
CN112420217B (en) | Message pushing method, device, equipment and storage medium | |
EP4095723B1 (en) | Permission reuse method, permission reuse-based resource access method, and related device | |
CN112162843A (en) | Workflow execution method, device, equipment and storage medium | |
CN111737100A (en) | Data acquisition method, device, equipment and storage medium | |
CN111125602B (en) | Page construction method, device, equipment and storage medium | |
CN113867848A (en) | Method, device and equipment for calling graphic interface and readable storage medium | |
CN110995842A (en) | Method, device and equipment for downloading service data and storage medium | |
US20220264176A1 (en) | Digital space management method, apparatus, and device | |
CN117827221A (en) | Method, apparatus, device and storage medium for deploying program code | |
CN114238074A (en) | Debugging method, device and equipment for sub-application and storage medium | |
CN110648272B (en) | Graphics resource conversion method and device, electronic equipment and storage medium | |
CN113268234A (en) | Page generation method, device, terminal and storage medium | |
CN115248939A (en) | Data verification method, device, equipment and storage medium | |
CN114385723A (en) | Data reading method and device, electronic equipment and storage medium | |
CN113392120A (en) | Method and device for acquiring execution information of SQLite | |
CN111290746A (en) | Object access method, device, equipment and storage medium | |
CN113220396B (en) | Embedded page management method and device, electronic equipment and storage medium | |
US20240036891A1 (en) | Sub-application running method and apparatus, electronic device, program product, 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 |