CN112328330A - iOS component calling method, device, middleware, electronic equipment and medium - Google Patents

iOS component calling method, device, middleware, electronic equipment and medium Download PDF

Info

Publication number
CN112328330A
CN112328330A CN202011341208.1A CN202011341208A CN112328330A CN 112328330 A CN112328330 A CN 112328330A CN 202011341208 A CN202011341208 A CN 202011341208A CN 112328330 A CN112328330 A CN 112328330A
Authority
CN
China
Prior art keywords
component
calling
module
parameter information
components
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
Application number
CN202011341208.1A
Other languages
Chinese (zh)
Inventor
桑锐
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing 58 Information Technology Co Ltd
Original Assignee
Beijing 58 Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing 58 Information Technology Co Ltd filed Critical Beijing 58 Information Technology Co Ltd
Priority to CN202011341208.1A priority Critical patent/CN112328330A/en
Publication of CN112328330A publication Critical patent/CN112328330A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • G06F9/44526Plug-ins; Add-ons
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Stored Programmes (AREA)

Abstract

The invention provides a component calling method, a device, middleware and an electronic equipment storage medium of an iOS terminal, wherein the method comprises the following steps: when a calling request that a first component calls a second component is obtained, calling the corresponding second component through a calling function according to parameter information of the second component, wherein the calling function is a function of a message calling class, and directly calling the corresponding component according to the parameter information in the calling request; and displaying the result obtained by calling the second component to the user through the first component. In other words, in the embodiment of the present invention, the middleware directly calls the corresponding component to perform information transfer, so that the independence of each component is increased, the correlation between the components is reduced, the coupling between the components and the middleware are eliminated, the learning cost is reduced, and the controllability of safety is ensured.

Description

iOS component calling method, device, middleware, electronic equipment and medium
Technical Field
The invention relates to the technical field of computers, in particular to a calling method, a calling device, middleware, electronic equipment and a storage medium of an iOS component.
Background
With the advance of the development of the mobile device operating System (IOS) project, new services are continuously introduced, which results in that the code amount in the Application program (APP) of the mobile terminal is larger and larger, all codes are concentrated in one project, the change of local codes often needs to modify the codes of the project associated with the local codes, so that the time for modifying the codes is longer and longer, and the coupling of the codes between the modules is more and more serious.
In the related art, the run-time registration based on the Uniform Resource Locator (URL) results in a slow start-up speed, a single parameter transmission, only a character string transmission, a high development cost and uncontrollable security. The Iop middleware and the components of the China Mobile centralized operation platform are seriously coupled, the middleware needs to be modified when the components are modified, the development cost is high, and the safety is also uncontrollable. Based on Target-Action operation, hard code coupling is more serious, middleware needs to be modified for modifying components, development cost is high, and safety is less controllable.
Therefore, how to reduce the code coupling and development cost between mobile end components and improve the development efficiency is a technical problem to be solved at present.
Disclosure of Invention
The invention provides a method, a device, a middleware, electronic equipment and a storage medium for calling a service of an iOS component, which are used for at least solving the technical problems of high development success and low development efficiency caused by serious code coupling of a mobile terminal component in the related technology. The technical scheme of the invention is as follows:
according to a first aspect of embodiments of the present invention, there is provided a component calling method for an iOS terminal, including:
acquiring a call request for calling a second component by a first component, wherein the call request comprises: parameter information of the second component;
calling the corresponding second component through a calling function according to the parameter information of the second component, wherein the calling function is a function of a message calling class, and directly calling the corresponding component according to the parameter information in the calling request;
and displaying the result obtained by calling the second component to the user through the first component.
Optionally, the calling the corresponding second component by using the function according to the parameter information of the second component includes:
reading a header file of a corresponding file lib package according to the parameter information of the second component;
acquiring the meaning of the corresponding component of the header file and a calling method of an Application Program Interface (API);
and calling a corresponding second component by calling a function according to the meaning of the component and the calling method of the API, and deleting the hard code and the classified text of the middleware in the component calling.
Optionally, before obtaining a call request for the first component to call the second component, the method further includes:
the method comprises the steps that an iOS runtime dynamically creates classes of all components of an iOS terminal and call modes of all the components through the operation of a mobile device operating system, wherein the components at least comprise a first component and a second component;
encapsulating the source code of each component in all the components into a corresponding file lib package;
and displaying the header file of each lib package so as to obtain the meaning of the corresponding component and the calling method of the application program interface API according to the header file.
Optionally, the method further includes:
receiving an external calling application program APP;
and mapping the uniform resource location identifier URL of the calling APP to a corresponding class for calling.
According to a second aspect of embodiments of the present invention, there is provided a component calling apparatus of an iOS terminal, including:
a first obtaining module, configured to obtain a call request for a first component to call a second component, where the call request includes: parameter information of the second component;
the calling module is used for calling the corresponding second component through a calling function according to the parameter information of the second component, wherein the calling function is a function of a message calling class, and the corresponding component is directly called according to the parameter information in the calling request;
and the first display module is used for displaying the result obtained by calling the second component to the user through the first component.
Optionally, the invoking module includes:
the reading module is used for reading a header file of a corresponding file lib package according to the parameter information of the second component;
the second acquisition module is used for acquiring the meaning of the component corresponding to the header file and a calling method of an Application Program Interface (API);
and the calling submodule is used for calling the corresponding second component through a calling function according to the meaning of the component and the calling method of the API, and deleting the hard code and the classified text of the middleware in calling.
Optionally, the apparatus further comprises:
the creating module is used for dynamically creating classes of all components of the iOS terminal and calling modes of all the components through iOS runtime when an operating system of the mobile equipment runs before the first obtaining module obtains the calling request of the first component for calling the second component, wherein the components at least comprise the first component and the second component;
the packaging module is used for packaging the source code of each component in all the components into a corresponding file lib package;
and the second display module is used for displaying the header file of each lib package so as to obtain the meaning of the corresponding component and the calling method of the application program interface API according to the header file.
Optionally, the apparatus further comprises:
the receiving module is used for receiving an external calling application program (App);
and the mapping module is used for mapping the uniform resource location identifier URL of the calling App into a corresponding class for calling.
According to a third aspect of the embodiments of the present invention, there is provided middleware for component invocation based on an i OS terminal, including:
the iOS runtime module is used for dynamically creating classes of all components of the iOS terminal and dynamically creating calling modes of all the components when the operating system of the mobile equipment runs;
a calling function module, configured to obtain a call request for a first component to call a second component, where the call request includes: calling the corresponding second component through a calling function according to the parameter information of the second component, wherein the calling function is a function of a message calling class, and directly calling the corresponding component according to the parameter information in the calling request; and displaying the result obtained by calling the second component to the user through the first component.
Optionally, the calling function module is further configured to delete the hard code and the classified text of the middleware in the second component called according to the parameter information of the second component.
According to a fourth aspect of the embodiments of the present invention, there is also provided an electronic device, including:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the component invocation method of the iOS terminal of claim.
According to a fifth aspect of embodiments of the present invention, there is provided a storage medium having instructions that, when executed by a processor of an electronic device, enable the electronic device to perform the component calling method of the iOS terminal as described above.
According to a sixth aspect of embodiments of the present invention, there is provided a computer program product according to instructions in the computer program product, which when executed by a processor of an electronic device, cause the electronic device to perform the above-mentioned component calling method of the iOS terminal.
The technical scheme provided by the embodiment of the invention at least has the following beneficial effects:
in the embodiment of the invention, when a calling request that a first component calls a second component is obtained, the corresponding second component is called through a calling function according to parameter information of the second component in the calling request, wherein the calling function is a function of a message calling class, and the corresponding component is directly called according to the parameter information in the calling request; and displaying the result obtained by calling the second component to the user through the first component. In other words, in the embodiment of the present invention, the middleware directly calls the corresponding component to perform information transfer, so that the independence of each component is increased, the correlation between the components is reduced, the coupling between the components and the middleware are eliminated, the learning cost is reduced, and the controllability of safety is ensured.
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 invention, as claimed.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention and are not to be construed as limiting the invention.
Fig. 1 is a flowchart illustrating a component calling method of an iOS terminal according to an exemplary embodiment.
Fig. 2 is a diagram illustrating an application example of a component calling method of an iOS terminal according to an exemplary embodiment.
Fig. 3 is a block diagram illustrating a component calling apparatus of an iOS terminal according to an exemplary embodiment.
FIG. 4 is a block diagram illustrating a calling module in accordance with an exemplary embodiment.
Fig. 5 is another block diagram illustrating a component calling apparatus of an iOS terminal according to an exemplary embodiment.
Fig. 6 is still another block diagram illustrating a component calling apparatus of an iOS terminal according to an exemplary embodiment.
Fig. 7 is a block diagram illustrating middleware for component invocation based on an iOS terminal according to an exemplary embodiment.
Fig. 8 is a block diagram illustrating a structure of an electronic device according to an example embodiment.
Fig. 9 is a block diagram illustrating an apparatus for component invocation of an iOS terminal according to an example embodiment.
Detailed Description
In order to make those skilled in the art better understand the technical solution of the present invention, the technical solution in the embodiments of the present invention 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 invention and in the drawings described above 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 invention described herein are capable of operation in sequences other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the invention, as detailed in the appended claims.
Fig. 1 is a flowchart illustrating a component calling method of an iOS terminal according to an exemplary embodiment, which is used in the terminal as shown in fig. 1, and includes the steps of:
in step 101, a call request for a first component to call a second component is obtained, where the call request includes: parameter information of the second component;
in step 102, calling a corresponding second component by a calling function according to the parameter information of the second component, wherein the calling function is a function of a message calling class, and directly calling the corresponding component according to the parameter information in the calling request;
in step 103, the data obtained by invoking the second component is displayed to the user through the first component.
The component calling method of the iOS terminal can be applied to terminals, servers and the like, and is not limited herein, and the terminal implementation equipment can be electronic equipment such as a smart phone, a notebook computer, a tablet computer and the like.
The following describes in detail specific implementation steps of a component calling method of an iOS terminal according to an embodiment of the present invention with reference to fig. 1.
Firstly, step 101 is executed to obtain a call request for a first component to call a second component, where the call request includes: parameter information of the second component.
In this step, the user clicks a browser or safari, or H5, or APP, etc., and the background may detect a click instruction of the user, for example, the user opens a car dealer APP, views an image of a car in the inventory, and initiates a call request, for example, the call request may include parameters such as a name and a model of the car. At the moment, the middleware acquires a call request of the user for calling the second component through the first component, namely the middleware acquires a call request of the user for clicking the car merchant APP to view the car photos in the inventory.
Wherein the invoking request may include: the parameter information of the second component may include one parameter or a plurality of parameters, and this embodiment is not limited. Of course, the parameter information of the caller (i.e. user), the calling function, etc. may also be included, and the details may be determined according to the actual needs.
Secondly, step 102 is executed, the corresponding second component is called through a calling function according to the parameter information of the second component, wherein the calling function is a function of a message calling class, and the corresponding component is directly called according to the parameter information in the calling request.
Reading a header file of a corresponding file lib package according to the parameter information of the second component; then acquiring the meaning of the corresponding component of the header file and a calling method of an Application Program Interface (API); finally, calling a corresponding second component by calling a function NSInvitation according to the meaning of the component and the calling method of the API, and deleting the hard code and the classified text of the middleware in the component calling. The intermediate member is thin and light, and has a specific function and high portability.
NSinvocation is a way to call a function, which encapsulates a caller, a function name, and parameters into an object, and then executes the called function through an invoke function, whose idea is commander mode, encapsulating the request into an object. That is, NSInvitation is an implementation of a command schema that contains selectors, method signatures, corresponding parameters, and target objects, among others; the method is used for realizing mutual calling among the components, and deleting hard code and classification files of the middleware in the calling, such as category or classification (category) files of the middleware. The method signature is a return value type and a parameter type corresponding to the method. When NSinvocation is called, it will find the corresponding method through the target object at runtime, thus ensuring uniqueness, which can be interpreted with [ receiver message ]. It is not uncommon to create NSInvitation directly during the actual development process, and these things are usually given to the system to do. For example, arm64 method replacement in bang's JSPatch is implemented using NSInvocation in the last step of runtime message forwarding.
That is, the calling function in this embodiment, such as NSInvocation, is a function of a message calling class, which includes all the components of OC message: target, selector, parameter, and return value. The NSInvitation may convert a message into an object, each parameter of the message can be set directly, and the return value may be self-setting when a NSInvitation object is scheduled. A NSInvitation object can repeatedly schedule different targets (targets) and its selector can also be set to another method signature. NSInvitation conforms to the NScoding protocol, but only supports NSPortCoder coding, and does not support archive type operations. It should be noted that, in object-oriented, a method is also called a message. The NSInvitation method comprises the following steps: creating a signature object (NSMethodSignature object) according to the method (or parameter information in the message), creating a calling object (NSInvitation object) according to the signature object, setting relevant information of the calling object (NSInvitation object), and then adopting the calling method to acquire a method return value.
When a parameter of a calling component changes, for example, a first component initiates a calling request for calling a second component for the first time, and the calling request may include only a name of a vehicle, such as audi; if the search result is not ideal, the parameter may be added, the call request may be initiated again, and the parameter of the calling component may be added to the call request, for example, the name and model of the calling component, such as audi, Q5, and the like, may be included. In this case, when the middleware detects the call request again, the middleware calls the corresponding component directly in accordance with the plurality of participants in the call request. In the prior art, when a parameter in a call request initiated by a first component changes, a middleware modifies a corresponding parameter and class through category according to the parameter in the call request, and then can initiate a call to the component corresponding to the parameter. Therefore, compared with the prior art, particularly when the parameters of the calling component are changed, the middleware does not need to modify the local corresponding parameters, and the corresponding component can be called directly according to the parameters of the calling component in the calling request.
And finally, executing step 103, and displaying the data obtained by calling the second component to the user through the first component.
And the middleware displays the data obtained by calling the second component to the user through the first component.
In the component calling method of the iOS terminal shown in the present exemplary embodiment, when a calling request for calling a second component by a first component is acquired, the corresponding second component is called by a calling function according to parameter information of the second component in the calling request; and displaying the result obtained by calling the second component to the user through the first component. In other words, in the embodiment of the present invention, the middleware directly calls the corresponding component to perform information transfer, so that the independence of each component is increased, the correlation between the components is reduced, the coupling between the components and the middleware are eliminated, the learning cost is reduced, and the controllability of safety is ensured.
Optionally, in another embodiment, on the basis of the foregoing embodiment, before obtaining the call request that the first component calls the second component, the method may further include:
1) the method comprises the steps that an iOS runtime dynamically creates classes of all components of an iOS terminal and call modes of all the components through the operation of a mobile device operating system, wherein the components at least comprise a first component and a second component;
in this step, Runtime is also called Runtime, and is a set of API written in C language at the bottom layer, Runtime is one of the cores inside iOS, and OC code written at ordinary times and the bottom layer is realized based on it.
That is, RunTime is RunTime and OC is RunTime mechanism, the most important of which is message mechanism. For C language, the invocation of a function will decide which function to invoke at compile time. For the OC function, which belongs to the dynamic calling process, it cannot be determined which function is really called during compiling, and only when the OC function is really running, the OC function can be called by finding the corresponding function according to the name of the function. The Runtime of the present embodiment is basically written in C and sink, an effort made for the efficiency of dynamic systems.
The method comprises the steps of dynamically creating classes of all components of the iOS terminal and call modes of all the components by using the iOS runtime, creating a Person class and the like. The specific creation method is well known to those skilled in the art and will not be described herein.
2) Encapsulating the source code of each component in all the components into a corresponding file lib package;
in this step, the source code of each component is encapsulated (i.e., packed) into a lib packet, so as to save memory space, because the source code occupies more memory than the lib packet.
3) And displaying the header file of each lib package so as to obtain the meaning of the corresponding component and the calling method of the application program interface API according to the header file.
In this step, the purpose of displaying the header file of the lib package is to facilitate reading the header file exposed by the lib package according to the parameters in the call request when the component call request is detected, so as to obtain the meaning of the component corresponding to the header file and the call method of the API.
Optionally, in another embodiment, on the basis of the above embodiment, the method may further include: receiving an external calling application program APP; and mapping the uniform resource location identifier URL of the calling APP to a corresponding class (class) for calling.
In this embodiment, when the middleware receives an external call APP, the uniform resource locator URL of the call APP is mapped to a corresponding class for calling.
Wherein, the calling up means that one APP calls up the other APP and transmits the value. That is, in order to increase the user experience, the need to open one APP among another APP may be required, and is generally divided into three types: explicit call jump, implicit call jump, URL Scheme jump, etc.
In the embodiment of the invention, in order to increase user experience, when the middleware receives an external calling application program APP, the Uniform Resource Locator (URL) of the calling APP is mapped into the corresponding class for calling, and the corresponding components are directly called by the middleware for information transmission, so that the independence of each component is increased, the mutual association among the components is reduced, the coupling among the components and the coupling between the components and the middleware are eliminated, the learning cost is reduced, and the controllability of safety is ensured.
Referring to fig. 2, an application example diagram of a component calling method of an iOS terminal according to an embodiment of the present invention is shown, in which h5, middleware in other APPs or safari, and a module a and a module B of the iOS terminal are taken as examples, and the middleware is respectively connected to the module a and the module B. Wherein, this middleware in order to include: the calling function (for example, NSInvocation), the runtime (runtime) are taken as examples, the module a includes the components a _ Action, Page _1, Page _2, and … …, and the module B includes the components B _ Action, Page _1, Page _2, and … …, but in practical applications, the invention is not limited thereto. It should be noted that, two crossed double arrows in the drawing indicate that components are connected with each other in the prior art, while the components in the module a and the components in the module B in the embodiment of the present invention are connected with the middleware respectively and have a single connection relationship, so the crossed category in the drawing is the category, and the like in the prior art, and in the embodiment, when the components are inter-modulated, the hard code and the category file of the category in the middleware are deleted, that is, the category is not needed, so the category in the drawing, that is, the crossed category, is deleted.
As shown in the figure, for example, the invocation request of the component a _ Action in the middleware obtaining module a invokes the component B _ Action in the module B, the invocation request includes: the NSinvocation directly calls the corresponding component B according to the parameter information of the component B; and displaying the result obtained by calling the component B through the component A. Particularly, when the parameter information of the calling component B changes (e.g., the original parameter is added as two parameters later), the NSInvocation directly calls the corresponding component according to the two parameters of the component B without modifying the parameters.
It is noted that while for simplicity of explanation, the method embodiments are shown as a series of acts or combination of acts, it will be appreciated by those skilled in the art that the present disclosure is not limited by the order of acts, as some steps may occur in other orders or concurrently with other steps in accordance with the invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
Optionally, an embodiment of the present invention further provides an iOS terminal component invoking apparatus, a block diagram of which is shown in fig. 3, where the apparatus includes: a first obtaining module 301, a calling module 302 and a first displaying module 303, wherein,
the first obtaining module 301 is configured to obtain a call request for a first component to call a second component, where the call request includes: parameter information of the second component;
the calling module 302 is configured to call the corresponding second component through a calling function according to the parameter information of the second component, where the calling function is a function of a message calling class, and directly calls the corresponding component according to the parameter information in the calling request;
the first display module 303 is configured to display a result obtained by invoking the second component to the user through the first component.
Optionally, in another embodiment, on the basis of the foregoing embodiment, the invoking module 302 includes: a reading module 401, a second obtaining module 402 and a calling sub-module 403, whose structural block diagram is shown in fig. 4, wherein,
the reading module 401 is configured to read a header file of a corresponding file lib packet according to the parameter information of the second component;
the second obtaining module 402 is configured to obtain a meaning of the component corresponding to the header file and a calling method of an application program interface API;
the calling submodule 403 is configured to call a corresponding second component by calling a function according to the meaning of the component and the calling method of the API, and delete the hard code and the classified text of the middleware in the call.
Optionally, in another embodiment, on the basis of the above embodiment, the apparatus further includes: a creating module 501, an encapsulating module 502 and a second display module 503, the structural block diagram of which is shown in fig. 5, wherein,
the creating module 501 is configured to dynamically create classes of all components of the iOS terminal and call modes of all components dynamically created by the iOS runtime when the mobile device operating system runs before the first obtaining module obtains the call request for the first component to call the second component, where the components at least include the first component and the second component;
the encapsulating module 502 is configured to encapsulate the source code of each component in all the components into a corresponding file lib package;
the second display module 503 is configured to display a header file of each lib package, so as to obtain a meaning of a corresponding component and a calling method of an application program interface API according to the header file.
Optionally, in another embodiment, on the basis of the above embodiment, the apparatus may further include: a receiving module 601 and a mapping module 602, wherein,
the receiving module 601 is configured to receive an external calling application App;
the mapping module 602 is configured to map the uniform resource locator URL of the calling App into a corresponding class for calling.
Optionally, an embodiment of the present invention further provides middleware called by an component based on an iOS terminal, a schematic structural diagram of which is shown in fig. 7, where the middleware includes: a mobile device operating system runtime (iOS runtime) module 701 and a calling function (NSInvocation) module 702, wherein,
the iOS runtime module 701 is used for dynamically creating classes of all components of the iOS terminal and dynamically creating calling modes of all components when the operating system of the mobile device runs;
the calling function module 702 is configured to obtain a call request for a first component to call a second component, where the call request includes: calling the corresponding second component according to the parameter information of the second component; and displaying the result obtained by calling the second component to the user through the first component.
Optionally, in another embodiment, on the basis of the foregoing embodiment, the NSInvocation module is further configured to delete the hard code and the classified text of the middleware in the corresponding second component called according to the parameter information of the second component.
With regard to the apparatus in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment related to the method, and reference may be made to part of the description of the embodiment of the method for the relevant points, and the detailed description will not be made here.
Optionally, an embodiment of the present invention further provides an electronic device, including:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the component invocation method of the iOS terminal as described above.
Optionally, an embodiment of the present invention further provides a storage medium, and when an instruction in the storage medium is executed by a processor of an electronic device, the electronic device is enabled to execute the component calling method of the iOS terminal as described above.
In an exemplary embodiment, there is also provided a storage medium comprising instructions, such as a memory comprising instructions, executable by a processor of an apparatus to perform the above method. Alternatively, the storage medium may be a non-transitory computer readable storage medium, which may be, for example, a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
Fig. 8 is a block diagram illustrating an electronic device 800 in accordance with an example embodiment. For example, the electronic device 800 may be a mobile terminal or a server, and in the embodiment of the present invention, the electronic device is taken as an example of a mobile terminal. For example, the electronic device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 8, electronic device 800 may include one or more of the following components: a processing component 802, a memory 804, a power component 806, a multimedia component 808, an audio component 810, an input/output (I/O) interface 812, a sensor component 814, and a communication component 816.
The processing component 802 generally controls overall operation of the electronic device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing components 802 may include one or more processors 820 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 802 can include one or more modules that facilitate interaction between the processing component 802 and other components. For example, the processing component 802 can include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
The memory 804 is configured to store various types of data to support operation at the device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 804 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The power supply component 806 provides power to the various components of the electronic device 800. The power components 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 800.
The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front facing camera and/or a rear facing camera. The front-facing camera and/or the rear-facing camera may receive external multimedia data when the device 800 is in an operating mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a Microphone (MIC) configured to receive external audio signals when the electronic device 800 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 804 or transmitted via the communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
The I/O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 814 includes one or more sensors for providing various aspects of state assessment for the electronic device 800. For example, the sensor assembly 814 may detect an open/closed state of the device 800, the relative positioning of components, such as a display and keypad of the electronic device 800, the sensor assembly 814 may also detect a change in the position of the electronic device 800 or a component of the electronic device 800, the presence or absence of user contact with the electronic device 800, orientation or acceleration/deceleration of the electronic device 800, and a change in the temperature of the electronic device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 may access a wireless network based on a communication standard, such as WiFi, a carrier network (such as 2G, 3G, 4G, or 5G), or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the electronic device 800 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described illustrated component calling methods of the iOS terminal.
In an exemplary embodiment, a non-transitory computer-readable storage medium comprising instructions, such as the memory 804 comprising instructions, executable by the processor 820 of the electronic device to perform the above-illustrated component invocation method of the iOS terminal is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, there is also provided a computer program product, wherein the instructions of the computer program product, when executed by the processor 820 of the electronic device 800, cause the electronic device 800 to perform the above-illustrated component calling method of the iOS terminal.
Fig. 9 is a block diagram illustrating an apparatus 900 for component invocation for an iOS terminal according to an example embodiment. For example, the apparatus 900 may be provided as a server. Referring to fig. 9, the apparatus 900 includes a processing component 922, which further includes one or more processors, and memory resources, represented by memory 932, for storing instructions, such as applications, that are executable by the processing component 922. The application programs stored in memory 932 may include one or more modules that each correspond to a set of instructions. Further, the processing component 922 is configured to execute instructions to perform the methods called by the components of the above-described method iOS terminal.
The device 900 may also include a power component 926 configured to perform power management of the device 900, a wired or wireless network interface 950 configured to connect the device 900 to a network, and an input output (I/O) interface 958. The apparatus 900 may operate based on an operating system stored in the memory 932, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, or the like.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It will be understood that the invention 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 invention is limited only by the appended claims.

Claims (12)

1. An component calling method of an iOS terminal, comprising:
acquiring a call request for calling a second component by a first component, wherein the call request comprises: parameter information of the second component;
calling the corresponding second component through a calling function according to the parameter information of the second component, wherein the calling function is a function of a message calling class, and directly calling the corresponding component according to the parameter information in the calling request;
and displaying the result obtained by calling the second component to the user through the first component.
2. The component calling method of the iOS terminal as recited in claim 1, wherein the calling the corresponding second component by calling a function according to the parameter information of the second component includes:
reading a header file of a corresponding file lib package according to the parameter information of the second component;
acquiring the meaning of the corresponding component of the header file and a calling method of an Application Program Interface (API);
and calling a corresponding second component by calling a function according to the meaning of the component and the calling method of the API, and deleting the hard code and the classified text of the middleware in the component calling.
3. The component calling method of the iOS terminal as recited in claim 1 or 2, wherein before obtaining the call request for the first component to call the second component, the method further comprises:
the method comprises the steps that an iOS runtime dynamically creates classes of all components of an iOS terminal and call modes of all the components through the operation of a mobile device operating system, wherein the components at least comprise a first component and a second component;
encapsulating the source code of each component in all the components into a corresponding file lib package;
and displaying the header file of each lib package so as to obtain the meaning of the corresponding component and the calling method of the application program interface API according to the header file.
4. The component calling method of the iOS terminal as recited in claim 1 or 2, characterized in that the method further comprises:
receiving an external calling application program APP;
and mapping the uniform resource location identifier URL of the calling APP to a corresponding class for calling.
5. An assembly call apparatus of an iOS terminal, comprising:
a first obtaining module, configured to obtain a call request for a first component to call a second component, where the call request includes: parameter information of the second component;
the calling module is used for calling the corresponding second component through a calling function according to the parameter information of the second component, wherein the calling function is a function of a message calling class, and the corresponding component is directly called according to the parameter information in the calling request;
and the first display module is used for displaying the result obtained by calling the second component to the user through the first component.
6. The component calling apparatus of the iOS terminal as recited in claim 5, wherein the calling module comprises:
the reading module is used for reading a header file of a corresponding file lib package according to the parameter information of the second component;
the second acquisition module is used for acquiring the meaning of the component corresponding to the header file and a calling method of an Application Program Interface (API);
and the calling submodule is used for calling the corresponding second component through a calling function according to the meaning of the component and the calling method of the API, and deleting the hard code and the classified text of the middleware in calling.
7. The component calling apparatus of the iOS terminal as recited in claim 5 or 6, characterized in that the apparatus further comprises:
the creating module is used for dynamically creating classes of all components of the iOS terminal and calling modes of all the components through iOS runtime when an operating system of the mobile equipment runs before the first obtaining module obtains the calling request of the first component for calling the second component, wherein the components at least comprise the first component and the second component;
the packaging module is used for packaging the source code of each component in all the components into a corresponding file lib package;
and the second display module is used for displaying the header file of each lib package so as to obtain the meaning of the corresponding component and the calling method of the application program interface API according to the header file.
8. The component calling apparatus of the iOS terminal as recited in claim 5 or 6, characterized in that the apparatus further comprises:
the receiving module is used for receiving an external calling application program (App);
and the mapping module is used for mapping the uniform resource location identifier URL of the calling App into a corresponding class for calling.
9. Middleware for component invocation on the basis of an iOS terminal, characterized by comprising:
the iOS runtime module is used for dynamically creating classes of all components of the iOS terminal and dynamically creating calling modes of all the components when the operating system of the mobile equipment runs;
a calling function module, configured to obtain a call request for a first component to call a second component, where the call request includes: calling the corresponding second component through a calling function according to the parameter information of the second component, wherein the calling function is a function of a message calling class, and directly calling the corresponding component according to the parameter information in the calling request; and displaying the result obtained by calling the second component to the user through the first component.
10. The middleware for component invocation based on an iOS terminal according to claim 9, wherein,
and the calling function module is also used for deleting the hard code and the classified text of the middleware in the second component called according to the parameter information of the second component.
11. 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 component invocation method of the iOS terminal of any of claims 1 to 4.
12. A storage medium, characterized in that instructions in the storage medium, when executed by a processor of an electronic device, enable the electronic device to perform a component calling method of an iOS terminal as recited in any one of claims 1 to 4.
CN202011341208.1A 2020-11-25 2020-11-25 iOS component calling method, device, middleware, electronic equipment and medium Pending CN112328330A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011341208.1A CN112328330A (en) 2020-11-25 2020-11-25 iOS component calling method, device, middleware, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011341208.1A CN112328330A (en) 2020-11-25 2020-11-25 iOS component calling method, device, middleware, electronic equipment and medium

Publications (1)

Publication Number Publication Date
CN112328330A true CN112328330A (en) 2021-02-05

Family

ID=74309643

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011341208.1A Pending CN112328330A (en) 2020-11-25 2020-11-25 iOS component calling method, device, middleware, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN112328330A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113296863A (en) * 2021-05-26 2021-08-24 平安国际智慧城市科技股份有限公司 Dynamic skin changing method, device, equipment and storage medium based on IOS system
CN113672309A (en) * 2021-08-20 2021-11-19 北京乐学帮网络技术有限公司 Business service method, device, electronic equipment and readable storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111158777A (en) * 2019-12-12 2020-05-15 中移(杭州)信息技术有限公司 Component calling method and device and computer readable storage medium

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111158777A (en) * 2019-12-12 2020-05-15 中移(杭州)信息技术有限公司 Component calling method and device and computer readable storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113296863A (en) * 2021-05-26 2021-08-24 平安国际智慧城市科技股份有限公司 Dynamic skin changing method, device, equipment and storage medium based on IOS system
CN113672309A (en) * 2021-08-20 2021-11-19 北京乐学帮网络技术有限公司 Business service method, device, electronic equipment and readable storage medium

Similar Documents

Publication Publication Date Title
US10909203B2 (en) Method and device for improving page display effect via execution, conversion and native layers
US9870239B2 (en) Method and device for running application program
CN109710259B (en) Data processing method, device and storage medium
WO2022078295A1 (en) Device recommendation method and electronic device
CN106547547B (en) data acquisition method and device
CN106792442B (en) Data migration method and device
CN110704030A (en) Interface configuration information generation method and device, electronic equipment and storage medium
CN109117144B (en) Page processing method, device, terminal and storage medium
US11210449B2 (en) Page display method and device and storage medium
CN112328330A (en) iOS component calling method, device, middleware, electronic equipment and medium
CN111159615B (en) Webpage processing method and device
WO2023005711A1 (en) Service recommendation method and electronic device
CN110865864A (en) Interface display method, device and equipment for fast application and storage medium
CN105468606B (en) Webpage saving method and device
CN110989987B (en) Portal webpage generation method and device, client, server and storage medium
WO2021057390A1 (en) Method for launching quick application, and related device
CN112433787A (en) Target object serialization method and device, electronic device and storage medium
CN111782997A (en) Method and device for loading webpage and storage medium
CN107911807B (en) Bluetooth data transmission method and device
CN112860625B (en) Data acquisition method, data storage method, device, equipment and storage medium
WO2022052706A1 (en) Service sharing method, system and electronic device
CN109032583B (en) Data interaction method and device
CN108958943B (en) Memory release method and device
CN110868640A (en) Resource transfer method, device, equipment and storage medium
CN111104110A (en) Global style sharing method, global style sharing device and electronic device

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