CN107643952B - Local class library calling method and device - Google Patents

Local class library calling method and device Download PDF

Info

Publication number
CN107643952B
CN107643952B CN201610575879.1A CN201610575879A CN107643952B CN 107643952 B CN107643952 B CN 107643952B CN 201610575879 A CN201610575879 A CN 201610575879A CN 107643952 B CN107643952 B CN 107643952B
Authority
CN
China
Prior art keywords
local
service
library
class library
component
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610575879.1A
Other languages
Chinese (zh)
Other versions
CN107643952A (en
Inventor
利炳根
彭钊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201610575879.1A priority Critical patent/CN107643952B/en
Publication of CN107643952A publication Critical patent/CN107643952A/en
Application granted granted Critical
Publication of CN107643952B publication Critical patent/CN107643952B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

The invention discloses a local class library calling method, which comprises the following steps: acquiring a service type and a service parameter according to an input control instruction; selecting a local class library component corresponding to the service type according to a preset local class library information table; based on the selected interface of the local library component, the service parameters are sent to the local library component; and controlling the local class library component to execute the control instruction according to the service parameters. The invention also discloses a local class library calling device. The invention solves the technical problem that the application software cannot execute the function corresponding to the missing component due to the imperfect real Native component, greatly enriches the functions of the real Native application software and improves the user experience.

Description

Local class library calling method and device
Technical Field
The invention relates to the technical field of networks, in particular to a method and a device for calling a local class library.
Background
The fact Native (RN) is a technology that is introduced by Facebook and enables ios (mobile operating system developed by apple) application software, android application software and a background to be written simultaneously by Java language, so that the development cost of the application software is greatly reduced, and more application software uses the fact Native.
However, since the real Native technology is not mature, many common components in practical applications are lacking, and therefore, corresponding functions cannot be provided when development of application function software is performed. For example, the existing read Native technology does not provide functional components for video viewing, local album viewing, local camera calling, local file uploading and the like, which also results in that the application software written by the read Native cannot view video, look up the local album, call the local camera or upload the local file, and these functions are also functions commonly used by users, thus seriously affecting the practicability of the application software.
Disclosure of Invention
The invention mainly aims to provide a method and a device for calling a local class library, and aims to solve the technical problem that a Reactnative application software functional component is incomplete.
In order to achieve the above object, the present invention provides a method for calling a local class library, which comprises the following steps:
acquiring a service type and a service parameter according to an input control instruction;
selecting a local class library component corresponding to the service type according to a preset local class library information table;
based on the selected interface of the local library component, the service parameters are sent to the local library component;
and controlling the local class library component to execute the control instruction according to the service parameters.
In one embodiment, before the step of obtaining the service type and the service parameter according to the input control instruction, the method further includes:
and packaging the pre-configured local libraries to obtain corresponding local library components, and configuring a local library information table according to the local library components.
In one embodiment, before the step of obtaining the service type and the service parameter according to the input control instruction, the method further includes:
configuring corresponding service customization parameters for the service types;
the step of sending the service parameters to the local class library component based on the selected interface of the local class library component comprises:
based on the selected interface of the local library component, sending the service parameters and the service customization parameters to the local library component;
the step of controlling the local class library component to execute the control instruction according to the service parameter comprises the following steps:
and controlling the local class library component to execute the control instruction according to the service parameters and the service customization parameters.
In one embodiment, the step of controlling the local class library component to execute the control instruction according to the service parameter comprises:
and selecting a class or a method from the local class library component according to the service type, and controlling the selected class or method to execute the control instruction according to the service parameter.
In one embodiment, the local class libraries include one or more of a video class library, a file upload class library, a camera function class library, and a local album function class library.
In addition, to achieve the above object, the present invention further provides a local class library invoking device, including:
the service module is used for acquiring the service type and the service parameters according to the input control instruction;
the selecting module is used for selecting the local library component corresponding to the service type according to a preset local library information table;
the sending module is used for sending the service parameters to the local library component based on the selected interface of the local library component;
and the execution module is used for controlling the local class library component to execute the control instruction according to the service parameters.
In one embodiment, the local class library calling device further comprises:
and the packaging module is used for packaging the preset local libraries to obtain corresponding local library components and configuring a local library information table according to the local library components.
In one embodiment, the local class library calling device further comprises:
the customizing module is used for configuring corresponding business customizing parameters for the business types;
the sending module is further configured to,
based on the selected interface of the local library component, sending the service parameters and the service customization parameters to the local library component;
the execution module is further configured to,
and controlling the local class library component to execute the control instruction according to the service parameters and the service customization parameters.
In one embodiment, the execution module is further to,
and selecting a class or a method from the local class library component according to the service type, and controlling the selected class or method to execute the control instruction according to the service parameter.
In one embodiment, the local class libraries include one or more of a video class library, a file upload class library, a camera function class library, and a local album function class library.
The embodiment of the invention provides a method and a device for calling a local class library, which are used for acquiring a service type and a service parameter according to an input control instruction; then, according to a local library information table configured in advance, selecting a local library component corresponding to the current service type for calling the local library component to execute a current control instruction; and then, based on the selected interface of the local library component, the service parameters are sent to the local library component, and the local library component is controlled to execute the control instruction according to the service parameters, so that the control instruction is executed through the local library. The method and the device fully utilize the existing local library resources, call the local library components to replace the Native components of the real Native, and execute the control instructions input by the user to the application software, solve the technical problem that the application software cannot execute the functions corresponding to the missing components due to the fact that the components of the real Native are incomplete, greatly enrich the functions of the real Native application software, and improve the user experience.
Drawings
FIG. 1 is a flowchart illustrating a first embodiment of a method for local class library invocation according to the present invention;
FIG. 2 is a flowchart illustrating a second and a fifth embodiment of a method for local class library invocation according to the present invention;
FIG. 3 is a flowchart illustrating a third embodiment of a method for local class library invocation according to the present invention;
FIG. 4 is a flowchart illustrating a fourth embodiment of a method for invoking a local class library according to the present invention;
FIG. 5 is a functional block diagram of a local class library calling apparatus according to a first embodiment and a fourth embodiment of the present invention;
FIG. 6 is a functional block diagram of a local class library calling device according to a second embodiment and a fifth embodiment of the present invention;
FIG. 7 is a functional block diagram of a device for local class library invocation according to a third embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, a first embodiment of a local class library calling method according to the present invention provides a local class library calling method, where the local class library calling method includes:
and step S10, acquiring the service type and the service parameter according to the input control instruction.
According to the method and the device, the operation instruction of the application software is executed by calling the local library, so that the defect that the function of the current React Native (RN for short) technical component is incomplete is overcome, and the application software compiled based on the React Native can provide richer function experience for users. The embodiment takes the fact Native application software deployed in the mobile terminal as an example for explanation.
Specifically, as an implementation manner, first, the mobile terminal receives a control instruction input by a user, and obtains a service type and a service parameter.
The service type is the type of a current control instruction, such as a video loading instruction, a picture uploading instruction, a camera calling instruction, a local album viewing instruction and the like; the service parameters record parameter data required for executing the current control instruction, such as a URL address of a video to be loaded, a file path to be uploaded, local hardware to be called, a local file path to be viewed, and the like.
And step S20, selecting the local library component corresponding to the service type according to a preset local library information table.
After the service type and the service parameters are obtained, a local library component corresponding to the current service type is selected according to the current service type and a local library information table configured in advance, and the selected local library component is a local library capable of executing the current service.
The preset local library information table records each local library component which can be called by the current terminal local system, and the class names can be used for identifying different types of library components.
Specifically, as an implementation manner, the mobile terminal may obtain a class capable of executing the current service according to the current service type. For example, if the current service type is a camera call instruction, the class capable of executing the current service is a camera call class.
Then, the mobile terminal searches the matched class name in the local class library information table according to the class capable of executing the current service.
If the class name matched with the class capable of executing the current service is successfully searched, the local class library component corresponding to the searched class name is used as the local class library component corresponding to the current service type.
As another embodiment, the service types that can be executed corresponding to each local class library component may also be preconfigured, so that after the service type of the current service is obtained, the corresponding local class library component may be directly found according to the local class library information table.
Therefore, the local class library component corresponding to the current service type is obtained.
And step S30, sending the service parameters to the local library component based on the selected interface of the local library component.
And after the local library component is selected and obtained, sending the service parameters to the local library component through an interface of the local library component.
And step S40, controlling the local library component to execute the control instruction according to the service parameter.
And after receiving the service parameters, the local class library component executes corresponding control instructions according to the service parameters. For example, the local video library downloads the corresponding video from the server according to the video downloading link address in the service parameter, and loads the video to the display interface for the user to watch, so that the problem that the developed application software cannot watch the video due to the fact that no video component exists in the current fact Native is solved.
In the embodiment, the service type and the service parameter are obtained according to the input control instruction; then, according to a local library information table configured in advance, selecting a local library component corresponding to the current service type for calling the local library component to execute a current control instruction; and then, based on the selected interface of the local library component, the service parameters are sent to the local library component, and the local library component is controlled to execute the control instruction according to the service parameters, so that the control instruction is executed through the local library. According to the embodiment, the existing local library resources are fully utilized, the local library components are called to replace the Native components of the real Native, and the control instructions input by the user to the application software are executed, so that the technical problem that the application software cannot execute the functions corresponding to the missing components due to the fact that the components of the real Native are not complete is solved, the functions of the real Native application software are greatly enriched, and the user experience is improved.
Further, referring to fig. 2, a second embodiment of the local class library invoking method according to the present invention provides a local class library invoking method, and based on the embodiment shown in fig. 1, before the step S10, the method further includes:
and step S50, packaging the pre-configured local libraries to obtain corresponding local library components, and configuring a local library information table according to the local library components.
In this embodiment, each local library is packaged in advance to obtain corresponding local library components, and each local library component obtained by packaging provides an interface thereof for calling. In addition, the obtained local library component is a component of the real Native layer, and can be matched with other real Native components and used in a nested mode.
The local class library is a class library of a preconfigured local system of the mobile terminal, such as a video class library, a file uploading class library, a camera function class library, a local album function class library, and the like. The local class library includes one or more classes or methods corresponding to the same instruction type, for example, the camera function class library includes a photographing class and a photographing class corresponding to the camera call instruction.
The encapsulated local class library component can expose interfaces of classes or methods available for calling in each local class library for calling.
For the convenience of searching, the class name of the local class library can be used for naming the local class library component obtained by packaging the local class library component, and therefore, the class name of each local class library component is obtained.
Then, configuring a local class library information table according to the class name of each local class library component, and recording each local class library component which can be called currently in the obtained local class library information table, wherein the local class library information table can also be understood as the local class library which can be called currently. Subsequently, the local library component corresponding to each service type can be found according to the configured local library information table.
Furthermore, in order to facilitate the search, the types of the instructions that can be executed corresponding to the local class library components can be configured in the local class library component information table.
Therefore, the configuration of the local class library component and the local class library information table is realized.
In this embodiment, each local library configured in advance is encapsulated to obtain corresponding local library components, and a local library information table is configured according to each local library component. In the embodiment, each local library component is obtained based on the encapsulation of the pre-configured local library, and the existing resources are fully utilized to provide service support for the application software. According to the embodiment, the local library components which can realize the same functions can be selected according to the components which are missing in the real Native, and the local library components are obtained through encapsulation, so that inconvenience caused by missing of the real Native components is made up, and functions of application software are expanded.
Further, referring to fig. 3, a third embodiment of the local class library invoking method according to the present invention provides a local class library invoking method, and based on the embodiment shown in fig. 1 or fig. 2 (this embodiment takes fig. 1 as an example), before step S10, the method further includes:
step S60, configuring corresponding service customization parameters for the service types;
the step S30 includes:
step S31, based on the selected interface of the local library component, sending the service parameter and the service customization parameter to the local library component;
the step S40 includes:
and step S41, controlling the local library component to execute the control instruction according to the service parameters and the service customization parameters.
In this embodiment, according to the service requirement, by configuring the service customization parameter, an expansion function that cannot be realized by the local library component can be configured for different types of services.
Specifically, as an implementation manner, corresponding service customization parameters may be configured for each service type in advance to optimize each service. Different service customization parameters configured by different service types are different; the corresponding service customization parameters can be respectively configured for all the service types according to the service requirements, or the corresponding service customization parameters can be configured only by selecting the required service type, and the corresponding service customization parameters can be flexibly set according to the requirements.
For example, in the video loading service, the local video library can only implement loading of the video, and then the functions of loading the video preview, displaying the video play progress bar, pausing the play of the video, and the like can be implemented by configuring service customization parameters, such as the download address of the video preview, the color and width of the video play progress bar, and the like.
After receiving a control instruction input by a user and acquiring the service type and the service parameters, the mobile terminal selects a local class library component for executing the current type of service according to the local class library information table, and meanwhile, searches whether the corresponding service customization parameters are configured in advance according to the service type.
And if the service customization parameter corresponding to the current service type is successfully found, the service parameter and the found service customization parameter are sent to the selected local library component based on the selected local library component interface.
And then, controlling the local class library component to execute the current control instruction according to the received service parameters and the service customization parameters.
For example, when a user inputs a video loading instruction, the current service type is acquired as a video loading service, and a video downloading address to be loaded is acquired as a service parameter.
And selecting local video class library components which are matched with the video classes and have the same class names from the local class library information table because the classes capable of executing the video loading service are video classes. And searching the service customization parameters corresponding to the video loading service.
And then, sending the service parameters and the service customization parameters obtained by searching to a local video class library component.
After receiving the service parameters and the service customization parameters, the local video library component downloads the corresponding video from the server according to the download address and loads the video; meanwhile, downloading the video preview image according to the customized video preview image downloading address, and displaying the video preview image on a video playing interface when the video is not played, the video playing is paused or the video playing is finished; when the video is played, the video playing bar can be displayed according to the color and the width of the customized video playing bar.
Therefore, service customization is realized on the basis of the local class library, and service functions are enriched.
In this embodiment, corresponding service customization parameters are configured for each service type to expand the functions and effects that can be achieved by each service type; after the local class library component is selected, the service parameter and the service customization parameter corresponding to the current service type are sent to the selected local class library component; the control local library component executes the control instruction according to the service parameters and the service customization parameters, so that the service is expanded on the basis of the service which can be executed by the local library, the service customization parameters can be configured according to needs, the expansion function is customized, and the richness and the individuation of the application software function are improved.
Further, referring to fig. 4, a fourth embodiment of the local class library invoking method according to the present invention provides a local class library invoking method, and based on the embodiments shown in fig. 1, fig. 2, or fig. 3 (this embodiment takes fig. 1 as an example), the step S40 includes:
step S42, selecting a class or method corresponding to the service type from the local class library component, and controlling the selected class or method to execute the control instruction according to the service parameter.
In this embodiment, since the local class library may include multiple classes or methods, the mobile terminal may select and execute a class or method corresponding to the current service according to the current service type.
Specifically, as an implementation manner, in this embodiment, one total service type may be configured to include a plurality of sub-service types. The total service type is the general classification of the current service, and different total service types are greatly different, such as a file uploading service and a camera calling service; the sub-service type is a sub-service which is relatively similar in the same total service type, for example, a camera calls a photographing service and a video recording service in the service.
After the local class library component receives the service parameters, the class or method corresponding to the sub-service type can be selected from the local class library component according to the service type, and then the selected class or method is controlled to execute the control instruction according to the service parameters.
For example, if the current control instruction is a video shooting instruction, the service type is a video shooting instruction in the camera call instruction, and the selected local class library component is a camera function class library component; and selecting a video shooting class according to the sub-service type, and executing the current control instruction.
If the local class library component receives the service parameters and the service customization parameters at the same time, the selected class or the selected method is controlled to execute the current control instruction according to the service parameters and the service customization parameters.
Thereby, execution of the control instructions is achieved.
In this embodiment, the class or method capable of executing the control instruction of this time is corresponding to the class or method capable of executing the control instruction of this time from the local class library component according to the service type, and the selected class or method is controlled to execute the control instruction of this time according to the service parameter, so that direct calling of the class or method corresponding to each service type is realized.
Further, referring to fig. 2, a fifth embodiment of the local class library calling method according to the present invention provides a local class library calling method, based on the second embodiment of the local class library calling method according to the present invention, each local class library includes one or more of a video class library, a file upload class library, a camera function class library, and a local album function class library.
In this embodiment, the local class library available for calling includes one or more of a video class library, a file upload class library, a camera function class library, and a local album function class library.
The video library can be used for loading and playing videos; the file uploading class library is used for calling a local file to be uploaded to a server, for example, a user uploads a self-defined head portrait, a mobile phone album photo and other files; the camera function class library is used for calling a local camera to take a picture, record a video and the like; the local photo album function class library is used for accessing a local photo album, viewing local photos and the like.
In this embodiment, after each local library is packaged to obtain a corresponding local library component, the local library can be called based on each local library component, so that the problems that the read Native application software cannot perform video loading and playing, file uploading, photographing, video recording, local album accessing and the like at present are solved.
Referring to fig. 5, a first embodiment of the local class library invoking device according to the present invention provides a local class library invoking device, including:
and the service module 10 is configured to obtain a service type and a service parameter according to the input control instruction.
According to the method and the device, the operation instruction of the application software is executed by calling the local library, so that the defect that the function of the current React Native (RN for short) technical component is incomplete is overcome, and the application software compiled based on the React Native can provide richer function experience for users. The embodiment takes the fact Native application software deployed in the mobile terminal as an example for explanation.
Specifically, as an implementation manner, first, the service module 10 receives a control instruction input by a user, and obtains a service type and a service parameter.
The service type is the type of a current control instruction, such as a video loading instruction, a picture uploading instruction, a camera calling instruction, a local album viewing instruction and the like; the service parameters record parameter data required for executing the current control instruction, such as a URL address of a video to be loaded, a file path to be uploaded, local hardware to be called, a local file path to be viewed, and the like.
And the selecting module 20 is configured to select the local class library component corresponding to the service type according to a preconfigured local class library information table.
After the service type and the service parameter are obtained, the selecting module 20 selects a local class library component corresponding to the current service type according to the current service type and a pre-configured local class library information table, where the selected local class library component is a local class library capable of executing the current service.
The preset local library information table records each local library component which can be called by the current terminal local system, and the class names can be used for identifying different types of library components.
Specifically, as an implementation manner, the selecting module 20 may obtain a class capable of executing the current service according to the current service type. For example, if the current service type is a camera call instruction, the class capable of executing the current service is a camera call class.
Then, the selecting module 20 searches the matched class name in the local class library information table according to the class capable of executing the current service.
If the class name matched with the class capable of executing the current service is successfully searched, the local class library component corresponding to the searched class name is used as the local class library component corresponding to the current service type.
As another embodiment, the service types that can be executed corresponding to each local class library component may also be preconfigured, so that after the service type of the current service is obtained, the selection module 20 may directly find the corresponding local class library component according to the local class library information table.
Thus, the selecting module 20 obtains the local class library component corresponding to the current service type.
And a sending module 30, configured to send the service parameter to the local class library component based on the selected interface of the local class library component.
After the local library component is selected, the sending module 30 sends the service parameter to the local library component through the interface of the local library component.
And the execution module 40 is configured to control the local class library component to execute the control instruction according to the service parameter.
After the local library component receives the service parameters, the execution module 40 controls the local library component to execute corresponding control instructions according to the service parameters. For example, the local video library downloads the corresponding video from the server according to the video downloading link address in the service parameter, and loads the video to the display interface for the user to watch, so that the problem that the developed application software cannot watch the video due to the fact that no video component exists in the current fact Native is solved.
In this embodiment, the service module is configured to obtain a service type and a service parameter according to an input control instruction; then, the selecting module 20 selects a local library component corresponding to the current service type according to a preconfigured local library information table, so as to call the local library component to execute the current control instruction; then, the sending module 30 sends the service parameters to the local library component based on the selected interface of the local library component, and the executing module 40 controls the local library component to execute the control instruction according to the service parameters, thereby implementing the execution of the control instruction through the local library. According to the embodiment, the existing local library resources are fully utilized, the local library components are called to replace the Native components of the real Native, and the control instructions input by the user to the application software are executed, so that the technical problem that the application software cannot execute the functions corresponding to the missing components due to the fact that the components of the real Native are not complete is solved, the functions of the real Native application software are greatly enriched, and the user experience is improved.
Further, referring to fig. 6, a second embodiment of the local class library invoking device according to the present invention provides a local class library invoking device, and based on the embodiment shown in fig. 5, the local class library invoking device further includes:
and the encapsulating module 50 is configured to encapsulate the pre-configured local libraries to obtain corresponding local library components, and configure a local library information table according to the local library components.
In this embodiment, the encapsulation module 50 encapsulates each local library in advance to obtain corresponding local library components, and each local library component obtained by encapsulation provides an interface thereof for calling. In addition, the obtained local library component is a component of the real Native layer, and can be matched with other real Native components and used in a nested mode.
The local class library is a class library of a preconfigured local system of the mobile terminal, such as a video class library, a file uploading class library, a camera function class library, a local album function class library, and the like. The local class library includes one or more classes or methods corresponding to the same instruction type, for example, the camera function class library includes a photographing class and a photographing class corresponding to the camera call instruction.
The encapsulation module 50 encapsulates the obtained local class library components to expose interfaces of classes or methods available for invocation in each local class library for invocation.
For ease of lookup, the encapsulation module 50 may use the class name of the local class library to name the local class library components it encapsulates, thereby obtaining the class name of each local class library component.
Then, the encapsulation module 50 configures the local class library information table according to the class name of each local class library component, and each local class library component currently available for invocation is recorded in the obtained local class library information table, and can also be understood as a local class library currently available for invocation. Subsequently, the local library component corresponding to each service type can be found according to the configured local library information table.
Furthermore, in order to facilitate the search, the types of the instructions that can be executed corresponding to the local class library components can be configured in the local class library component information table.
Thus, encapsulation module 50 enables the configuration of local class library components and local class library information tables.
In this embodiment, the encapsulation module 50 encapsulates each local library configured in advance to obtain corresponding local library components, and configures the local library information table according to each local library component. In the embodiment, each local library component is obtained based on the encapsulation of the pre-configured local library, and the existing resources are fully utilized to provide service support for the application software. According to the embodiment, the local library components which can realize the same functions can be selected according to the components which are missing in the real Native, and the local library components are obtained through encapsulation, so that inconvenience caused by missing of the real Native components is made up, and functions of application software are expanded.
Further, referring to fig. 7, a third embodiment of the local class library invoking device according to the present invention provides a local class library invoking device, which based on the embodiment shown in fig. 5 or fig. 6 (taking fig. 5 as an example in this embodiment), further includes:
a customizing module 60, configured to configure corresponding service customizing parameters for the service type;
the sending module 30 is further configured to,
based on the selected interface of the local library component, sending the service parameters and the service customization parameters to the local library component;
the execution module 40 is further configured to,
and controlling the local class library component to execute the control instruction according to the service parameters and the service customization parameters.
In this embodiment, according to the service requirement, by configuring the service customization parameter, an expansion function that cannot be realized by the local library component can be configured for different types of services.
Specifically, as an implementation manner, the customizing module 60 may configure corresponding service customizing parameters for each service type in advance to optimize each service. Different service customization parameters configured by different service types are different; the corresponding service customization parameters can be respectively configured for all the service types according to the service requirements, or the corresponding service customization parameters can be configured only by selecting the required service type, and the corresponding service customization parameters can be flexibly set according to the requirements.
For example, in the video loading service, the local video library can only implement loading of the video, and the customizing module 60 may implement the functions of loading the video preview, displaying the video play progress bar, pausing the play of the video, and the like by configuring the service customization parameters, such as the video preview download address, the color and width of the video play progress bar, and the like.
After receiving a control instruction input by a user and acquiring the service type and the service parameters, the sending module 30 selects a local class library component for executing the current type of service according to the local class library information table, and meanwhile, searches whether the corresponding service customization parameters are configured in advance according to the service type.
If the service customization parameter corresponding to the current service type is successfully found, the sending module 30 sends the service parameter and the found service customization parameter to the selected local library component based on the selected local library component interface.
Then, the execution module 40 controls the local class library component to execute the current control instruction according to the received service parameters and service customization parameters.
For example, when the user inputs a video loading instruction, the service module 10 obtains the current service type as a video loading service, and obtains a video download address to be loaded currently as a service parameter.
Since the class capable of executing the video loading service is a video class, the selecting module 20 selects a local video class library component having the same class name and matching with the video class from the local class library information table. The sending module 30 finds out the service customization parameters corresponding to the video loading service.
Then, the sending module 30 sends the service parameters and the service customization parameters obtained by searching to the local video class library component.
After receiving the service parameters and the service customization parameters, the local video library component controls the local video library component to download corresponding videos from the server according to the download address and load the videos; meanwhile, downloading the video preview image according to the customized video preview image downloading address, and displaying the video preview image on a video playing interface when the video is not played, the video playing is paused or the video playing is finished; when the video is played, the video playing bar can be displayed according to the color and the width of the customized video playing bar.
Therefore, service customization is realized on the basis of the local class library, and service functions are enriched.
In this embodiment, the customizing module 60 configures corresponding service customizing parameters for each service type to expand the functions and effects that can be realized by each service type; after selecting the local class library component, the sending module 30 sends the service parameter and the service customization parameter corresponding to the current service type to the selected local class library component; the execution module 40 controls the local library component to execute the control instruction according to the service parameters and the service customization parameters, so that the service is expanded on the basis of the service which can be executed by the local library, the service customization parameters can be configured according to needs, the expansion function is customized, and the richness and the individuation of the application software function are improved.
Further, referring to fig. 5, a fourth embodiment of the local class library invoking device according to the present invention provides a local class library invoking device, based on the above-mentioned embodiments shown in fig. 5, fig. 6 or fig. 7 (in this embodiment, the first embodiment of the local class library invoking device according to the present invention shown in fig. 5 is taken as an example), the executing module 40 is further configured to,
and selecting a class or a method from the local class library component according to the service type, and controlling the selected class or method to execute the control instruction according to the service parameter.
In this embodiment, since the local class library may include a plurality of classes or methods, the execution module 40 may select and execute a class or method corresponding to the current service according to the current service type.
Specifically, as an implementation manner, in this embodiment, one total service type may be configured to include a plurality of sub-service types. The total service type is the general classification of the current service, and different total service types are greatly different, such as a file uploading service and a camera calling service; the sub-service type is a sub-service which is relatively similar in the same total service type, for example, a camera calls a photographing service and a video recording service in the service.
After the local library component receives the service parameters, the execution module 40 may select a class or method corresponding to the sub-service type from the local library component according to the service type, and then control the selected class or method to execute the control instruction according to the service parameters.
For example, if the current control instruction is a video shooting instruction, the service type is a video shooting instruction in the camera call instruction, and the selected local class library component is a camera function class library component; and selecting a video shooting class according to the sub-service type, and executing the current control instruction.
If the local class library component receives the service parameter and the service customization parameter at the same time, the execution module 40 controls the selected class or method to execute the current control instruction according to the service parameter and the service customization parameter.
Thereby, execution of the control instructions is achieved.
In this embodiment, the execution module 40 corresponds a class or a method capable of executing the current control instruction from the local class library component according to the service type, and controls the selected class or method to execute the current control instruction according to the service parameter, thereby implementing direct call of the class or method corresponding to each service type.
Further, referring to fig. 6, a fifth embodiment of the local class library invoking device according to the present invention provides a local class library invoking device, based on the second embodiment of the local class library invoking device according to the present invention shown in fig. 6, each local class library includes one or more of a video class library, a file upload class library, a camera function class library, and a local album function class library.
In this embodiment, the local class library available for calling includes one or more of a video class library, a file upload class library, a camera function class library, and a local album function class library.
The video library can be used for loading and playing videos; the file uploading class library is used for calling a local file to be uploaded to a server, for example, a user uploads a self-defined head portrait, a mobile phone album photo and other files; the camera function class library is used for calling a local camera to take a picture, record a video and the like; the local photo album function class library is used for accessing a local photo album, viewing local photos and the like.
In this embodiment, after each local library is packaged to obtain a corresponding local library component, the local library can be called based on each local library component, so that the problems that the read Native application software cannot perform video loading and playing, file uploading, photographing, video recording, local album accessing and the like at present are solved.
The above description is only an alternative embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A local class library calling method, characterized in that the local class library calling method comprises the following steps:
the ReactNative application software acquires the service type and the service parameters according to the input control instruction;
selecting a local class library component corresponding to the service type according to a preconfigured local class library information table, wherein the local class library component is a technical component of a ReactNative native reaction layer;
based on the selected interface of the local library component, the service parameters are sent to the local library component;
and controlling the local class library component to execute the control instruction according to the service parameters.
2. The method for calling a local class library according to claim 1, wherein the step of obtaining the service type and the service parameter according to the inputted control command is preceded by the steps of:
and packaging the pre-configured local libraries to obtain corresponding local library components, and configuring a local library information table according to the local library components.
3. The local class library invocation method according to claim 1 or 2, wherein said step of obtaining the service type and the service parameters according to the inputted control instruction is preceded by the steps of:
configuring corresponding service customization parameters for the service types;
the step of sending the service parameters to the local class library component based on the selected interface of the local class library component comprises:
based on the selected interface of the local library component, sending the service parameters and the service customization parameters to the local library component;
the step of controlling the local class library component to execute the control instruction according to the service parameter comprises the following steps:
and controlling the local class library component to execute the control instruction according to the service parameters and the service customization parameters.
4. The local class library invocation method according to claim 1 or 2, wherein said step of controlling said local class library component to execute said control instruction according to said service parameter comprises:
and selecting a class or a method from the local class library component according to the service type, and controlling the selected class or method to execute the control instruction according to the service parameter.
5. The local class library calling method according to claim 2, wherein each local class library comprises one or more of a video class library, a file upload class library, a camera function class library, and a local album function class library.
6. A native class library calling apparatus, comprising:
the service module is used for acquiring the service type and the service parameters according to the input control instruction;
the selecting module is used for selecting a local class library component corresponding to the service type according to a preconfigured local class library information table, wherein the local class library component is a technical component of a ReactNative native reaction layer;
the sending module is used for sending the service parameters to the local library component based on the selected interface of the local library component;
and the execution module is used for controlling the local class library component to execute the control instruction according to the service parameters.
7. The native class library invocation means according to claim 6, wherein said native class library invocation means further comprises:
and the packaging module is used for packaging the preset local libraries to obtain corresponding local library components and configuring a local library information table according to the local library components.
8. The local class library invocation means according to claim 6 or 7, wherein said local class library invocation means further comprises:
the customizing module is used for configuring corresponding business customizing parameters for the business types;
the sending module is further configured to,
based on the selected interface of the local library component, sending the service parameters and the service customization parameters to the local library component;
the execution module is further configured to,
and controlling the local class library component to execute the control instruction according to the service parameters and the service customization parameters.
9. The local class library invocation device according to claim 6 or 7, wherein said execution module is further operable to,
and selecting a class or a method from the local class library component according to the service type, and controlling the selected class or method to execute the control instruction according to the service parameter.
10. The local class library invocation device according to claim 7, wherein each local class library comprises one or more of a video class library, a file upload class library, a camera function class library, and a local album function class library.
CN201610575879.1A 2016-07-20 2016-07-20 Local class library calling method and device Active CN107643952B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610575879.1A CN107643952B (en) 2016-07-20 2016-07-20 Local class library calling method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610575879.1A CN107643952B (en) 2016-07-20 2016-07-20 Local class library calling method and device

Publications (2)

Publication Number Publication Date
CN107643952A CN107643952A (en) 2018-01-30
CN107643952B true CN107643952B (en) 2020-03-17

Family

ID=61109664

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610575879.1A Active CN107643952B (en) 2016-07-20 2016-07-20 Local class library calling method and device

Country Status (1)

Country Link
CN (1) CN107643952B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109582303B (en) * 2018-10-31 2024-05-03 平安科技(深圳)有限公司 General component calling method, device, computer equipment and storage medium
CN110475141B (en) * 2019-08-29 2021-12-03 深圳市网心科技有限公司 Video playing method and system based on RN, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101599983A (en) * 2008-06-06 2009-12-09 深圳市同洲电子股份有限公司 A kind of receiving terminal operation method, device and receiving terminal
CN103488508A (en) * 2013-09-18 2014-01-01 贝壳网际(北京)安全技术有限公司 Browser working method, browser and terminal equipment
CN104049986A (en) * 2013-03-14 2014-09-17 腾讯科技(深圳)有限公司 Plugin loading method and device
CN104102537A (en) * 2013-04-07 2014-10-15 华为技术有限公司 Application calling method and user terminal
CN105373396A (en) * 2015-08-14 2016-03-02 腾讯科技(深圳)有限公司 Method and device for updating plug-in in plug-in platform

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101599983A (en) * 2008-06-06 2009-12-09 深圳市同洲电子股份有限公司 A kind of receiving terminal operation method, device and receiving terminal
CN104049986A (en) * 2013-03-14 2014-09-17 腾讯科技(深圳)有限公司 Plugin loading method and device
CN104102537A (en) * 2013-04-07 2014-10-15 华为技术有限公司 Application calling method and user terminal
CN103488508A (en) * 2013-09-18 2014-01-01 贝壳网际(北京)安全技术有限公司 Browser working method, browser and terminal equipment
CN105373396A (en) * 2015-08-14 2016-03-02 腾讯科技(深圳)有限公司 Method and device for updating plug-in in plug-in platform

Also Published As

Publication number Publication date
CN107643952A (en) 2018-01-30

Similar Documents

Publication Publication Date Title
US8526778B2 (en) Apparatus and method for photographing and editing moving image
CN109168028B (en) Video generation method, device, server and storage medium
US11049522B2 (en) Digital media editing
US20220377259A1 (en) Video processing method and apparatus, electronic device, and non-transitory computer readable storage medium
US8880695B2 (en) Information processing apparatus and information processing method
CN102572606B (en) Streaming digital content with flexible remote playback
KR100738541B1 (en) Apparatus and Method for Serving Dynamic Menu for User Interface
KR102280076B1 (en) Video information processing method, computer device, and storage medium
US20070150816A1 (en) User interface authoring utility for changing user interface elements on wireless devices
US9658864B2 (en) Method and device for creation of integrated user interface
US20050102329A1 (en) Backup and restore in mobile applications
US20070150617A1 (en) Resource application program interface utility for changing user interface elements on wireless devices
CN116095222A (en) Incoming call reminding method and terminal
CN107643952B (en) Local class library calling method and device
KR20140119609A (en) Method and device for displaying page for executing application
US10972811B2 (en) Image processing device and image processing method
CN109976758B (en) UI control carousel method based on android system, television terminal and storage medium
US11070659B2 (en) Incoming voice calling method and terminal
CN109151495B (en) A kind of vod server and vod server multimedia file update method, storage medium
JP5416011B2 (en) Content transmitting apparatus, content reproducing apparatus, communication system, content transmitting apparatus control method, control program, and recording medium
US20140317529A1 (en) Display control apparatus and control method thereof
JP7331132B2 (en) Application program installation method, operation method, electronic device, computer readable medium
KR20050072554A (en) Web-based system and method for automatically forming mobile contents program from contents resources
CN107643954B (en) SDK access system and method
CN117354470B (en) Scheduling playing method, system and application of multi-type monitoring video

Legal Events

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