CN110187940A - A kind of interface package method, system and electronic equipment and storage medium - Google Patents
A kind of interface package method, system and electronic equipment and storage medium Download PDFInfo
- Publication number
- CN110187940A CN110187940A CN201910464562.4A CN201910464562A CN110187940A CN 110187940 A CN110187940 A CN 110187940A CN 201910464562 A CN201910464562 A CN 201910464562A CN 110187940 A CN110187940 A CN 110187940A
- Authority
- CN
- China
- Prior art keywords
- interface
- intermediary
- target
- package
- block
- 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.)
- Pending
Links
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
Abstract
This application discloses a kind of interface package method, system and a kind of electronic equipment and computer readable storage mediums, this method comprises: obtaining native interface;The native interface is packaged using AIDL, obtains intermediary interface block;When receiving the package request of target interface, the package request is responded using the intermediary interface block.Interface package method provided by the present application is packaged basic function using AIDL, obtains intermediary interface block.When receiving the package request of client, responded using intermediary interface block.The code of duplicate function does not need to repeat to write, and size of code can decline, and interface encapsulation efficiency is higher, and only need to safeguard a set of code, alleviate the maintenance pressure in later period.In addition, native interface is isolated with the interface of client, can be developed simultaneously.
Description
Technical field
This application involves software technology fields, more specifically to a kind of interface package method, system and a kind of electronics
Equipment and a kind of computer readable storage medium.
Background technique
For the distinct interface demand of different clients, in the related art, connect so that the interface of genuine quotient and android are primary
Based on mouthful, need to Reseal a set of logical code every time, interface encapsulation efficiency is lower, and will cause the wasting of resources and generation
Code redundancy, code is more and more, is unfavorable for follow-up maintenance.
Therefore, how to improve interface encapsulation efficiency is the technical issues of those skilled in the art show off solution.
Summary of the invention
The application be designed to provide a kind of interface package method, system and a kind of electronic equipment and a kind of computer can
Storage medium is read, interface encapsulation efficiency is improved.
To achieve the above object, this application provides a kind of interface package methods, comprising:
Obtain native interface;
The native interface is packaged using AIDL, obtains intermediary interface block;
When receiving the package request of target interface, the package request is responded using the intermediary interface block.
It is wherein, described to respond the package request using the intermediary interface block, comprising:
Judge in the intermediary interface block with the presence or absence of the first intermediary interface identical with the target interface;
If so, responding the package request using first intermediary interface.
It is wherein, described to respond the package request using the intermediary interface block, comprising:
The second target interface is chosen from the intermediary interface block according to the functional requirement of the target interface, encapsulation is all
Second target interface obtains the target interface.
Wherein, further includes:
When second target interface is not present in the intermediary interface block, the target is encapsulated according to the native interface
Interface, and the target interface is added in the intermediary interface block.
To achieve the above object, this application provides a kind of interface encapsulation systems, comprising:
Module is obtained, for obtaining native interface;
Package module obtains intermediary interface block for being packaged using AIDL to the native interface;
Respond module, for when receiving the package request of target interface, using described in intermediary interface block response
Package request.
Wherein, the respond module is specially to judge the intermediary interface when receiving the package request of target interface
It whether there is the first intermediary interface identical with the target interface in block;If so, being responded using first intermediary interface
The module of the package request.
Wherein, the respond module is specially when receiving the package request of target interface, according to the target interface
Functional requirement choose the second target interface from the intermediary interface block, encapsulate all second target interfaces obtain it is described
The module of target interface.
Wherein, further includes:
Update module, for primary being connect according to described when second target interface is not present in the intermediary interface block
Mouth encapsulates the target interface, and the target interface is added in the intermediary interface block.
To achieve the above object, this application provides a kind of electronic equipment, comprising:
Memory, for storing computer program;
Processor is realized when for executing the computer program such as the step of above-mentioned interface package method.
To achieve the above object, this application provides a kind of computer readable storage medium, the computer-readable storages
It is stored with computer program on medium, the step such as above-mentioned interface package method is realized when the computer program is executed by processor
Suddenly.
By above scheme it is found that a kind of interface package method provided by the present application, comprising: obtain native interface;It utilizes
AIDL is packaged the native interface, obtains intermediary interface block;When receiving the package request of target interface, institute is utilized
It states intermediary interface block and responds the package request.
Interface package method provided by the present application, using AIDL, (Chinese name: Android Interface Definition Language, English are complete
Claim: Android Interface Definition Language) basic function is packaged, obtain intermediary interface block.
When receiving the package request of client, responded using intermediary interface block.The code of duplicate function does not need to repeat to compile
It writes, size of code can decline, and interface encapsulation efficiency is higher, and only need to safeguard a set of code, alleviate the maintenance pressure in later period.Separately
Outside, native interface is isolated with the interface of client, can be developed simultaneously.Disclosed herein as well is a kind of interface encapsulation system and
A kind of electronic equipment and a kind of computer readable storage medium, are equally able to achieve above-mentioned technical effect.
It should be understood that the above general description and the following detailed description are merely exemplary, this can not be limited
Application.
Detailed description of the invention
In order to illustrate the technical solutions in the embodiments of the present application or in the prior art more clearly, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments of application for those of ordinary skill in the art without creative efforts, can be with
It obtains other drawings based on these drawings.Attached drawing is and to constitute specification for providing further understanding of the disclosure
A part, be used to explain the disclosure together with following specific embodiment, but do not constitute the limitation to the disclosure.Attached
In figure:
Fig. 1 is a kind of flow chart of interface package method shown according to an exemplary embodiment;
Fig. 2 is the refined flow chart of step S103 in Fig. 1;
Fig. 3 is a kind of structure chart of interface encapsulation system shown according to an exemplary embodiment;
Fig. 4 is the structure chart according to a kind of electronic equipment shown in an exemplary embodiment.
Specific embodiment
Below in conjunction with the attached drawing in the embodiment of the present application, technical solutions in the embodiments of the present application carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of embodiments of the present application, instead of all the embodiments.It is based on
Embodiment in the application, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall in the protection scope of this application.
The embodiment of the present application discloses a kind of interface package method, improves interface encapsulation efficiency.
Referring to Fig. 1, a kind of flow chart of interface package method shown according to an exemplary embodiment, as shown in Figure 1, packet
It includes:
S101: native interface is obtained;
The executing subject of the present embodiment can be the processor for using Android system.In this step, it obtains first former
Raw interface, native interface herein may include interface and android native interface of genuine quotient etc., herein without specifically limiting
It is fixed.
S102: the native interface is packaged using AIDL, obtains intermediary interface block;
In this step, it is packaged using basic function of the AIDL to customer demand, i.e., it will be primary in previous step
Interface is different intermediary interfaces according to different function packages, and all intermediary interfaces form intermediary interface block, for responding
Package request.
S103: when receiving the package request of target interface, the package request is responded using the intermediary interface block.
When client needs to develop software, it is package request that interface can be defined to standard packaging.When receiving package request,
Standard is defined with interface therein and Reseals intermediary interface in intermediary interface block, and packaging efficiency is higher.
As an implementation, this step may include: to judge to whether there is and the mesh in the intermediary interface block
Identical first intermediary interface of tag splice mouth;If so, responding the package request using first intermediary interface.Specific real
Shi Zhong, can inquire the first intermediary interface identical with target interface function directly in intermediary interface block can if inquiring
It directly returns, completes interface encapsulation.
As another embodiment, this step may include: according to the functional requirement of the target interface from described
The second target interface is chosen in indirect buccal mass, all second target interfaces is encapsulated and obtains the target interface.Specific real
Shi Zhong can be searched in can be encapsulated as the target interface second according to the functional requirement of target interface in intermediary interface block
Interface defines standard according to the interface in package request and Reseals to the second all target interfaces, should with response
Package request.
Interface package method provided by the embodiments of the present application, using AIDL (Chinese name: Android Interface Definition Language,
Full name in English: Android Interface Definition Language) basic function is packaged, obtain centre
Interface block.When receiving the package request of client, responded using intermediary interface block.The code of duplicate function does not need
Repetition is write, and size of code can decline, and interface encapsulation efficiency is higher, and only need to safeguard a set of code, alleviate the maintenance in later period
Pressure.In addition, native interface is isolated with the interface of client, can be developed simultaneously.
The packaging method of the target interface of customer demand is discussed in detail in the present embodiment, specifically, as shown in Fig. 2, above-mentioned reality
The step S103 applied in example may include:
S31: when receiving the package request of target interface, judge to whether there is and the mesh in the intermediary interface block
Identical first intermediary interface of tag splice mouth;If so, into S32;If it is not, then entering S33;
S32: the package request is responded using first intermediary interface;
In the present embodiment, it when receiving the package request of target interface, inquires in intermediary interface block and is connect with target
Identical first intermediary interface of mouth function can be returned directly if inquiring, and complete interface encapsulation.
S33: judge in the intermediary interface block with the presence or absence of the second target interface that can encapsulate the target interface;If
It is then to enter S34;If it is not, then entering S35;
S34: choosing the second target interface from the intermediary interface block according to the functional requirement of the target interface, encapsulation
All second target interfaces obtain the target interface.
If first object interface identical with target interface function is not present in intermediary interface block, in intermediary interface block
The second intermediary interface that lookup can be encapsulated as the target interface defines standard according to the interface in package request if inquiring
The second all target interfaces is Resealed, to respond the package request.
S35: the target interface is encapsulated according to the native interface, and the intermediary interface is added in the target interface
In block.
If there is no the second intermediary interfaces that can be encapsulated as the target interface in intermediary interface block, step is directly utilized
Obtained in S101 it is primary can be packaged, and be updated in intermediary interface block, so that next time receives identical function
It can directly be returned when the package request of demand, further improve interface encapsulation efficiency.
A kind of interface encapsulation system provided by the embodiments of the present application is introduced below, a kind of interface envelope described below
Dress system can be cross-referenced with a kind of above-described interface package method.
Referring to Fig. 3, a kind of structure chart of interface encapsulation system shown according to an exemplary embodiment, as shown in figure 3, packet
It includes:
Module 301 is obtained, for obtaining native interface;
Package module 302 obtains intermediary interface block for being packaged using AIDL to the native interface;
Respond module 303, for responding institute using the intermediary interface block when receiving the package request of target interface
State package request.
Interface encapsulation system provided by the embodiments of the present application, using AIDL (Chinese name: Android Interface Definition Language,
Full name in English: Android Interface Definition Language) basic function is packaged, obtain centre
Interface block.When receiving the package request of client, responded using intermediary interface block.The code of duplicate function does not need
Repetition is write, and size of code can decline, and interface encapsulation efficiency is higher, and only need to safeguard a set of code, alleviate the maintenance in later period
Pressure.In addition, native interface is isolated with the interface of client, can be developed simultaneously.
On the basis of the above embodiments, the respond module 303 is specially when reception as a preferred implementation manner,
To target interface package request when, judge in the intermediary interface block with the presence or absence of in identical with the target interface first
Interface;If so, responding the module of the package request using first intermediary interface.
On the basis of the above embodiments, the respond module 303 is specially when reception as a preferred implementation manner,
To target interface package request when, the second mesh is chosen from the intermediary interface block according to the functional requirement of the target interface
Tag splice mouth encapsulates all second target interfaces and obtains the module of the target interface.
On the basis of the above embodiments, as a preferred implementation manner, further includes:
Update module, for primary being connect according to described when second target interface is not present in the intermediary interface block
Mouth encapsulates the target interface, and the target interface is added in the intermediary interface block.
About the system in above-described embodiment, wherein modules execute the concrete mode of operation in related this method
Embodiment in be described in detail, no detailed explanation will be given here.
Present invention also provides a kind of electronic equipment, referring to fig. 4, a kind of electronic equipment 400 provided by the embodiments of the present application
Structure chart if Fig. 4 shows may include processor 11 and memory 12.The electronic equipment 400 can also include multimedia component
13, one or more of input/output (I/O) interface 14 and communication component 15.
Wherein, processor 11 is used to control the integrated operation of the electronic equipment 400, to complete above-mentioned interface package method
In all or part of the steps.Memory 12 is used to store various types of data to support the operation in the electronic equipment 400,
These data for example may include the instruction of any application or method for operating on the electronic equipment 400, and
The relevant data of application program, such as contact data, the message of transmitting-receiving, picture, audio, video etc..The memory 12 can
By any kind of volatibility or non-volatile memory device or their combination realization, such as static random access memory
Device (Static Random Access Memory, abbreviation SRAM), electrically erasable programmable read-only memory
(Electrically Erasable Programmable Read-Only Memory, abbreviation EEPROM), erasable programmable
Read-only memory (Erasable Programmable Read-Only Memory, abbreviation EPROM), programmable read only memory
(Programmable Read-Only Memory, abbreviation PROM), and read-only memory (Read-Only Memory, referred to as
ROM), magnetic memory, flash memory, disk or CD.Multimedia component 13 may include screen and audio component.Wherein shield
Curtain for example can be touch screen, and audio component is used for output and/or input audio signal.For example, audio component may include one
A microphone, microphone is for receiving external audio signal.The received audio signal can be further stored in memory
It 12 or is sent by communication component 15.Audio component further includes at least one loudspeaker, is used for output audio signal.I/O interface
14 provide interface between processor 11 and other interface modules, other above-mentioned interface modules can be keyboard, mouse, button
Deng.These buttons can be virtual push button or entity button.Communication component 15 for the electronic equipment 400 and other equipment it
Between carry out wired or wireless communication.Wireless communication, such as Wi-Fi, bluetooth, near-field communication (Near Field
Communication, abbreviation NFC), 2G, 3G or 4G or they one or more of combination, therefore corresponding communication
Component 15 may include: Wi-Fi module, bluetooth module, NFC module.
In one exemplary embodiment, electronic equipment 400 can be by one or more application specific integrated circuit
(Application Specific Integrated Circuit, abbreviation ASIC), digital signal processor (Digital
Signal Processor, abbreviation DSP), digital signal processing appts (Digital Signal Processing Device,
Abbreviation DSPD), programmable logic device (Programmable Logic Device, abbreviation PLD), field programmable gate array
(Field Programmable Gate Array, abbreviation FPGA), controller, microcontroller, microprocessor or other electronics member
Part is realized, for executing above-mentioned interface package method.
In a further exemplary embodiment, a kind of computer readable storage medium including program instruction is additionally provided, it should
The step of above-mentioned interface package method is realized when program instruction is executed by processor.For example, the computer readable storage medium can
Think the above-mentioned memory 12 including program instruction, above procedure instruction can be executed by the processor 11 of electronic equipment 400 with complete
At above-mentioned interface package method.
Each embodiment is described in a progressive manner in specification, the highlights of each of the examples are with other realities
The difference of example is applied, the same or similar parts in each embodiment may refer to each other.For system disclosed in embodiment
Speech, since it is corresponded to the methods disclosed in the examples, so being described relatively simple, related place is referring to method part illustration
?.It should be pointed out that for those skilled in the art, under the premise of not departing from the application principle, also
Can to the application, some improvement and modification can also be carried out, these improvement and modification also fall into the protection scope of the claim of this application
It is interior.
It should also be noted that, in the present specification, relational terms such as first and second and the like be used merely to by
One entity or operation are distinguished with another entity or operation, without necessarily requiring or implying these entities or operation
Between there are any actual relationship or orders.Moreover, the terms "include", "comprise" or its any other variant meaning
Covering non-exclusive inclusion, so that the process, method, article or equipment for including a series of elements not only includes that
A little elements, but also including other elements that are not explicitly listed, or further include for this process, method, article or
The intrinsic element of equipment.In the absence of more restrictions, the element limited by sentence "including a ...", is not arranged
Except there is also other identical elements in the process, method, article or apparatus that includes the element.
Claims (10)
1. a kind of interface package method characterized by comprising
Obtain native interface;
The native interface is packaged using AIDL, obtains intermediary interface block;
When receiving the package request of target interface, the package request is responded using the intermediary interface block.
2. interface package method according to claim 1, which is characterized in that described using described in intermediary interface block response
Package request, comprising:
Judge in the intermediary interface block with the presence or absence of the first intermediary interface identical with the target interface;
If so, responding the package request using first intermediary interface.
3. interface package method according to claim 1, which is characterized in that described using described in intermediary interface block response
Package request, comprising:
The second target interface is chosen from the intermediary interface block according to the functional requirement of the target interface, is encapsulated all described
Second target interface obtains the target interface.
4. interface package method according to claim 3, which is characterized in that further include:
When second target interface is not present in the intermediary interface block, the target is encapsulated according to the native interface and is connect
Mouthful, and the target interface is added in the intermediary interface block.
5. a kind of interface encapsulation system characterized by comprising
Module is obtained, for obtaining native interface;
Package module obtains intermediary interface block for being packaged using AIDL to the native interface;
Respond module, for responding the encapsulation using the intermediary interface block when receiving the package request of target interface
Request.
6. interface encapsulation system according to claim 5, which is characterized in that the respond module is specially to work as to receive target
When the package request of interface, judge to whether there is in the intermediary interface block in identical with the target interface first indirectly
Mouthful;If so, responding the module of the package request using first intermediary interface.
7. interface encapsulation system according to claim 5, which is characterized in that the respond module is specially to work as to receive target
When the package request of interface, the second target is chosen from the intermediary interface block according to the functional requirement of the target interface and is connect
Mouthful, it encapsulates all second target interfaces and obtains the module of the target interface.
8. interface encapsulation system according to claim 7, which is characterized in that further include:
Update module, for being sealed according to the native interface when second target interface is not present in the intermediary interface block
The target interface is filled, and the target interface is added in the intermediary interface block.
9. a kind of electronic equipment characterized by comprising
Memory, for storing computer program;
Processor, realizing the interface package method as described in any one of Claims 1-4 when for executing the computer program
Step.
10. a kind of computer readable storage medium, which is characterized in that be stored with computer on the computer readable storage medium
Program realizes the step of the interface package method as described in any one of Claims 1-4 when the computer program is executed by processor
Suddenly.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910464562.4A CN110187940A (en) | 2019-05-30 | 2019-05-30 | A kind of interface package method, system and electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910464562.4A CN110187940A (en) | 2019-05-30 | 2019-05-30 | A kind of interface package method, system and electronic equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110187940A true CN110187940A (en) | 2019-08-30 |
Family
ID=67719134
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910464562.4A Pending CN110187940A (en) | 2019-05-30 | 2019-05-30 | A kind of interface package method, system and electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110187940A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111061459A (en) * | 2019-12-11 | 2020-04-24 | 智器云南京信息科技有限公司 | Packaging method and system of graph computation library, storage medium and electronic equipment |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104852939A (en) * | 2014-02-18 | 2015-08-19 | 中国电信股份有限公司 | Capability interface deploying method and system |
CN105389222A (en) * | 2015-12-15 | 2016-03-09 | 中国科学院声学研究所 | Method, apparatus and system for dynamically calling native interface |
CN109147230A (en) * | 2018-08-07 | 2019-01-04 | 中国建设银行股份有限公司 | A kind of operating method and device of the financial self-service equipment based on WOSA |
-
2019
- 2019-05-30 CN CN201910464562.4A patent/CN110187940A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104852939A (en) * | 2014-02-18 | 2015-08-19 | 中国电信股份有限公司 | Capability interface deploying method and system |
CN105389222A (en) * | 2015-12-15 | 2016-03-09 | 中国科学院声学研究所 | Method, apparatus and system for dynamically calling native interface |
CN109147230A (en) * | 2018-08-07 | 2019-01-04 | 中国建设银行股份有限公司 | A kind of operating method and device of the financial self-service equipment based on WOSA |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111061459A (en) * | 2019-12-11 | 2020-04-24 | 智器云南京信息科技有限公司 | Packaging method and system of graph computation library, storage medium and electronic equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109587281B (en) | Container configuration method and computing node | |
US11366925B2 (en) | Methods and apparatuses for chaining service data | |
US20160342974A1 (en) | Wireless mobile payment device | |
CN107092475B (en) | Calling method and device of interactive control | |
CN107958021B (en) | Business process data processing method and device, storage medium and equipment | |
US9921817B2 (en) | Application name modification method and device, and storage medium | |
CN111158690B (en) | Desktop application framework, construction method, desktop application running method and storage medium | |
WO2019061798A1 (en) | Display control method and system, and virtual reality device | |
CN105306677A (en) | Method, apparatus and system for controlling intelligent device | |
US20150121363A1 (en) | Synchronized Distributed Networks with Frictionless Application Installation | |
CN103150198A (en) | Display method of configuration software | |
CN110096413A (en) | A kind of disk localization method, system and electronic equipment and storage medium | |
CN112416571A (en) | Resource management method, operating system and management device for industrial Internet of things nodes | |
CN109471693A (en) | Proprietary component is mapped to method, medium and the equipment of Cross-border congestion management system | |
CN110187940A (en) | A kind of interface package method, system and electronic equipment and storage medium | |
JP2021068415A (en) | Code execution method, device, rendering device, storage medium, and program | |
CN109857489A (en) | Development system, decoupling method and device based on android system | |
CN109343970B (en) | Application program-based operation method and device, electronic equipment and computer medium | |
US20240086236A1 (en) | Computing node management method and system | |
CN116436936B (en) | Data storage system, method, storage medium and electronic equipment | |
CN101819524B (en) | Access method of RFID (Radio Frequency Identification Device) reader and interface driving device thereof | |
CN103077016B (en) | A kind of moving object creation method, device and browser | |
KR100677141B1 (en) | Apparatus and Method for performing an one to one name-based socket-communication | |
CN105808313A (en) | Intelligent terminal data interaction system and method for intelligent terminal | |
CN110209294B (en) | Mouse control method and system and KVM system |
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 |