iOS component calling method, device, middleware, electronic device and medium

Through the component calling method of the iOS terminal, the component is directly called using the function of the message calling class, which solves the serious problem of code coupling between mobile components, improves development efficiency and security, and reduces development costs.

CN112328330BActive Publication Date: 2024-12-24BEIJING 58 INFORMATION TTECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011341208.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-25
Publication Date
2024-12-24
Estimated Expiration
2040-11-25

AI Technical Summary

Technical Problem

The code coupling between mobile components is severe, resulting in high development costs, low efficiency, and uncontrollable security.

Method used

Through the component calling method of the iOS terminal, the function of the message calling class is used to directly call the component according to the component parameter information, and the hard code and classification text of the middleware are deleted in the call, the component class is dynamically created, the source code is encapsulated as a lib package, and the component independence is increased reduces coupling.

Benefits of technology

It reduces the interrelationship between components and middleware coupling, improves development efficiency, reduces learning costs, and ensures security and controllability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112328330B_ABST
    Figure CN112328330B_ABST
Patent Text Reader

Abstract

The present invention provides a component calling method, device, middleware, and electronic device storage medium of an iOS terminal, wherein the method comprises: when obtaining a calling request of a first component to call a 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 message calling function, 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, directly calling the corresponding component through the middleware for information transmission increases the independence of each component, reduces the mutual correlation between components, eliminates the coupling between components and the coupling between components and middleware, reduces the learning cost, and ensures safety and controllability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a calling method, device, middleware, electronic device and storage medium of an iOS component. Background Art

[0002] As the development of the mobile device operating system (IOS, iPhone Operation System) project progresses, new businesses will continue to be introduced, resulting in an increasing amount of code in mobile terminal applications (APP, Application). All codes are concentrated in one project, and changes to local codes often require modifications to the codes of the projects associated with them, resulting in longer and longer code modifications and increasingly serious code coupling between modules.

[0003] In the related technologies, the registration based on the Uniform Resource Locator (URL) runtime results in slow startup speed, relatively simple parameter transfer, only strings can be transferred, high development cost, and uncontrollable security. The Iop middleware of China Mobile's centralized operation platform is seriously coupled with components. Modifying components requires modifying the middleware, which has high development cost and uncontrollable security. Based on the target-action operation, the hard code coupling is more serious. Modifying components requires modifying the middleware, which has high development cost and uncontrollable security.

[0004] Therefore, how to reduce the coupling of codes between mobile components and development costs and improve development efficiency is a technical problem that needs to be solved. Summary of the invention

[0005] The present invention provides a method, device, middleware, electronic device and storage medium for calling a service of an iOS component, so as to at least solve the problem in the related art that the development success is high but the development efficiency is low due to the serious coupling of codes between mobile terminal components. The technical solution of the present invention is as follows:

[0006] According to a first aspect of an embodiment of the present invention, a component calling method of an iOS terminal is provided, comprising:

[0007] Obtaining a call request for the first component to call the second component, the call request including: parameter information of the second component;

[0008] Calling the corresponding second component by calling a function according to the parameter information of the second component, wherein the calling function is a message calling function that directly calls the corresponding component according to the parameter information in the calling request;

[0009] The result obtained by calling the second component is displayed to the user through the first component.

[0010] Optionally, calling the corresponding second component by calling a function according to the parameter information of the second component includes:

[0011] Reading a header file of a corresponding file lib package according to the parameter information of the second component;

[0012] Obtain the meaning of the component corresponding to the header file and the calling method of the application program interface API;

[0013] The corresponding second component is called by calling a function according to the meaning of the component and the calling method of the API, and the hard code and classification text of the middleware are deleted in the component calling.

[0014] Optionally, before obtaining the calling request of the first component to call the second component, the method further includes:

[0015] Dynamically create classes of all components of the iOS terminal and dynamically create calling methods of all components through the iOS runtime of the mobile device operating system, wherein the components include at least a first component and a second component;

[0016] Package the source code of each component in all components into the corresponding file lib package;

[0017] Display 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.

[0018] Optionally, the method further includes:

[0019] Receive an external call to the application APP;

[0020] The uniform resource locator URL of the calling APP is mapped to the corresponding class class for calling.

[0021] According to a second aspect of an embodiment of the present invention, a component calling device of an iOS terminal is provided, comprising:

[0022] A first acquisition module is used to acquire a call request of the first component to call the second component, wherein the call request includes: parameter information of the second component;

[0023] A calling module, used to call the corresponding second component by calling a function according to the parameter information of the second component, wherein the calling function is a message calling function, and directly calls the corresponding component according to the parameter information in the calling request;

[0024] The first display module is used to display the result obtained by calling the second component to the user through the first component.

[0025] Optionally, the calling module includes:

[0026] A reading module, used for reading a header file of a corresponding file lib package according to the parameter information of the second component;

[0027] A second acquisition module is used to obtain the meaning of the component corresponding to the header file and the calling method of the application program interface API;

[0028] The calling submodule is used to call the corresponding second component through a calling function according to the meaning of the component and the calling method of the API, and delete the hard code and classification text of the middleware during the calling.

[0029] Optionally, the device further comprises:

[0030] A creation module, used for dynamically creating classes of all components of the iOS terminal and dynamically creating calling methods of all components through the iOS runtime of the mobile device operating system before the first acquisition module acquires a call request for the first component to call the second component, wherein the components include at least the first component and the second component;

[0031] The packaging module is used to package the source code of each component in all components into the corresponding file lib package;

[0032] The second display module is used to display 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.

[0033] Optionally, the device further comprises:

[0034] A receiving module, used for receiving an external call to an application program App;

[0035] The mapping module is used to map the uniform resource locator URL of the calling App into a corresponding class for calling.

[0036] According to a third aspect of an embodiment of the present invention, there is provided a middleware for component calling based on an iOS terminal, comprising:

[0037] The iOS runtime module is used to dynamically create classes of all components of iOS terminals and dynamically create calling methods for all components;

[0038] A calling function module is used to obtain a calling request from a first component to call a second component, wherein the calling request includes: 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 message calling function, and directly calls the corresponding component according to the parameter information in the calling request; and displaying the result of calling the second component to the user through the first component.

[0039] Optionally, the calling function module is further used to delete the hard code and classification text of the middleware when calling the corresponding second component according to the parameter information of the second component.

[0040] According to a fourth aspect of an embodiment of the present invention, an embodiment of the present invention further provides an electronic device, including:

[0041] processor;

[0042] a memory for storing instructions executable by the processor;

[0043] The processor is configured to execute the instruction to implement the component calling method of the iOS terminal as claimed in claim 1.

[0044] According to a fifth aspect of an embodiment of the present invention, a storage medium is provided. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the component calling method of the iOS terminal as described above.

[0045] According to a sixth aspect of an embodiment of the present invention, a computer program product is provided. When instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the above-mentioned component calling method of an iOS terminal.

[0046] The technical solution provided by the embodiments of the present invention may at least include the following beneficial effects:

[0047] In an embodiment of the present invention, when a call request for a first component to call a second component is obtained, the corresponding second component is called through a call function according to the parameter information of the second component in the call request, wherein the call function is a message call class function, and the corresponding component is directly called according to the parameter information in the call request; and the result obtained by calling the second component is displayed to the user through the first component. In other words, in an embodiment of the present invention, the middleware is used to directly call the corresponding component for information transmission, which increases the independence of each component, reduces the correlation between components, eliminates the coupling between components and the coupling between components and middleware, reduces the learning cost, and ensures safety and controllability.

[0048] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] The accompanying drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present invention, and together with the description are used to explain the principles of the present invention, and do not constitute improper limitations of the present invention.

[0050] Figure 1 The present invention is a flowchart of a component calling method of an iOS terminal according to an exemplary embodiment.

[0051] Figure 2 The present invention is a diagram showing an application example of a component calling method of an iOS terminal according to an exemplary embodiment.

[0052] Figure 3 The present invention is a block diagram of a component calling device of an iOS terminal according to an exemplary embodiment.

[0053] Figure 4 It is a block diagram of a calling module according to an exemplary embodiment.

[0054] Figure 5 It is another block diagram of a component calling device of an iOS terminal according to an exemplary embodiment.

[0055] Figure 6 It is another block diagram showing a component calling device of an iOS terminal according to an exemplary embodiment.

[0056] Figure 7 The present invention is a block diagram of a middleware based on component calling of an iOS terminal according to an exemplary embodiment.

[0057] Figure 8 The present invention is a structural block diagram of an electronic device according to an exemplary embodiment.

[0058] Fig. 9 The invention is a block diagram showing a device for calling a component of an iOS terminal according to an exemplary embodiment. DETAILED DESCRIPTION

[0059] In order to enable ordinary persons in the art to better understand the technical solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings.

[0060] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order 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. Instead, they are merely examples of devices and methods consistent with some aspects of the present invention as detailed in the appended claims.

[0061] Figure 1 is a flowchart of a component calling method of an iOS terminal according to an exemplary embodiment. Figure 1 As shown, the component calling method of the iOS terminal is used in the terminal, including the following steps:

[0062] In step 101, a call request of a first component to call a second component is obtained, wherein the call request includes: parameter information of the second component;

[0063] In step 102, the corresponding second component is called by calling a function according to the parameter information of the second component, wherein the calling function is a message calling function, and the corresponding component is directly called according to the parameter information in the calling request;

[0064] In step 103, the data obtained by calling the second component is displayed to the user through the first component.

[0065] The component calling method of the iOS terminal described in the present invention can be applied to terminals, servers, etc., without limitation herein, and its terminal implementation device can be a smart phone, a laptop computer, a tablet computer, and other electronic devices, without limitation herein.

[0066] Combine the following Figure 1 , the specific implementation steps of a component calling method of an iOS terminal provided by an embodiment of the present invention are described in detail.

[0067] First, execute step 101 to obtain a call request for the first component to call the second component, where the call request includes: parameter information of the second component.

[0068] Among them, in this step, the user clicks on the browser or safari, or H5, or APP, etc., and the background can detect the user's click instruction. For example, the user opens the Che Shang Tong APP, views the image of the car in stock, and initiates a call request. For example, the call request can include parameters such as the name and model of the car. At this time, the middleware obtains the call request of the user to call the second component through the first component, that is, the middleware obtains the call request of the user clicking on the Che Shang Tong APP to view the photo of the car in stock.

[0069] The calling request may include parameter information of the second component, which may include one parameter or multiple parameters, which is not limited in this embodiment. Of course, it may also include parameter information of the caller (i.e., user), calling function, etc., which may be determined according to actual needs.

[0070] Next, execute step 102, and call the corresponding second component by calling a function according to the parameter information of the second component, wherein the calling function is a message calling function, and directly calls the corresponding component according to the parameter information in the calling request.

[0071] In this step, first read the header file of the corresponding file lib package according to the parameter information of the second component; then obtain the meaning of the component corresponding to the header file and the calling method of the application program interface API; finally, call the corresponding second component by calling the function NSInvocation according to the meaning of the component and the calling method of the API, and delete the hard code and classification text of the middleware in the component call. The middleware is thin and light, its function is specific and lightweight and highly portable.

[0072] Among them, NSInvocation is a way to call a function. It encapsulates the caller, function name, and parameters into an object, and then executes the called function through an invoke function. Its idea is the commander mode, which encapsulates the request into an object. In other words, NSInvocation is an implementation of the command mode. It contains selectors, method signatures, corresponding parameters, and target objects, etc.; it is used to implement mutual calls between components, and delete the hard code and classification files of middleware during the call, such as the type or category file of middleware. Among them, the method signature is the return value type and parameter type corresponding to the method. When NSInvocation is called, it will search for the corresponding method through the target object at runtime to ensure uniqueness, which can be explained by [receiver message]. It is rare to create NSInvocation directly in the actual development process. These things are usually left to the system. For example, the implementation of arm64 method replacement in bang's JSPatch is implemented by using NSInvocation in the last step of runtime message forwarding.

[0073] That is to say, the calling function in this embodiment, such as NSInvocation, is a function of the message calling class, which contains all the components of the OC message: target, selector, parameters and return value. NSInvocation can convert a message into an object, each parameter of the message can be set directly, and the return value can be set by itself when an NSInvocation object is scheduled. An NSInvocation object can repeatedly schedule different targets, and its selector can also be set to another method signature. NSInvocation complies with the NSCoding protocol, but only supports NSPortCoder encoding and does not support archiving operations. It should be noted that in object-oriented, methods are also called messages. Among them, the steps of using NSInvocation are: create a signature object (NSMethodSignature object) according to the method (or parameter information in the message), create a calling object (NSInvocation object) according to the signature object, set the relevant information of the calling object (NSInvocation object), and then use the calling method to obtain the method return value.

[0074] Among them, when the parameters of the calling component change, for example, the first calling request initiated by the first component to call the second component for the first time, the calling request may only include the name of the car, such as Audi, etc.; if the search result is not ideal, the parameters can be added, and the calling request can be initiated again, and the parameters of the calling component can be added in the calling request, such as including the name and model of the calling component, such as Audi, Q5, etc. At this time, when the middleware detects the calling request again, it directly calls the corresponding component according to the multiple participants in the calling request. In the prior art, when the parameters in the calling request initiated by the first component change, the middleware needs to modify the corresponding parameters and classes through category according to the parameters in the calling request, and then initiate a call to the component corresponding to the parameter. It can be seen from this that compared with the prior art, the present invention does not need to modify the corresponding local parameters, especially when the parameters of the calling component change, and can directly call the corresponding component according to the parameters of the calling component in the calling request.

[0075] Finally, step 103 is executed to display the data obtained by calling the second component to the user through the first component.

[0076] The middleware displays the data obtained by calling the second component to the user through the first component.

[0077] The component calling method of the iOS terminal shown in this exemplary embodiment obtains a calling request for the first component to call the second component, and calls the corresponding second component by calling a function according to the parameter information of the second component in the calling request; and displays 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 for information transmission, which increases the independence of each component, reduces the mutual correlation between components, eliminates the coupling between components and the coupling between components and middleware, reduces the learning cost, and ensures safety and controllability.

[0078] Optionally, in another embodiment, based on the above embodiment, before obtaining the calling request of the first component to call the second component, the method may further include:

[0079] 1) dynamically creating classes of all components of the iOS terminal and dynamically creating calling methods of all components through the iOS runtime of the mobile device operating system, wherein the components include at least a first component and a second component;

[0080] In this step, Runtime, also known as runtime, is a set of APIs written in the underlying C language. Runtime is one of the cores inside iOS. The underlying OC code that is usually written is implemented based on it.

[0081] That is to say, RunTime is the runtime, and OC is the runtime mechanism, of which the most important is the message mechanism. For C language, the function call will determine which function to call during compilation. For OC functions, it is a dynamic calling process, and it cannot be determined which function to actually call during compilation. Only when it is actually running will the corresponding function be found according to the function name to call. The Runtime of this embodiment is basically written in C and assembly, and it is an effort made for the high efficiency of the dynamic system.

[0082] Among them, the iOS runtime is used to dynamically create the classes of all components of the iOS terminal and the calling methods of all components, and a Person class is created, etc. The specific creation method is well known to those skilled in the art and will not be repeated here.

[0083] 2) Package the source code of each component in all components into the corresponding file lib package;

[0084] In this step, the source code of each component is encapsulated (ie, packaged) into a lib package in order to save memory space, because the source code occupies more memory than the lib package.

[0085] 3) Display 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.

[0086] 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 a component call request is detected, so as to obtain the meaning of the component corresponding to the header file and the API calling method.

[0087] Optionally, in another embodiment, based on the above embodiment, the method may further include: receiving an external call to an application APP; mapping the uniform resource locator URL of the called APP to a corresponding class for invocation.

[0088] In this embodiment, when the middleware receives an external call to an APP, the uniform resource locator URL of the called APP is mapped to a corresponding class for invocation.

[0089] Among them, calling up means that one APP calls up another APP and passes values. In other words, in order to improve the user experience, it may be required to open another APP in one APP. Generally, there are three types: explicit call jump, implicit call jump, URL Scheme jump, etc.

[0090] In an embodiment of the present invention, in order to enhance user experience, when the middleware receives an external call to an application APP, it maps the uniform resource locator URL of the called APP to a corresponding class class for invocation, and directly calls the corresponding component through the middleware to transmit information, thereby increasing the independence of each component, reducing the mutual correlation between components, eliminating the coupling between components and the coupling between components and the middleware, reducing the learning cost, and ensuring safety and controllability.

[0091] See also Figure 2 , is an application example diagram of a component calling method of an iOS terminal provided by an embodiment of the present invention. As shown in the figure, h5, other APP or Safari middleware, module A and module B of the iOS terminal are taken as examples, and the middleware is connected to module A and module B respectively. Among them, the middleware includes: calling function (taking NSInvocation as an example), runtime (runtime) as an example, module A includes component A_Action, component Page_1, component Page_2, ... as an example, and module B includes component B_Action, component Page_1, component Page_2, ... as an example, but in actual applications, it is not limited to this. It should be noted that the two crossed double arrows in the figure indicate that in the prior art, the components are interconnected, while the components in module A and the components in module B in the embodiment of the present invention are respectively connected to the middleware and have a single connection relationship. Therefore, the crossed-out categories in the figure are classifications, types, etc. in the prior art, and in this embodiment, when the components call each other, the hard code and classification files of the category in the middleware are deleted, that is, the category is not needed, so the category in the figure, that is, the crossed-out category, is deleted.

[0092] As shown in the figure, for example, the middleware obtains a call request from component A_Action in module A to call component B_Action in module B. The call request includes: parameter information of component B, which can be one or more. NSInvocation directly calls the corresponding component B according to the parameter information of component B; and displays the result obtained by calling component B through component A. In particular, when the parameter information of calling component B changes (for example, originally one parameter, and then increased to two parameters), at this time, NSInvocation does not need to modify the parameters, and directly calls the corresponding component according to the two parameters of component B.

[0093] It should be noted that, for the method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that this implementation disclosure is not limited by the order of the actions described, because according to the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the present invention.

[0094] Optionally, the embodiment of the present invention further provides a component calling device for an iOS terminal, and its structural block diagram is as follows: Figure 3 As shown, the device includes: a first acquisition module 301, a calling module 302 and a first display module 303, wherein:

[0095] The first acquisition module 301 is used to acquire a call request of the first component to call the second component, wherein the call request includes: parameter information of the second component;

[0096] The calling module 302 is used to call the corresponding second component by calling a function according to the parameter information of the second component, wherein the calling function is a message calling function, and directly calls the corresponding component according to the parameter information in the calling request;

[0097] The first display module 303 is used to display the result obtained by calling the second component to the user through the first component.

[0098] Optionally, in another embodiment, based on the above embodiment, the calling module 302 includes: a reading module 401, a second acquisition module 402 and a calling submodule 403, and its structural block diagram is as follows: Figure 4 As shown,

[0099] The reading module 401 is used to read the header file of the corresponding file lib package according to the parameter information of the second component;

[0100] The second acquisition module 402 is used to acquire the meaning of the component corresponding to the header file and the calling method of the application program interface API;

[0101] The calling submodule 403 is used to call the corresponding second component by calling the function according to the meaning of the component and the calling method of the API, and delete the hard code and classification text of the middleware during the calling.

[0102] Optionally, in another embodiment, based on the above embodiment, the device further includes: a creation module 501, a packaging module 502 and a second display module 503, and its structural block diagram is as follows: Figure 5 As shown,

[0103] The creation module 501 is used to dynamically create classes of all components of the iOS terminal and dynamically create calling methods of all components through the iOS runtime of the mobile device operating system before the first acquisition module acquires the calling request of the first component to call the second component, wherein the components include at least the first component and the second component;

[0104] The packaging module 502 is used to package the source code of each component in all components into a corresponding file lib package;

[0105] The second display module 503 is used to display 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.

[0106] Optionally, in another embodiment, based on the above embodiment, the device may further include: a receiving module 601 and a mapping module 602, wherein:

[0107] The receiving module 601 is used to receive an external call to an application program App;

[0108] The mapping module 602 is used to map the uniform resource locator URL of the calling App into a corresponding class for calling.

[0109] Optionally, the embodiment of the present invention further provides a middleware based on component calling of an iOS terminal, and its structural diagram is shown in FIG. Figure 7 As shown, the middleware includes: a mobile device operating system runtime (iOS runtime) module 701 and a call function (NSInvocation) module 702, wherein:

[0110] The iOS runtime module 701 of the mobile device operating system runtime is used to dynamically create classes of all components of the iOS terminal and dynamically create calling methods of all components;

[0111] The calling function module 702 is used to obtain a calling request from a first component to call a second component, wherein the calling request includes: parameter information of the second component, 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.

[0112] Optionally, in another embodiment, based on the above embodiment, the NSInvocation module is further used to delete the hard code and classification text of the middleware when calling the corresponding second component according to the parameter information of the second component.

[0113] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method. For relevant details, please refer to the partial description of the method embodiment, and will not be elaborated here.

[0114] Optionally, an embodiment of the present invention further provides an electronic device, including:

[0115] processor;

[0116] a memory for storing instructions executable by the processor;

[0117] The processor is configured to execute the instructions to implement the component calling method of the iOS terminal as described above.

[0118] Optionally, an embodiment of the present invention further provides a storage medium, when instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the component calling method of the iOS terminal as described above.

[0119] In an exemplary embodiment, a storage medium including instructions is also provided, such as a memory including instructions, and the instructions can be executed by a processor of the device to complete the above method. Optionally, the storage medium can be a non-transitory computer-readable storage medium, for example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0120] Figure 8 800 is a block diagram of an electronic device 800 according to an exemplary embodiment. For example, the electronic device 800 may be a mobile terminal or a server, and the electronic device is a mobile terminal as an example for explanation in the embodiment of the present invention. 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, a fitness device, a personal digital assistant, etc.

[0121] Reference Figure 8 , the 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 .

[0122] The processing component 802 generally controls the overall operation of the electronic device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.

[0123] The memory 804 is configured to store various types of data to support operations on the device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, 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 disk or optical disk.

[0124] The power supply component 806 provides power to the various components of the electronic device 800. The power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 800.

[0125] The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the 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 input signals from the 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 boundaries of the 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 camera and / or a rear camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and the rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0126] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the electronic device 800 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.

[0127] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.

[0128] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the electronic device 800. For example, the sensor assembly 814 can detect the open / closed state of the device 800, the relative positioning of components, such as the display and keypad of the electronic device 800, and the sensor assembly 814 can also detect the position change of the electronic device 800 or a component of the electronic device 800, the presence or absence of contact between the user and the electronic device 800, the orientation or acceleration / deceleration of the electronic device 800, and the temperature change of the electronic device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 814 may also include an optical 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 accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0129] The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 can 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 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0130] 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, microcontrollers, microprocessors or other electronic components to execute the component calling method of the iOS terminal shown above.

[0131] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, and the instructions can be executed by the processor 820 of the electronic device to complete the component calling method of the iOS terminal shown above. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0132] In an exemplary embodiment, a computer program product is further provided. When instructions in the computer program product are executed by the processor 820 of the electronic device 800, the electronic device 800 executes the component calling method of the iOS terminal shown above.

[0133] Fig. 9 1 is a block diagram of a device 900 for calling a component of an iOS terminal according to an exemplary embodiment. For example, the device 900 may be provided as a server. Fig. 9 , the device 900 includes a processing component 922, which further includes one or more processors, and a memory resource represented by a memory 932 for storing instructions executable by the processing component 922, such as an application. The application stored in the memory 932 may include one or more modules each corresponding to a set of instructions. In addition, the processing component 922 is configured to execute instructions to perform the method called by the component of the iOS terminal of the above method.

[0134] The device 900 may also include a power supply 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 device 900 may operate based on an operating system stored in the memory 932, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, or the like.

[0135] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not disclosed by the present invention. The specification and examples are to be considered exemplary only, and the true scope and spirit of the present invention are indicated by the following claims.

[0136] It should be understood that the present invention is not limited to the exact construction that has been 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 invention is limited only by the appended claims.

Claims

1. A component calling method for an iOS terminal, characterized in that: include: Dynamically create classes of all components of the iOS terminal and dynamically create calling methods of all components through the iOS runtime of the mobile device operating system, wherein the components include at least a first component and a second component; Package the source code of each component in all components into the corresponding file lib package; Display 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; Obtaining a call request for the first component to call the second component, the call request including: parameter information of the second component; Calling the corresponding second component by calling a function according to the parameter information of the second component, including: reading a header file of a corresponding file lib package according to the parameter information of the second component, obtaining the meaning of the component corresponding to the header file and the calling method of the application program interface API, calling the 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 classification text of the middleware in the component calling, 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; The result obtained by calling the second component is displayed to the user through the first component.

2. The component calling method of the iOS terminal according to claim 1, characterized in that: The method further comprises: Receive an external call to the application APP; The uniform resource locator URL of the calling application APP is mapped into the corresponding class class for calling.

3. A component calling device for an iOS terminal, characterized in that: include: A creation module, used for dynamically creating classes of all components of the iOS terminal and dynamically creating calling methods of all components through the iOS runtime of the mobile device operating system before the first acquisition module acquires a call request of the first component to call the second component, wherein the components include at least the first component and the second component; The packaging module is used to package the source code of each component in all components into the corresponding file lib package; The second display module is used to display 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; A first acquisition module is used to acquire a call request of the first component to call the second component, wherein the call request includes: parameter information of the second component; A calling module, used to call the corresponding second component by calling a function according to the parameter information of the second component, the calling module includes: a reading module, used to read the header file of the corresponding file lib package according to the parameter information of the second component; a second acquisition module, used to obtain the meaning of the component corresponding to the header file and the calling method of the application program interface API; a calling submodule, used to call the 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 classification text of the middleware in the call, wherein the calling function is a message calling class function, which directly calls the corresponding component according to the parameter information in the calling request; The first display module is used to display the result obtained by calling the second component to the user through the first component.

4. The component calling device of iOS terminal according to claim 3, characterized in that: The device also includes: A receiving module, used for receiving an external call to an application program App; The mapping module is used to map the uniform resource locator URL of the calling application App into a corresponding class class for calling.

5. A middleware based on component calling of iOS terminal, characterized in that: include: The iOS runtime module is used to dynamically create classes of all components of iOS terminals and dynamically create calling methods for all components; A calling function module is used to obtain a calling request for a first component to call a second component, wherein the calling request includes: parameter information of the second component, and calling the corresponding second component through a calling function according to the parameter information of the second component, including: reading a header file of a corresponding file lib package according to the parameter information of the second component, obtaining the meaning of the component corresponding to the header file and the calling method of the application program interface API, 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 classification text of the middleware in the component call, wherein the calling function is a message calling class function, and directly calls the corresponding component according to the parameter information in the calling request; and presenting the result of calling the second component to the user through the first component.

6. The middleware based on component call of iOS terminal according to claim 5, characterized in that: The calling function module is also used to delete the hard code and classification text of the middleware when calling the corresponding second component according to the parameter information of the second component.

7. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instruction to implement the component calling method of the iOS terminal as described in any one of claims 1 to 2.

8. A storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the component calling method of an iOS terminal as described in any one of claims 1 to 2.