CN112559027A - Method, system, device and readable storage medium for creating and managing functional components - Google Patents

Method, system, device and readable storage medium for creating and managing functional components Download PDF

Info

Publication number
CN112559027A
CN112559027A CN202011538901.8A CN202011538901A CN112559027A CN 112559027 A CN112559027 A CN 112559027A CN 202011538901 A CN202011538901 A CN 202011538901A CN 112559027 A CN112559027 A CN 112559027A
Authority
CN
China
Prior art keywords
function
functional
information
calling
interface
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011538901.8A
Other languages
Chinese (zh)
Inventor
吴其敏
史中月
吴凡
周辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Bank Co Ltd
Original Assignee
Ping An Bank 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 Bank Co Ltd filed Critical Ping An Bank Co Ltd
Priority to CN202011538901.8A priority Critical patent/CN112559027A/en
Publication of CN112559027A publication Critical patent/CN112559027A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention relates to the technical field of research and development management, and provides a method for creating and managing a functional component, which comprises the following steps: acquiring a plurality of functions and function information of each function; normalizing each piece of function information to obtain a plurality of function description files and function IDs corresponding to the function description files; configuring a corresponding function interface for each function based on the function description file to obtain a plurality of function components; and sending the function ID corresponding to each function description file to the client so that the client can call the corresponding function component according to the function ID. The invention unifies the function interfaces of each service function by carrying out standardized processing on the service functions, solves the problem of realizing the compatibility of the service functions across service scenes and improves the efficiency of service development.

Description

Method, system, device and readable storage medium for creating and managing functional components
Technical Field
The embodiment of the invention relates to the technical field of research and development management, in particular to a method, a system, equipment and a readable storage medium for creating and managing a functional component.
Background
Frontend technology is changing day by day, and in recent years, a large number of frontend technology frameworks have appeared, such as the applet by West, ReactNative by FaceBook, weex by Ali, Flutter by google, and so on. These front-end technology frameworks provide a wide variety of choices for front-end personnel in the project development process. However, the front-end technology framework has a problem of multiple technology stacks, for example, in actual service development, if a service function is to be implemented across service scenes, a large amount of compatible work needs to be performed according to different technology stacks. Therefore, how to solve the compatibility problem of realizing the service function across the service scenes so as to improve the service development efficiency becomes a technical problem which needs to be solved urgently at present.
Disclosure of Invention
In view of the above, there is a need to provide a method, a system, a computer device, and a computer readable storage medium for creating and managing functional components, so as to solve the technical problems of compatibility of implementing service functions across service scenarios, and low efficiency of current service development.
In order to achieve the above object, an embodiment of the present invention provides a method for creating and managing a functional component, where the method includes:
acquiring a plurality of functions and function information of each function, wherein each property;
normalizing each piece of function information to obtain a plurality of function description files and function IDs corresponding to the function description files;
configuring a corresponding function interface for each function based on the function description file to obtain a plurality of function components; and
and sending the function ID corresponding to each function description file to the client so that the client can call the corresponding function component according to the function ID.
Illustratively, the step of performing normalization processing on each piece of function information includes:
creating a description file frame for standardizing the function information in advance;
loading the function information into the description file framework, wherein the description file framework is configured with a plurality of configuration items, and each configuration item is used for specifying one parameter of the function information;
acquiring a function ID corresponding to the function information according to the description file corresponding to the function information; and
and configuring a corresponding API (application programming interface) interface for the loaded description file framework to obtain a description file corresponding to the function information.
Illustratively, the configuration items include an interface item for declaring the functional interface;
the step of configuring a corresponding function interface for each function based on the function description file to obtain a plurality of function components includes:
configuring a corresponding interface statement for each functional component in advance;
loading each interface statement into the interface item of the corresponding function description file to obtain the function interface of each function description file; and
and encapsulating each function description file configured with the function interface to obtain the plurality of function components, and storing the plurality of function components into a component data packet.
Illustratively, after the step of sending the function ID corresponding to each function description file to the client, the method further includes a step of calling the function component:
providing one or more light applications;
providing a plurality of host APPs, wherein each host APP is associated with a functional implementation of one or more functional components; and
managing and calling a plurality of functional implementations provided by the plurality of host APPs; each light application calls the function provided by the corresponding host APP through a pre-configured call engine, and the light applications comprise a plurality of applications using the service scenes associated with the function components.
Illustratively, the step of managing and calling a plurality of functional implementations provided by the plurality of host APPs includes:
receiving a calling request of the target light application forwarded by the management and calling module, wherein the calling request carries a corresponding function ID;
acquiring calling information corresponding to the function ID according to the function ID, and sending the calling information to the analysis module;
receiving and analyzing the calling information to obtain parameters in the calling information; and
and sending the parameters in the calling information to the management and calling module so that the management and calling module searches a corresponding target function component provided by the host APP according to the parameters in the calling information and loads the target function component to the target light application.
Illustratively, the step of managing and calling a plurality of functional implementations provided by the plurality of host APPs includes:
receiving a search request, wherein the search request carries search information and a function ID of a target function component;
searching a function interface and a function condition of the target function component according to the searching information and the function ID of the target function component; and
and sending the functional interface and the functional condition to the management and calling module so that the management and calling module searches a target functional component provided by the corresponding host APP according to the functional interface and the functional condition and loads the target functional component to the target light application.
Exemplary, also include: uploading the plurality of functional components and the corresponding plurality of functional IDs into a blockchain.
In order to achieve the above object, an embodiment of the present invention further provides a system for creating and managing a functional component, including:
the system comprises an acquisition module, a processing module and a display module, wherein the acquisition module is used for acquiring a plurality of functions and function information of each function, and each property;
the processing module is used for carrying out standardized processing on each piece of functional information to obtain a plurality of functional description files and functional IDs corresponding to the functional description files;
the configuration module is used for configuring a corresponding function interface for each function based on the function description file so as to obtain a plurality of function components; and
and the sending module is used for sending the function ID corresponding to each function description file to the client so that the client can call the corresponding function component according to the function ID.
In order to achieve the above object, an embodiment of the present invention further provides a computer device, where the computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the computer program, when executed by the processor, implements the steps of the creating and managing method for functional components as described above.
To achieve the above object, an embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, where the computer program is executable by at least one processor, so as to cause the at least one processor to execute the steps of the method for creating and managing a functional component as described above.
According to the method, the system, the computer equipment and the computer readable storage medium for creating and managing the functional components, provided by the embodiment of the invention, the business functions are subjected to standardized processing, the functional interfaces of all the business functions are unified, the problem of compatibility of realizing the business functions across business scenes is solved, the centralized management of the functional components is realized, the integrity and the safety of the business functions are ensured, and the efficiency of business development is improved.
Drawings
Fig. 1 is a flowchart illustrating a method for creating and managing functional components according to an embodiment of the present invention.
FIG. 2 is a schematic diagram of program modules of a second embodiment of a system for creating and managing functional components according to the present invention.
Fig. 3 is a schematic diagram of program modules of a third embodiment of a system for calling functional components according to the present invention.
Fig. 4 is a schematic diagram of a hardware structure of a fourth embodiment of the computer apparatus according to the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the description relating to "first", "second", etc. in the present invention is for descriptive purposes only and is not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In addition, technical solutions between various embodiments may be combined with each other, but must be realized by a person skilled in the art, and when the technical solutions are contradictory or cannot be realized, such a combination should not be considered to exist, and is not within the protection scope of the present invention.
In the following embodiments, the computer device 2 will be exemplarily described as an execution subject.
Example one
Referring to FIG. 1, a flow chart of steps of a method for creating and managing functional elements of an embodiment of the invention is shown. It is to be understood that the flow charts in the embodiments of the present method are not intended to limit the order in which the steps are performed. The following description is made by way of example with the computer device 2 as the execution subject. The details are as follows.
Step 100, acquiring a plurality of functions and function information of each function.
The function (Ability, which is described below) may be a function in an application, and this function may include a basic function, a business function, and the like. For example, in a page scenario, the device information acquisition function, offline function (function that can still access important information of APP without network) of the target device of the computer device 2. The function information (abilityinfo) may include development company of Ability, function type, version model, function name, function description, function scope, function description, and the like.
Step 102, performing normalization processing on each piece of function information to obtain a plurality of function description files and function IDs corresponding to the function description files.
The function description file is a file format, and is used for declaring and standardizing the robustness information of the function corresponding to the robustness, for example, the description file of the robustness is used for declaring and standardizing information such as a development company, a function type, a version model, a function name, a function description, a function scope, a function description, output information, input information, an externally exposed API and the like of the function corresponding to the robustness.
In an exemplary embodiment, the short connection switching method may further include a step S200 to a step S206 of establishing a long connection channel, where: step S200, a description file frame for standardizing the function information is created in advance; step S202, loading the function information into the description file framework, wherein the description file framework is configured with a plurality of configuration items, and each configuration item is used for standardizing one parameter of the function information; step S204, acquiring a function ID corresponding to the function information according to the description file corresponding to the function information; step S206, configuring the corresponding API interface for the loaded description file framework to obtain the description file corresponding to the function information.
Illustratively, the computer device 2 may define a description file frame (availability frame) for specifying the availability information in advance, and load the availability information into the description file frame. The description file framework may preset parameters to be configured and set configuration items for the parameters to be configured, when the Ability information is loaded to the description file framework, the description file framework may determine parameters corresponding to the Ability information according to the configuration items, and after the configuration items configure the corresponding parameters, the description file framework may be configured with a corresponding API interface to obtain a function description file corresponding to the Ability information. Wherein, the function id (abilityid) may be a combination of the first three parameters in the function description file.
For convenience of understanding, this embodiment further provides an example of an Ability function description file, taking the Ability as an example of the function of obtaining the device information id, where the description file is as follows:
Figure BDA0002854351240000061
Figure BDA0002854351240000071
the company is the description of the development company, the category is the description of the function type, the version is the description of the version model, the description is the description of the function specification, the limit is the description of the function use range, and the abilites are the function descriptions. exports is the description of output, imports is the description of input, wherein actions is the API exposed by the availability. Additionally, the function AbilityID may be pifsr.
And step S104, configuring a corresponding function interface for each function based on the function description file to obtain a plurality of function components.
The computer device 2 may declare a corresponding Ability interface in the native of the file description corresponding to each Ability. The native declares the corresponding Ability interface of Ability, for example:
Figure BDA0002854351240000081
wherein, the action needs to store a one-to-one correspondence relationship with the action in the description file corresponding to the abstract interface.
In an exemplary embodiment, the step S104 may further include a step S300 to a step S304, where: the step of configuring a corresponding function interface for each function based on the function description file to obtain a plurality of function components includes: step S300, configuring a corresponding interface statement for each functional component in advance; step S302, loading each interface statement into the interface item of the corresponding function description file to obtain the function interface of each function description file; and step S304, packaging each function description file configured with the function interface to obtain a plurality of function components, and storing the plurality of function components into a component data packet.
For example, the component data package may be JS-SDK (JavaScript-software development Kit), and for convenience of understanding, the present solution further provides the following examples:
(1) for example, the business of banks and securities uses the login scene, if the pages of the banks are put into the securities, the pages of the banks and the securities need to be compatible with the login scene of the securities, and thus, the workload of maintenance and development is increased.
If the login functions of the business of the bank and the securities are defined as login affinity, the two parties can use the same set of protocol and carry out differentiated floating by the framework, so that the purpose of writing once is achieved and the business can run in different App, Android and iOS platforms.
Specifically, taking the Ability as an example of the login function, the interface of the Ability may be defined as:
public void login(String phoneNum,String password,AbilityCallback callback)。
wherein phonNum is the account number required for login, and password is the password required for login. AbilityCallback is a callback for asynchronous requests.
(2) Taking the Ability as an example of the network function, the interface of the Ability may be defined as:
public void request(RequestParam params,AbilityCallback callback)。
here, params is a parameter of the network request, and these parameters may be url address, request mode (GET, POST, etc.), header parameter, body information, and the like. AbilityCallback is a callback for asynchronous requests.
The definition of the Ability is to define a uniform abstract interface and add description information such as directory, name, condition and the like.
Step S106, sending the function ID corresponding to each function description file to the client so that the client can call the corresponding function component according to the function ID.
After the client obtains the function ID, a call request may be generated according to the function ID, and the call request is sent to the computer device 2, so that the function component is called from the JS-SDK (JavaScript-software development Kit) through the computer device 2.
Illustratively, in this embodiment, the computer device 2 defines an abstract SPI for the service function, that is, uniformly registers the service function in the description file framework to define a uniform interface for the service function, thereby solving the problem of compatibility of implementing the service function across service scenes, and performing centralized management on the functional components by the component data packet, thereby ensuring integrity and security of the service function and improving efficiency of service development.
Illustratively, after the step 106, the method further comprises a step of calling the functional component: step S400 to step 404, wherein:
step S400, one or more light applications are provided.
The light application may be an H5 page based application.
Step S402, providing a plurality of host APPs, wherein each host APP is associated with the function realization of one or more functional components.
Illustratively, the computer device 2 may obtain one or more functions from the host APP, and may further define, as a functional component, the one or more functions obtained from the host APP by a predetermined protocol. For example, the login function in the target host APP may be defined as loginabasic, and the network request function may also be defined as networkbasic.
Step S404, managing and calling a plurality of function realizations provided by the plurality of host APPs; each light application calls the function provided by the corresponding host APP through a pre-configured call engine, and the light applications comprise a plurality of applications using the service scenes associated with the function components.
For example, the step S404 may further include: step S500, receiving a call request of the target light application forwarded by the management and call module, wherein the call request carries a corresponding function ID; step S502, obtaining the calling information corresponding to the function ID according to the function ID, and sending the calling information to the analysis module; step S504, receiving and analyzing the calling information to obtain parameters in the calling information; and step S506, sending the parameters in the calling information to the management and calling module so that the management and calling module can search the corresponding target function component provided by the host APP according to the parameters in the calling information and load the target function component to the target light application.
Illustratively, the computer device 2 may receive a call request of a target light application through the management and call module 304, and forward the call request of the target light application to the storage module, where the storage module may be a JS-SDK (JavaScript-software development Kit), and the JS-SDK stores call information of a plurality of degrees, and each call information includes a plurality of parameters.
After the JS-SDK receives the calling request; the JS-SDK can analyze the calling request to obtain a function ID, the calling information corresponding to the function ID is matched according to the function ID, the calling information is sent to the analyzing module, and the analyzing module can be a bridge (analyzing channel) communicated with H5 by Native.
After the bridge receives the calling information, the calling information can be analyzed to obtain parameters (information such as classification, name and condition) of the calling information, and the parameters of the calling information are sent to the management and calling module, so that the management and calling module can search a target function component provided by a corresponding host APP according to the parameters in the calling information and load the target function component to the target light application.
For example, the step S404 may further include: step S600, receiving a search request, wherein the search request carries search information and a function ID of a target function component; in the step of S602, the step of,
searching a function interface and a function condition of the target function component according to the searching information and the function ID of the target function component; and step S604, sending the functional interface and the functional condition to the management and call module, so that the management and call module searches a target functional component provided by the corresponding host APP according to the functional interface and the functional condition, and loads the target functional component to the target light application.
For example, the computer device 2 may directly receive a search request of a light application, so as to obtain a corresponding functional interface and functional condition for searching for a target functional component from the JS-SDK through search information carried in the search request and a functional ID of the target functional component; and sending the functional interface and the functional condition to the management and calling module so that the management and calling module searches a target functional component provided by the corresponding host APP according to the functional interface and the functional condition and loads the target functional component to the target light application.
For example, when a client opens a certain light application, the management and call module (the property call framework) may load a description file of the property according to the description file of the light application, and inject an API of the property into H5, so that when the H5 calls the property, the property call framework may load a specific implementation of the property on the client according to parameters (information such as classification, name, condition, and the like) of the property transmitted from the H5, and complete the call of the entire link. Wherein, when the light application needs to run on the client, the reference of the Abiliity needs to be added to the description file of the light application. And the client sdk must introduce the interface of the relevant Ability and provide the specific implementation according to the interface of Ability.
Illustratively, the method for creating and managing functional components further comprises: uploading the plurality of functional components and the corresponding plurality of functional IDs into a blockchain.
For example, uploading the call result to the blockchain can ensure the security and the fair transparency. The blockchain referred to in this example is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm, and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
Example two
FIG. 2 is a schematic diagram of program modules of a second embodiment of a system for creating and managing functional components according to the present invention. The functional component creation and management system 20 may include or be divided into one or more program modules, which are stored in a storage medium and executed by one or more processors to implement the present invention and implement the above-described functional component creation and management methods. The program module referred to in the embodiments of the present invention refers to a series of computer program instruction segments capable of performing specific functions, and is more suitable than the program itself for describing the execution process of the functional component creating and managing system 20 in the storage medium. The following description will specifically describe the functions of the program modules of the present embodiment:
an obtaining module 200, configured to obtain a plurality of functions and function information of each function, where each property is obtained.
The function (Ability, which is described below) may be a function in an application, and this function may include a basic function, a business function, and the like. For example, in a page scenario, the creation and management system 20 creates a device information acquisition function, an offline function (a function that can still access important information of APP without a network) of the target device. The function information (abilityinfo) may include development company of Ability, function type, version model, function name, function description, function scope, function description, and the like.
The processing module 202 is configured to perform normalization processing on each piece of function information to obtain a plurality of function description files and function IDs corresponding to the function description files.
The function description file is a file format, and is used for declaring and standardizing the robustness information of the function corresponding to the robustness, for example, the description file of the robustness is used for declaring and standardizing information such as a development company, a function type, a version model, a function name, a function description, a function scope, a function description, output information, input information, an externally exposed API and the like of the function corresponding to the robustness.
Illustratively, the processing module 202 is further configured to: creating a description file frame for standardizing the function information in advance; loading the function information into the description file framework, wherein the description file framework is configured with a plurality of configuration items, and each configuration item is used for specifying one parameter of the function information; acquiring a function ID corresponding to the function information according to the description file corresponding to the function information; and configuring a corresponding API interface for the loaded description file framework to obtain the description file corresponding to the function information.
Illustratively, the creating and managing system 20 may define a description file frame (availability frame) for specifying the availability information in advance, and load the availability information into the description file frame. The description file framework may preset parameters to be configured and set configuration items for the parameters to be configured, when the Ability information is loaded to the description file framework, the description file framework may determine parameters corresponding to the Ability information according to the configuration items, and after the configuration items configure the corresponding parameters, the description file framework may be configured with a corresponding API interface to obtain a function description file corresponding to the Ability information. Wherein, the function id (abilityid) may be a combination of the first three parameters in the function description file.
For convenience of understanding, this embodiment further provides an example of an Ability function description file, taking the Ability as an example of the function of obtaining the device information id, where the description file is as follows:
Figure BDA0002854351240000131
Figure BDA0002854351240000141
the company is the description of the development company, the category is the description of the function type, the version is the description of the version model, the description is the description of the function specification, the limit is the description of the function use range, and the abilites are the function descriptions. exports is the description of output, imports is the description of input, wherein actions is the API exposed by the availability. Additionally, the function AbilityID may be pifsr.
The configuration module 204 is configured to configure a corresponding function interface for each function based on the function description file to obtain a plurality of function components.
Creation of functional Components and management System 20 may declare the corresponding Ability interface in the native of the file description for each Ability. The native declares the corresponding Ability interface of Ability, for example:
Figure BDA0002854351240000142
Figure BDA0002854351240000151
wherein, the action needs to store a one-to-one correspondence relationship with the action in the description file corresponding to the abstract interface.
Illustratively, the configuration items include an interface item for declaring the functional interface; the configuration module 204 is further configured to configure a corresponding interface declaration for each functional component in advance; loading each interface statement into the interface item of the corresponding function description file to obtain the function interface of each function description file; and packaging each function description file configured with the function interface to obtain the plurality of function components, and storing the plurality of function components into a component data packet.
For example, the component data package may be JS-SDK (JavaScript-software development Kit), and for convenience of understanding, the present solution further provides the following examples:
(1) for example, the business of banks and securities uses the login scene, if the pages of the banks are put into the securities, the pages of the banks and the securities need to be compatible with the login scene of the securities, and thus, the workload of maintenance and development is increased.
If the login functions of the business of the bank and the securities are defined as login affinity, the two parties can use the same set of protocol and carry out differentiated floating by the framework, so that the purpose of writing once is achieved and the business can run in different App, Android and iOS platforms.
Specifically, taking the Ability as an example of the login function, the interface of the Ability may be defined as:
public void login(String phoneNum,String password,AbilityCallback callback)。
wherein phonNum is the account number required for login, and password is the password required for login. AbilityCallback is a callback for asynchronous requests.
(2) Taking the Ability as an example of the network function, the interface of the Ability may be defined as:
public void request(RequestParam params,AbilityCallback callback)。
here, params is a parameter of the network request, and these parameters may be url address, request mode (GET, POST, etc.), header parameter, body information, and the like. AbilityCallback is a callback for asynchronous requests.
The definition of the Ability is to define a uniform abstract interface and add description information such as directory, name, condition and the like.
A sending module 206, configured to send the function ID corresponding to each function description file to the client, so that the client invokes the corresponding function component according to the function ID.
After the client obtains the function ID, a call request may be generated according to the function ID, and the call request is sent to the creating and managing system 20 of the functional component, so that the functional component is called from the JS-SDK (JavaScript-software development Kit) through the creating and managing system 20 of the functional component.
Illustratively, the creating and managing system 20 of the functional component in this embodiment ensures the integrity and security of the business function by defining an abstract SPI for the business function, i.e., by uniformly registering the business function in the description file framework to define a uniform interface for the business function, and by performing centralized management on the functional component through the component data packet.
Illustratively, the creating and managing system 20 of the functional component further includes an uploading module, and the uploading module is configured to upload the call result to the block chain.
For example, uploading the call result to the blockchain can ensure the security and the fair transparency. The blockchain referred to in this example is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm, and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
EXAMPLE III
Fig. 3 schematically shows a block diagram of a calling system 30 of a functional component according to a third embodiment of the present application, where the calling system 30 of the functional component may be divided into one or more program modules, and the one or more program modules are stored in a storage medium and executed by one or more processors to implement the third embodiment of the present application. The program modules referred to in the embodiments of the present application refer to a series of computer program instruction segments capable of performing specific functions, and the following description will specifically describe the functions of each program module in the embodiments.
As shown in fig. 3, the calling system 30 of the functional component may include a light application module 300, a determination module 302, and an upgrade module 304, wherein:
a light application module 300 for providing one or more light applications.
The light application may be an H5 page based application.
A host APP module 302 for a plurality of host APPs, wherein each host APP is associated with a functional implementation of one or more functional components.
For example, the calling system 30 of the functional component may obtain one or more functions from the host APP, and may further define, as the functional component, the one or more functions obtained from the host APP through a predetermined protocol. For example, the login function in the target host APP may be defined as loginabasic, and the network request function may also be defined as networkbasic.
A management and call module 304, configured to manage and call a plurality of function implementations provided by the plurality of host APPs; each light application calls a function provided by a corresponding host APP through a pre-configured call engine to realize the function, and the light applications comprise a plurality of applications using service scenes associated with functional components; (e.g., H5 off-line package, which resembles the concept of WeChat applet).
In an exemplary embodiment, the invocation engine includes a storage module and a parsing module, wherein:
the storage module is used for receiving a calling request of the target light application forwarded by the management and calling module, and the calling request carries a corresponding function ID; the storage module is further configured to obtain, according to the function ID, call information corresponding to the function ID, and send the call information to the analysis module; the analysis module is used for receiving and analyzing the calling information to obtain parameters in the calling information; and the analysis module is further configured to send the parameters in the calling information to the management and calling module, so that the management and calling module searches for a target function component provided by the corresponding host APP according to the parameters in the calling information, and loads the target function component to the target light application.
For example, the function component invoking system 30 may receive a call request of a target light application through the management and call module 304, and forward the call request of the target light application to the storage module, where the storage module may be a JS-SDK (JavaScript-software development Kit), and the JS-SDK stores a plurality of pieces of invocation information, and each piece of invocation information includes a plurality of parameters.
After the JS-SDK receives the calling request; the JS-SDK can analyze the calling request to obtain a function ID, the calling information corresponding to the function ID is matched according to the function ID, the calling information is sent to the analyzing module, and the analyzing module can be a bridge (analyzing channel) communicated with H5 by Native.
After the bridge receives the calling information, the calling information can be analyzed to obtain parameters (information such as classification, name and condition) of the calling information, and the parameters of the calling information are sent to the management and calling module, so that the management and calling module can search a target function component provided by a corresponding host APP according to the parameters in the calling information and load the target function component to the target light application.
In an exemplary embodiment, the storage module is further configured to: receiving a search request, wherein the search request carries search information and a function ID of a target function component; searching a function interface and a function condition of the target function component according to the searching information and the function ID of the target function component; and sending the functional interface and the functional condition to the management and calling module so that the management and calling module searches a target functional component provided by the corresponding host APP according to the functional interface and the functional condition and loads the target functional component to the target light application.
For example, the function component invoking system 30 may directly receive a search request of a light application, so as to obtain a corresponding function interface and function condition for searching for a target function component from the JS-SDK through search information carried in the search request and a function ID of the target function component; and sending the functional interface and the functional condition to the management and calling module so that the management and calling module searches a target functional component provided by the corresponding host APP according to the functional interface and the functional condition and loads the target functional component to the target light application.
For example, when a client opens a certain light application, the management and call module (the property call framework) may load a description file of the property according to the description file of the light application, and inject an API of the property into H5, so that when the H5 calls the property, the property call framework may load a specific implementation of the property on the client according to parameters (information such as classification, name, condition, and the like) of the property transmitted from the H5, and complete the call of the entire link. Wherein, when the light application needs to run on the client, the reference of the Abiliity needs to be added to the description file of the light application. And the client sdk must introduce the interface of the relevant Ability and provide the specific implementation according to the interface of Ability.
For better understanding, the present embodiment further provides an example of adding an Ability reference to the description file of the light application (i.e., loading the target functional component to the target light application): if the availability needs to be used, the availability only needs to be relied on in the description file of the light application. The method comprises the following specific steps:
Figure BDA0002854351240000191
Figure BDA0002854351240000201
Figure BDA0002854351240000211
the above is a description file of the light application, and the field attributes indicate which properties are required by the light application. When the light application loads, the framework sdk will load the required abilitys according to this dependency.
When a client opens a certain light application, the Ability framework may load the description file of the Ability according to the description file of the light application, for example, the Ability call may be implemented by adding the description file of the Ability to "objects" of the description file of the light application.
Illustratively, when the client calls for Ability, take the H5 page to use the storage function as an example:
the client can call window, activity, storage, setglobaldata ({ "key": 123", function (e)), wherein the calling framework of the client intercepts and switches to window, Kiwi, on action (category, activity, JSON.structure (_ data), JSON.structure (callback), conditions) (wherein Kiwi is the global snoop which is mounted to webview after the front-end container is initialized), and then forwards to the native framework through H5-native Bri, and the native framework forwards the call to the concrete reality class of the activity through the delivered category, Ability, conditions.
Wherein category is the type of activity, activity is the name, action is the api name, conditions are conditions, the same activity can have multiple implementation schemes, and conditions are to determine which implementation party is specifically used).
For example, the client may further configure a screening module for the Ability to screen the Ability according to a condition, so that flexibility of calling the Ability is increased. In addition, the host APP may also encrypt Ability. For example, a company defines a uniform encryption Ability, but the encryption process of each company may not be consistent, so that each company can provide its own implementation according to its own features, and H5 dynamically selects the encryption property.
Illustratively, the embodiment guarantees the integrity and the standard of the function of the Ability by registering the Ability in the Ability management framework. The information about the Abiliity is uniformly managed through JS-sdk, and the centralized management and control capability of the Abiliity is improved.
Example four
Fig. 4 is a schematic diagram of a hardware architecture of a computer device according to a fourth embodiment of the present invention. In the present embodiment, the computer device 2 is a device capable of automatically performing numerical calculation and/or information processing in accordance with a preset or stored instruction. The computer device 2 may be a rack server, a blade server, a tower server or a rack server (including an independent server or a server cluster composed of a plurality of servers), and the like. As shown, the computer device 2 includes, but is not limited to, at least a memory 21, a processor 22, a network interface 23, and a functional component creation and management system 20 communicatively coupled to each other via a system bus.
In this embodiment, the memory 21 includes at least one type of computer-readable storage medium including a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, and the like. In some embodiments, the storage 21 may be an internal storage unit of the computer device 2, such as a hard disk or a memory of the computer device 2. In other embodiments, the memory 21 may also be an external storage device of the computer device 2, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like provided on the computer device 2. Of course, the memory 21 may also comprise both internal and external memory units of the computer device 2. In this embodiment, the memory 21 is generally used for storing an operating system and various application software installed in the computer device 2, such as program codes of the creating and managing system 20 of the functional components of the second embodiment. Further, the memory 21 may also be used to temporarily store various types of data that have been output or are to be output.
Processor 22 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip in some embodiments. The processor 22 is typically used to control the overall operation of the computer device 2. In this embodiment, the processor 22 is configured to execute the program codes stored in the memory 21 or process data, for example, execute the creating and managing system 20 of functional components, so as to implement the creating and managing method of functional components according to the first embodiment.
The network interface 23 may comprise a wireless network interface or a wired network interface, and the network interface 23 is generally used for establishing communication connection between the computer device 2 and other electronic apparatuses. For example, the network interface 23 is used to connect the computer device 2 to an external terminal through a network, establish a data transmission channel and a communication connection between the computer device 2 and the external terminal, and the like. The network may be a wireless or wired network such as an Intranet (Intranet), the Internet (Internet), a Global System of Mobile communication i/On (GSM), a Wideband Code Division Multiple Access (WCDMA), a 4G network, a 5G network, Bluetooth (Bluetooth), Wi-Fi, and the like.
It is noted that fig. 3 only shows the computer device 2 with components 20-23, but it is to be understood that not all shown components are required to be implemented, and that more or less components may be implemented instead.
In this embodiment, the creation and management system 20 of the functional components stored in the memory 21 may also be divided into one or more program modules, which are stored in the memory 21 and executed by one or more processors (in this embodiment, the processor 22) to complete the present invention.
For example, fig. 2 is a schematic diagram of program modules of the creating and managing system 20 for implementing functional components according to the second embodiment of the present invention, in this embodiment, the creating and managing system 20 for implementing functional components may be divided into a generating module 200, a determining module 202, a switching module 204, and a sending module 206. The program module referred to herein is a series of computer program instruction segments capable of performing a specific function, and is more suitable than a program for describing the execution process of the functional component creation and management system 20 in the computer device 2. The specific functions of the program modules 200 and 206 have been described in detail in the second embodiment, and are not described herein again.
EXAMPLE five
The present embodiment also provides a computer-readable storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, a server, an App application mall, etc., on which a computer program is stored, which when executed by a processor implements corresponding functions. The computer-readable storage medium of the embodiment is used for the system 20 for creating and managing functional components, and when executed by the processor, the method for creating and managing functional components of the first embodiment is implemented.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner.
The above description is only a preferred 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 method for creating and managing functional components, the method comprising:
acquiring a plurality of functions and function information of each function;
normalizing each piece of function information to obtain a plurality of function description files and function IDs corresponding to the function description files;
configuring a corresponding function interface for each function based on the function description file to obtain a plurality of function components; and
and sending the function ID corresponding to each function description file to the client so that the client can call the corresponding function component according to the function ID.
2. The functional component creation and management method according to claim 1, wherein the step of performing normalization processing on each functional information includes:
creating a description file frame for standardizing the function information in advance;
loading the function information into the description file framework, wherein the description file framework is configured with a plurality of configuration items, and each configuration item is used for specifying one parameter of the function information;
acquiring a function ID corresponding to the function information according to the description file corresponding to the function information; and
and configuring a corresponding API (application programming interface) interface for the loaded description file framework to obtain a description file corresponding to the function information.
3. The functional component creating and managing method according to claim 2, wherein the configuration item includes an interface item for declaring the functional interface;
the step of configuring a corresponding function interface for each function based on the function description file to obtain a plurality of function components includes:
configuring a corresponding interface statement for each functional component in advance;
loading each interface statement into the interface item of the corresponding function description file to obtain the function interface of each function description file; and
and encapsulating each function description file configured with the function interface to obtain the plurality of function components, and storing the plurality of function components into a component data packet.
4. The method for creating and managing a functional component according to claim 1, wherein after the step of sending the function ID corresponding to each function description file to the client, the method further comprises a step of calling the functional component:
providing one or more light applications;
providing a plurality of host APPs, wherein each host APP is associated with a functional implementation of one or more functional components; and
managing and calling a plurality of functional implementations provided by the plurality of host APPs; each light application calls the function provided by the corresponding host APP through a pre-configured call engine, and the light applications comprise a plurality of applications using the service scenes associated with the function components.
5. The method for creating and managing functional components according to claim 4, wherein said step of managing and calling a plurality of functional implementations provided by said plurality of host APPs comprises:
receiving a calling request of the target light application forwarded by the management and calling module, wherein the calling request carries a corresponding function ID;
acquiring calling information corresponding to the function ID according to the function ID, and sending the calling information to the analysis module;
receiving and analyzing the calling information to obtain parameters in the calling information; and
and sending the parameters in the calling information to the management and calling module so that the management and calling module searches a corresponding target function component provided by the host APP according to the parameters in the calling information and loads the target function component to the target light application.
6. The method for creating and managing functional components according to claim 4, wherein said step of managing and calling a plurality of functional implementations provided by said plurality of host APPs comprises:
receiving a search request, wherein the search request carries search information and a function ID of a target function component;
searching a function interface and a function condition of the target function component according to the searching information and the function ID of the target function component; and
and sending the functional interface and the functional condition to the management and calling module so that the management and calling module searches a target functional component provided by the corresponding host APP according to the functional interface and the functional condition and loads the target functional component to the target light application.
7. The method for creating and managing functional components according to claim 1, further comprising: uploading the plurality of functional components and the corresponding plurality of functional IDs into a blockchain.
8. A functional component creation and management system, comprising:
the system comprises an acquisition module, a processing module and a display module, wherein the acquisition module is used for acquiring a plurality of functions and function information of each function, and each property;
the processing module is used for carrying out standardized processing on each piece of functional information to obtain a plurality of functional description files and functional IDs corresponding to the functional description files;
the configuration module is used for configuring a corresponding function interface for each function based on the function description file so as to obtain a plurality of function components; and
and the sending module is used for sending the function ID corresponding to each function description file to the client so that the client can call the corresponding function component according to the function ID.
9. A computer arrangement comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the computer program, when executed by the processor, carries out the steps of the method for creation and management of a functional assembly according to any of claims 1 to 7.
10. A computer-readable storage medium, in which a computer program is stored which is executable by at least one processor for causing the at least one processor to carry out the steps of the method for creation and management of functional components according to any of claims 1 to 7.
CN202011538901.8A 2020-12-23 2020-12-23 Method, system, device and readable storage medium for creating and managing functional components Pending CN112559027A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011538901.8A CN112559027A (en) 2020-12-23 2020-12-23 Method, system, device and readable storage medium for creating and managing functional components

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011538901.8A CN112559027A (en) 2020-12-23 2020-12-23 Method, system, device and readable storage medium for creating and managing functional components

Publications (1)

Publication Number Publication Date
CN112559027A true CN112559027A (en) 2021-03-26

Family

ID=75032246

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011538901.8A Pending CN112559027A (en) 2020-12-23 2020-12-23 Method, system, device and readable storage medium for creating and managing functional components

Country Status (1)

Country Link
CN (1) CN112559027A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113572816A (en) * 2021-06-28 2021-10-29 青岛海尔科技有限公司 Equipment control processing method, device, storage medium and electronic device
CN114531432A (en) * 2022-02-14 2022-05-24 浙江吉利控股集团有限公司 Cross-platform based service communication method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1866204A (en) * 2006-01-17 2006-11-22 华为技术有限公司 Software assembly architecture
CN106408793A (en) * 2016-10-11 2017-02-15 深圳市紫金支点技术股份有限公司 Service-component sharing method and system applicable to ATM (Automatic Teller Machine) services
CN108073424A (en) * 2016-11-17 2018-05-25 深圳万兴信息科技股份有限公司 The call method and device of component interface
CN109471693A (en) * 2018-10-26 2019-03-15 沈阳欧瑞科技有限公司 Proprietary component is mapped to method, medium and the equipment of Cross-border congestion management system
CN110297658A (en) * 2018-03-21 2019-10-01 腾讯科技(深圳)有限公司 Functional unit sharing method, device and computer equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1866204A (en) * 2006-01-17 2006-11-22 华为技术有限公司 Software assembly architecture
CN106408793A (en) * 2016-10-11 2017-02-15 深圳市紫金支点技术股份有限公司 Service-component sharing method and system applicable to ATM (Automatic Teller Machine) services
CN108073424A (en) * 2016-11-17 2018-05-25 深圳万兴信息科技股份有限公司 The call method and device of component interface
CN110297658A (en) * 2018-03-21 2019-10-01 腾讯科技(深圳)有限公司 Functional unit sharing method, device and computer equipment
CN109471693A (en) * 2018-10-26 2019-03-15 沈阳欧瑞科技有限公司 Proprietary component is mapped to method, medium and the equipment of Cross-border congestion management system

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113572816A (en) * 2021-06-28 2021-10-29 青岛海尔科技有限公司 Equipment control processing method, device, storage medium and electronic device
CN113572816B (en) * 2021-06-28 2023-10-24 青岛海尔科技有限公司 Equipment control processing method and device, storage medium and electronic device
CN114531432A (en) * 2022-02-14 2022-05-24 浙江吉利控股集团有限公司 Cross-platform based service communication method and device

Similar Documents

Publication Publication Date Title
CN108346028B (en) Business approval processing method, device and system
CN111130841B (en) Block chain network deployment method, electronic device and computer-readable storage medium
US10013245B2 (en) Systems and methods for converting typed code
CN111722947A (en) Service calling method and system
CN111683066B (en) Heterogeneous system integration method, heterogeneous system integration device, computer equipment and storage medium
CN111400061A (en) Data processing method and system
CN112039900B (en) Network security risk detection method, system, computer device and storage medium
CN111858727B (en) Multi-data source data export system and method based on template configuration
CN112559027A (en) Method, system, device and readable storage medium for creating and managing functional components
CN112631924A (en) Automatic testing method and device, computer equipment and storage medium
CN111858376A (en) Request message generation method and interface test method
CN111831365A (en) Interface route forwarding method, system, computer equipment and readable storage medium
CN112422450B (en) Computer equipment, and flow control method and device for service request
CN112860662A (en) Data blood relationship establishing method and device, computer equipment and storage medium
CN107273226B (en) Method and device for integrating components in android system and calling integrated components
CN114020689A (en) Data processing method, data processing device, electronic device, and storage medium
CN111984236B (en) Component standardization management method and device, computer equipment and readable storage medium
CN113572763A (en) Data processing method and device, electronic equipment and storage medium
CN116610354A (en) Parameter verification method, device, computer equipment and storage medium
CN116112457A (en) Method, device, computer equipment and storage medium for notifying message
WO2022116587A1 (en) Web end data signature method and apparatus, and computer device
CN113434217B (en) Vulnerability scanning method, vulnerability scanning device, computer equipment and medium
CN113626222A (en) Message processing method and device, computer equipment and storage medium
CN113296785A (en) Document generation method, system, device and readable storage medium
CN114637672A (en) Automatic data testing method and device, computer equipment and storage medium

Legal Events

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