CN111625373A - Function access method and device, electronic equipment and storage medium - Google Patents

Function access method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN111625373A
CN111625373A CN202010354730.7A CN202010354730A CN111625373A CN 111625373 A CN111625373 A CN 111625373A CN 202010354730 A CN202010354730 A CN 202010354730A CN 111625373 A CN111625373 A CN 111625373A
Authority
CN
China
Prior art keywords
sub
function module
link address
function
wrapper
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
CN202010354730.7A
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.)
OneConnect Smart Technology Co Ltd
OneConnect Financial Technology Co Ltd Shanghai
Original Assignee
OneConnect Financial Technology Co Ltd Shanghai
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 OneConnect Financial Technology Co Ltd Shanghai filed Critical OneConnect Financial Technology Co Ltd Shanghai
Priority to CN202010354730.7A priority Critical patent/CN111625373A/en
Publication of CN111625373A publication Critical patent/CN111625373A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload

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)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the application provides a function access method, a function access device, electronic equipment and a storage medium, wherein the method comprises the following steps: packaging each sub-function module in a plurality of sub-function modules included in a target system to obtain a wrapper corresponding to each sub-function module; acquiring first link address information of a wrapper corresponding to a first sub-function module in the plurality of sub-function modules; the first sub-function module is any one of the plurality of sub-function modules or a designated function module of the plurality of sub-function modules; and generating a link address format corresponding to the first sub-function module according to the first link address information by the wrapper corresponding to the first sub-function module. By the aid of the method and the device, development efficiency can be improved. In addition, the application also relates to a block chain technology, and the first link address information can be stored in the block chain.

Description

Function access method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for accessing a function, an electronic device, and a storage medium.
Background
With the development of internet technology, various internet products are coming up endlessly. Existing internet products, such as internet financial products, are scaled up, and sometimes a business party may wish to use some or a single function of the internet product, in addition to the overall project output. However, such modular business needs are often unpredictable, and therefore project personnel cannot plan for such needs in advance during the early stages of project development. When some or a certain function of the internet product needs to be used, re-establishment development must be performed for the function, and although the code can be reused, the re-establishment development reduces the development efficiency.
Disclosure of Invention
The embodiment of the application provides a function access method, a function access device, electronic equipment and a storage medium, which can be used for packaging a function module to realize multiplexing of the function module, so that the development efficiency is improved.
In a first aspect, an embodiment of the present application provides a function access method, including:
packaging each sub-function module in a plurality of sub-function modules included in a target system to obtain a wrapper corresponding to each sub-function module;
acquiring first link address information of a wrapper corresponding to a first sub-function module in the plurality of sub-function modules; the first sub-function module is any one of the plurality of sub-function modules or a designated function module of the plurality of sub-function modules;
and generating a link address format corresponding to the first sub-function module according to the first link address information through the wrapper corresponding to the first sub-function module, so that other equipment can access the first sub-function module according to the link address format corresponding to the first sub-function module.
Optionally, the obtaining the first link address information of the wrapper corresponding to the first sub-function module in the plurality of sub-function modules includes:
scanning a specified configuration file; the specified configuration file indicates at least one sub-function module which can be accessed;
reading first link address information of a wrapper corresponding to the first sub-function module included in the specified configuration file;
the first link address information includes an identifier of the wrapper corresponding to the first sub-function module and an input parameter of the wrapper corresponding to the first sub-function module.
Optionally, after the generating, by the wrapper corresponding to the first sub-function module, the link address format corresponding to the first sub-function module according to the first link address information, the method further includes:
receiving an access request sent by the other equipment to the first sub-function module;
when the access request carries a target link address which accords with a link address format corresponding to the first sub-function module, acquiring data indicated by the target link address;
and sending the data indicated by the target link address to the other equipment.
Optionally, when the access request carries a target link address conforming to the first link address format, acquiring data indicated by the target link address, including:
when the access request carries a target link address which accords with the first link address format, inquiring an encapsulator corresponding to a first sub-function module according to an identifier, included in the target link address, of the encapsulator corresponding to the first sub-function module;
calling a wrapper corresponding to the first sub-function module to verify the security parameters included in the target link address;
and when the security parameter included in the target link address passes the verification, acquiring data indicated by the input parameter included in the target link address through a wrapper corresponding to the first sub-function module.
Optionally, before the receiving the access request to the first sub-function module sent by the other device, the method further includes:
receiving a security parameter acquisition request which is sent by the other equipment and aims at the encapsulator corresponding to the first sub-function module, wherein the security parameter acquisition request carries a security key;
verifying the security key;
when the security key passes the verification, generating security parameters of the wrapper corresponding to the first sub-function module;
and sending the security parameters of the encapsulator corresponding to the first sub-function module to the other equipment.
Optionally, the encapsulating each sub-function module in the plurality of sub-function modules included in the target system to obtain an encapsulator corresponding to each sub-function module includes:
adding a corresponding self-defined component for a code corresponding to each sub-function module in a plurality of sub-function modules included in the target system;
and packaging the code corresponding to each sub-function module and the corresponding custom assembly to obtain a wrapper corresponding to each sub-function module.
Optionally, the method further comprises:
acquiring second link address information of the wrapper corresponding to the second sub-function module; the second sub-function module is a sub-function module associated with the first sub-function module;
and generating a link address format corresponding to the second sub-function module according to the second link address information by using the wrapper corresponding to the second sub-function module, so that the other equipment or the first sub-function module can access the second sub-function module according to the link address format of the second sub-function module.
In a second aspect, an embodiment of the present application provides a function access apparatus, including:
the processing module is used for encapsulating each sub-function module in a plurality of sub-function modules included in the target system to obtain an encapsulator corresponding to each sub-function module;
the obtaining module is used for obtaining first link address information of the wrapper corresponding to a first sub-function module in the plurality of sub-function modules; the first sub-function module is any one of the plurality of sub-function modules or a designated function module of the plurality of sub-function modules;
the processing module is further configured to generate, by the wrapper corresponding to the first sub-function module, a link address format corresponding to the first sub-function module according to the first link address information, so that other devices access the first sub-function module according to the link address format corresponding to the first sub-function module.
In a third aspect, an embodiment of the present application provides an electronic device, including a processor and a memory, where the processor and the memory are connected to each other, where the memory is used to store a computer program, and the computer program includes program instructions, and the processor is configured to call the program instructions to execute the method according to the first aspect.
In a fourth aspect, the present application provides a computer-readable storage medium, which stores a computer program, where the computer program is executed by a processor to implement the method according to the first aspect.
In summary, the electronic device may encapsulate each sub-function module in the plurality of sub-function modules included in the target system to obtain the encapsulator corresponding to each sub-function module, and obtain the first link address information of the encapsulator corresponding to the first sub-function module in the plurality of sub-function modules, so that the encapsulator corresponding to the first sub-function module generates the link address format corresponding to the first sub-function module according to the first link address information, so that other devices access the first sub-function module according to the link address format corresponding to the first sub-function module.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1A is a schematic flowchart of a function access method provided in an embodiment of the present application;
FIG. 1B is a diagram illustrating a process for generating a link address format according to an embodiment of the present disclosure;
fig. 2 is a schematic flowchart of another function access method provided in an embodiment of the present application;
fig. 3 is a schematic architecture diagram of a function access system provided in an embodiment of the present application;
fig. 4 is a schematic structural diagram of a function access device provided in an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
Please refer to fig. 1A, which is a flowchart illustrating a function accessing method according to an embodiment of the present disclosure. The method can be applied to an electronic device, which can be a terminal or a server, the terminal includes but is not limited to a notebook computer, a desktop computer and other intelligent terminals, and the server includes but is not limited to a server or a server cluster. Specifically, the method may comprise the steps of:
s101, packaging each sub-function module in a plurality of sub-function modules included in a target system to obtain a packaging device corresponding to each sub-function module.
The target system may be any system or a designated system. In one embodiment, the target system may refer to a target item, such as a system corresponding to any network web item or a system corresponding to a specified web item. The system includes, but is not limited to, a business system, a software system or an application system, and the embodiments of the present application are not limited thereto. The sub-function module may be formed by a set of codes corresponding to the sub-functions. In one embodiment, the code may refer to program code. The sub-function may be a function corresponding to the target system. In one embodiment, the sub-function module mentioned in the embodiments of the present application may refer to an atomic function module that cannot be decomposed any more.
In an embodiment, the process of the electronic device performing encapsulation processing on each of a plurality of sub-function modules included in the target system to obtain the encapsulator corresponding to each sub-function module may be a process of the electronic device performing encapsulation processing on each of a plurality of sub-function modules included in the target system to obtain the encapsulator corresponding to each sub-function module. By adopting the process, the process of packaging the sub-functional module into the packaging device is effectively realized, so that the use of the sub-functional module is more flexible and convenient. In theory, the output can be made modular for use by an external user as long as the wrapper encapsulates functionality.
In an embodiment, the process of the electronic device performing encapsulation processing on each of a plurality of sub-function modules included in the target system to obtain the encapsulator corresponding to each sub-function module may be to add a corresponding custom component to a code corresponding to each sub-function module included in the target system for the electronic device, and perform encapsulation processing on the code corresponding to each sub-function module and the corresponding custom component to obtain the encapsulator corresponding to each sub-function module. In one embodiment, the code corresponding to the sub-function module may refer to the program code corresponding to the sub-function module. The custom component may refer to a control, such as an interface, that enables the wrapper to be accessed, which provides standardized inputs and outputs to the corresponding sub-functionality module. By adopting the process, the process of packaging the sub-function module into the packaging device is effectively realized.
In one embodiment, the electronic device may acquire the plurality of sub-function modules included in the target system by: the electronic equipment acquires the configuration file of the target system and reads a plurality of sub-function modules included in the target system from the configuration file.
In an embodiment, when detecting that the target system runs, the electronic device may execute the step of performing, in step S101, encapsulation processing on each sub-function module in the plurality of sub-function modules included in the target system to obtain an encapsulator corresponding to each sub-function module.
S102, obtaining first link address information of the wrapper corresponding to a first sub-function module in the plurality of sub-function modules.
The first sub-function module may be any one of the plurality of sub-function modules or may also be a designated sub-function module of the plurality of sub-function modules. The first link address information may refer to link address information corresponding to the first sub-function module. In one embodiment, the first link address information may include an identifier of a wrapper corresponding to the first sub-function module, where the identifier is information for uniquely identifying the wrapper. In one embodiment, the first link address information may further include an input parameter of a wrapper corresponding to the first sub-function module. The input parameter here may be an input parameter name. In one embodiment, the input parameter may be a traffic parameter.
In an embodiment, the manner that the electronic device obtains the first link address information of the wrapper corresponding to the first sub-function module in the plurality of sub-function modules is that the electronic device scans a specified configuration file, and reads the first link address information of the wrapper corresponding to the first sub-function module included in the specified configuration file. Wherein the specified configuration file indicates at least one sub-function module that can be accessed. The specified configuration file includes link address information of each of the at least one sub-function module. In an embodiment, the format of the configuration file may be a json format or the like, which is not limited in the embodiment of the present application. The first link address information may include an identifier of the wrapper corresponding to the first sub-function module and an input parameter of the wrapper corresponding to the first sub-function module. By adopting the process, the link address format of the corresponding sub-function module can be automatically generated as long as the project development is completed and the appointed configuration file informs which encapsulators can be output externally without re-establishing items or performing redundant development. Compared with the prior art that the independent sub-function output from the function requires re-establishment and development to realize the function external output process, the embodiment of the application can conveniently perform external output management on each wrapper, thereby effectively saving the development cost.
In one embodiment, the electronic device includes, but is not limited to, obtaining the specified configuration file from a local or first database, and the embodiments of the present application are not limited thereto.
S103, generating a link address format corresponding to the first sub-function module according to the first link address information through the wrapper corresponding to the first sub-function module, so that other equipment can access the first sub-function module according to the link address format corresponding to the first sub-function module.
In the embodiment of the invention, the sub-function module is packaged to generate the link address format corresponding to the sub-function module, so that other equipment can conveniently access the sub-function module based on the link address format, the development efficiency can be improved, the unified maintenance of functions can be facilitated, and the sub-function module is part of the whole project, so that the whole project is optimized, namely the modularized output function is optimized, the separate maintenance is not needed, and the maintenance cost can be saved.
Referring to fig. 1B, the electronic device may call the encapsulator corresponding to the sub-function module to generate a format of a Uniform Resource Locator (URL) corresponding to the sub-function module according to the input parameter included in the link address information, where the format of the URL is a link address format. The URL may also be written as a URL. That is, in this embodiment of the application, the electronic device may call the wrapper corresponding to the first sub-function module to generate the link address format corresponding to the first sub-function module according to the first link address information, for example, the input parameter included in the first link address information.
The format of the link address corresponding to the first sub-function module may refer to a format of a link address for other devices to access the first sub-function module. That is, when other devices need to access the first sub-function module, they need to carry the link address conforming to the first link address format.
In one embodiment, the first field of the link address format may be a field where the identifier of the encapsulator is located, and the second field may be a field where the input parameter is located.
In one embodiment, the first field of the link address format may be a field in which an identifier of the encapsulator is located, the second field may be a field in which a security parameter is located, and the third field may be a field in which an input parameter is located. The security parameter may be authority indication information.
For example, the link address format may be "/{ module id }/{ ssotick }/{ input parameter 1}/{ input parameter 2}/…". Wherein the moduleId refers to the identity of the wrapper. I.e. the first field of the link address format is the field where the module id is located. ssotick refers to a security parameter. I.e., the second field of the link format is the field where ssotick is located. Input parameter 1 and input parameter 2 are input parameters. I.e. the fields following this second field, e.g. the third field, are the fields where the input parameters are located.
In one embodiment, the electronic device may further output a usage guide to the outside, and the usage guide may include a link address format corresponding to the first sub-function module. In one embodiment, the usage guide may further include usage description information of a link address format corresponding to the first sub-function module.
As can be seen, in the embodiment shown in fig. 1A, the electronic device may perform encapsulation processing on each sub-function module in the multiple sub-function modules included in the target system to obtain an encapsulator corresponding to each sub-function module, and obtain first link address information of the encapsulator corresponding to a first sub-function module in the multiple sub-function modules, so that a link address format corresponding to the first sub-function module is generated according to the first link address information by the encapsulator corresponding to the first sub-function module, so that other devices access the first sub-function module according to the link address format corresponding to the first sub-function module, and development efficiency is improved.
Please refer to fig. 2, which is a flowchart illustrating another function accessing method according to an embodiment of the present application. The method can be applied to an electronic device, which can be a terminal or a server, the terminal includes but is not limited to a notebook computer, a desktop computer and other intelligent terminals, and the server includes but is not limited to a server or a server cluster. Specifically, the method may comprise the steps of:
s201, packaging each sub-function module in a plurality of sub-function modules included in the target system to obtain a packaging device corresponding to each sub-function module.
S202, obtaining first link address information of the wrapper corresponding to a first sub-function module in the plurality of sub-function modules.
S203, generating a link address format corresponding to the first sub-function module according to the first link address information through the wrapper corresponding to the first sub-function module, so that other equipment can access the first sub-function module according to the link address format corresponding to the first sub-function module.
Steps S201 to S203 shown in the embodiment of fig. 2 can refer to steps S101 to S103 shown in the embodiment of fig. 1A, which is not described herein again in this embodiment of the present application.
S204, receiving an access request to the first sub-function module sent by the other equipment.
S205, when the access request carries a target link address which accords with the link address format corresponding to the first sub-function module, acquiring data indicated by the target link address.
S206, sending the data indicated by the target link address to the other equipment.
In steps S204-S206, the electronic device may receive an access request sent by another device for the first sub-function module, and when the access request carries a target link address conforming to a link address format corresponding to the first sub-function module, obtain data indicated by the target link address, so as to send the data indicated by the target link address to the other device. The target link address may refer to a link address conforming to a link address format corresponding to the first sub-function module. The data indicated by the target link address may be, for example, code data or page data, and the application is not limited in implementation.
It is emphasized that, to further ensure the privacy and security of the first link address information, the first link address information may also be stored in a node of a block chain.
In an embodiment, when the access request carries a target link address conforming to the first link address format, the process of the electronic device acquiring the data indicated by the target link address may be that when the access request carries a target link address conforming to the first link address format, the electronic device queries an encapsulator corresponding to a first sub-function module according to an identifier of the encapsulator corresponding to the first sub-function module included in the target link address, and acquires the data indicated by the input parameter included in the target link address through the encapsulator corresponding to the first sub-function module. The input parameter herein may refer to an input parameter value. By adopting the process, the electronic equipment can search corresponding data according to the target link address, thereby effectively realizing the data access process.
In an embodiment, in order to further ensure the security of the data access process, when the access request carries a target link address conforming to the first link address format, the process of acquiring, by the electronic device, the data indicated by the target link address may be that, when the access request carries a target link address conforming to the first link address format, the electronic device queries, according to an identifier of an encapsulator corresponding to a first sub-function module included in the target link address, the encapsulator corresponding to the first sub-function module, and invokes the encapsulator corresponding to the first sub-function module to verify a security parameter included in the target link address; when the security parameter included in the target link address passes the verification, the electronic device obtains the data indicated by the input parameter included in the target link address through the wrapper corresponding to the first sub-function module.
In an embodiment, the electronic device calls the wrapper corresponding to the first sub-function module to verify the security parameter included in the target link address, which may be as follows: the electronic equipment verifies whether the security parameters included in the target link address have the authority of using the function corresponding to the first sub-function module; and when the security parameters included in the target link address have the right of using the corresponding functions of the first sub-function module, determining that the security parameters included in the target link address pass the verification.
In one embodiment, the electronic device verifying whether the security parameter included in the target link address has the right to use the function corresponding to the first sub-function module may include at least one of: the electronic equipment queries whether a local or second database has the security parameters included in the target link address; the electronic equipment judges whether the security parameters included in the target link address are expired; the electronic equipment verifies the identification information of other equipment and/or the identity information of an external user corresponding to the other equipment. The second database may be the same or different from the first database. The process of verifying the authority may also be implemented in other ways, and embodiments of the present application are not listed here.
In an embodiment, the process of the electronic device determining whether the security parameter included in the target connection address is expired may be that the electronic device determines whether the security parameter included in the target connection address is expired according to the aging information of the security parameter included in the target connection address; when the security parameter included in the target link address is determined to be not expired, the electronic device determines that the security parameter included in the target link address has the authority to use the function corresponding to the first sub-function module, or when the security parameter included in the target link address is determined to exist in the local or second database and the security parameter included in the target link address is not expired, the electronic device determines that the security parameter included in the target link address has the authority to use the function corresponding to the first sub-function module.
In one embodiment, the aforementioned process of the electronic device querying whether the local or second database includes the security parameter included in the target link address may query, for the electronic device, whether the security parameter list of the first sub-function module included locally or the security parameter list of the first sub-function module included in the second database includes the security parameter included in the target link address. Wherein the security parameter list comprises at least one security parameter.
In one embodiment, the security key included in the destination link address of the other device may be obtained as follows: the other device may send a security parameter acquisition request for the wrapper corresponding to the first sub-function module to the electronic device, and the electronic device may receive the security parameter acquisition request for the wrapper corresponding to the first sub-function module sent by the other device, where the security parameter acquisition request carries the security key SecureKey. The electronic equipment verifies the security key, and when the security key passes the verification, the security parameter of the wrapper corresponding to the first sub-function module is generated, so that the security parameter of the wrapper corresponding to the first sub-function module is sent to the other equipment. The other device may receive the security parameter of the wrapper corresponding to the first sub-function module sent by the electronic device, and obtain a target link address including the security parameter of the wrapper corresponding to the first sub-function module.
In one embodiment, the electronic device may further obtain second link address information of the wrapper corresponding to the second sub-function module; the second sub-function module is a sub-function module associated with the first sub-function module. The electronic device may generate, by the wrapper corresponding to the second sub-function module, the link address format corresponding to the second sub-function module according to the second link address information, so that the other device or the first sub-function module accesses the second sub-function module according to the link address format of the second sub-function module. That is to say, in the embodiment of the present application, an access process to the associated sub-function module may also be implemented.
In one embodiment, the second sub-function module may specifically be a sub-function module having a data call relationship with the first sub-function module. When the first sub-function module accesses the second sub-function module, the electronic device may obtain the data indicated by the link address according to the link address used for accessing the second sub-function module, and then provide the data indicated by the link address for the first sub-function module. In one embodiment, the process of the electronic device obtaining the data indicated by the link address according to the link address for accessing the second sub-function module may be: the electronic equipment queries the encapsulator corresponding to the second sub-function module according to the identifier of the encapsulator of the second sub-function module, which is included in the link address for accessing the second sub-function module, then calls the encapsulator corresponding to the second sub-function module to verify the security parameters included in the link address, and when the security parameters included in the link address pass the verification, the data indicated by the input parameters included in the link address are obtained through the encapsulator corresponding to the second sub-function module.
In one embodiment, the second sub-function module may also be a sub-function module that may be still used by an external user analyzed according to the first sub-function module. In one embodiment, the specific configuration file may further include a link address or a link address format corresponding to the second sub-function module. The process of accessing the second sub-function module by other devices according to the link address format corresponding to the second sub-function module is described in the following, which is not repeated herein in the embodiments of the present application, in which an electronic device accesses the first sub-function module according to the link address format corresponding to the first sub-function module.
In one embodiment, the aforementioned usage guide may further include a link address format corresponding to the second sub-function module. In one embodiment, the usage guide may further include usage description information of a link address format corresponding to the second sub-function module.
It can be seen that, in the embodiment shown in fig. 2, the electronic device may generate a link address format corresponding to the second sub-function module, so that other devices or the first sub-function module may access the second sub-function module according to the link address corresponding to the second sub-function module, and an effective access process to the associated sub-function module may be improved.
Please refer to fig. 3, which is a schematic diagram of a function access system according to an embodiment of the present disclosure. The system may include an electronic device 10 and other devices 20. Wherein:
the electronic device 10 may generate a link address format corresponding to the first sub-function module by performing steps S101 to S103, so that the other device 20 may access the first sub-function module according to the link address format corresponding to the first sub-function module.
Please refer to fig. 4, which is a schematic structural diagram of a function access apparatus according to an embodiment of the present disclosure. The apparatus may be applied to the aforementioned electronic device. Specifically, the apparatus may include:
a processing module 401, configured to perform encapsulation processing on each sub-function module in a plurality of sub-function modules included in a target system, to obtain an encapsulator corresponding to each sub-function module;
an obtaining module 402, configured to obtain first link address information of a wrapper corresponding to a first sub-function module in the plurality of sub-function modules; the first sub-function module is any one of the plurality of sub-function modules or a designated function module of the plurality of sub-function modules;
the processing module 401 is further configured to generate, by the wrapper corresponding to the first sub-function module, a link address format corresponding to the first sub-function module according to the first link address information, so that other devices access the first sub-function module according to the link address format corresponding to the first sub-function module.
In an optional implementation manner, the obtaining module 402 obtains first link address information of an encapsulator corresponding to a first sub-function module in the plurality of sub-function modules, specifically, a scan specification configuration file; the specified configuration file indicates at least one sub-function module which can be accessed; reading first link address information of a wrapper corresponding to the first sub-function module included in the specified configuration file; the first link address information includes an identifier of the wrapper corresponding to the first sub-function module and an input parameter of the wrapper corresponding to the first sub-function module.
It is emphasized that, to further ensure the privacy and security of the first link address information, the first link address information may also be stored in a node of a block chain.
In an alternative embodiment, the apparatus further comprises a communication module 403.
In an optional implementation manner, the communication module 403 is configured to receive, after the processing module 401 generates, according to the first link address information, a link address format corresponding to the first sub-function module through a wrapper corresponding to the first sub-function module, an access request sent by the other device for the first sub-function module.
In an optional implementation manner, the obtaining module 402 is further configured to obtain data indicated by the target link address when the access request carries the target link address conforming to the link address format corresponding to the first sub-function module.
In an alternative embodiment, the communication module 403 is further configured to send the data indicated by the target link address to the other device.
In an optional implementation manner, the obtaining module 402 obtains data indicated by the target link address when the access request carries the target link address conforming to the first link address format, specifically, when the access request carries the target link address conforming to the first link address format, according to an identifier of an encapsulator corresponding to a first sub-function module included in the target link address, queries the encapsulator corresponding to the first sub-function module; calling a wrapper corresponding to the first sub-function module to verify the security parameters included in the target link address; and when the security parameter included in the target link address passes the verification, acquiring data indicated by the input parameter included in the target link address through a wrapper corresponding to the first sub-function module.
In an optional implementation manner, the communication module 403 is further configured to receive, before receiving the access request to the first sub-function module sent by the other device, a security parameter obtaining request for the encapsulator corresponding to the first sub-function module sent by the other device, where the security parameter obtaining request carries a security key.
In an optional implementation manner, the processing module 401 is further configured to verify the security key, generate a security parameter of the wrapper corresponding to the first sub-function module when the security key is verified, and send the security parameter of the wrapper corresponding to the first sub-function module to the other device through the communication module 403.
In an optional implementation manner, the processing module 401 performs encapsulation processing on each of a plurality of sub-function modules included in the target system to obtain an encapsulator corresponding to each sub-function module, specifically, adds a corresponding custom component to a code corresponding to each sub-function module in the plurality of sub-function modules included in the target system; and packaging the code corresponding to each sub-function module and the corresponding custom assembly to obtain a wrapper corresponding to each sub-function module.
In an optional implementation manner, the obtaining module 402 is further configured to obtain second link address information of the wrapper corresponding to the second sub-function module; the second sub-function module is a sub-function module associated with the first sub-function module.
In an optional implementation manner, the processing module 401 is further configured to generate, by the wrapper corresponding to the second sub-function module, a link address format corresponding to the second sub-function module according to the second link address information, so that the other device or the first sub-function module accesses the second sub-function module according to the link address format of the second sub-function module.
As can be seen, in the embodiment shown in fig. 4, the function access device may perform encapsulation processing on each sub-function module in the multiple sub-function modules included in the target system to obtain an encapsulator corresponding to each sub-function module, and obtain first link address information of the encapsulator corresponding to a first sub-function module in the multiple sub-function modules, so that a link address format corresponding to the first sub-function module is generated by the encapsulator corresponding to the first sub-function module according to the first link address information, so that other devices access the first sub-function module according to the link address format corresponding to the first sub-function module, and development efficiency is improved.
Fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. The electronic device described in this embodiment may include: a processor 1000, an input device 2000, an output device 3000, and a memory 4000. The processor 1000, the input device 2000, the output device 3000, and the memory 4000 may be connected by a bus or other means. In one embodiment, the input device 2000 and the output device 3000 are optional devices. In one embodiment, input device 2000 and output device 3000 may be standard wired or wireless communication interfaces.
The Processor 1000 may be a Central Processing Unit (CPU), and may be other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 4000 may be a high-speed RAM memory or a non-volatile memory (e.g., a disk memory). The memory 4000 is used to store a set of program codes, and the processor 1000, the input device 2000 and the output device 3000 may call the program codes stored in the memory 4000. Specifically, the method comprises the following steps:
the processor 1000 is configured to perform encapsulation processing on each sub-function module in a plurality of sub-function modules included in a target system, so as to obtain an encapsulator corresponding to each sub-function module; acquiring first link address information of a wrapper corresponding to a first sub-function module in the plurality of sub-function modules; the first sub-function module is any one of the plurality of sub-function modules or a designated function module of the plurality of sub-function modules; and generating a link address format corresponding to the first sub-function module according to the first link address information through the wrapper corresponding to the first sub-function module, so that other equipment can access the first sub-function module according to the link address format corresponding to the first sub-function module.
In an embodiment, the processor 1000 obtains first link address information of the wrapper corresponding to a first sub-function module of the plurality of sub-function modules, specifically, scans a specified configuration file; the specified configuration file indicates at least one sub-function module which can be accessed; reading first link address information of a wrapper corresponding to the first sub-function module included in the specified configuration file; the first link address information includes an identifier of the wrapper corresponding to the first sub-function module and an input parameter of the wrapper corresponding to the first sub-function module.
In one embodiment, the processor 1000 is further configured to receive, through the input device 2000, an access request sent by the other device for the first sub-function module after the link address format corresponding to the first sub-function module is generated according to the first link address information by the wrapper corresponding to the first sub-function module; when the access request carries a target link address which accords with a link address format corresponding to the first sub-function module, acquiring data indicated by the target link address; the data indicated by the target link address is transmitted to the other device through the output device 3000.
In an embodiment, when the access request carries a target link address conforming to the first link address format, the processor 1000 obtains data indicated by the target link address, specifically, when the access request carries a target link address conforming to the first link address format, according to an identifier of an encapsulator corresponding to a first sub-function module included in the target link address, queries the encapsulator corresponding to the first sub-function module; calling a wrapper corresponding to the first sub-function module to verify the security parameters included in the target link address; and when the security parameter included in the target link address passes the verification, acquiring data indicated by the input parameter included in the target link address through a wrapper corresponding to the first sub-function module.
In an embodiment, the processor 1000 is further configured to receive, by the input device 2000, a security parameter obtaining request, which is sent by the other device and is for a wrapper corresponding to the first sub-function module, before receiving, by the input device 2000, an access request, which is sent by the other device and is for the first sub-function module, where the security parameter obtaining request carries a security key; verifying the security key; when the security key passes the verification, generating security parameters of the wrapper corresponding to the first sub-function module; and sending the security parameters of the encapsulator corresponding to the first sub-function module to the other equipment through the output equipment 3000.
In one embodiment, the processor 1000 performs encapsulation processing on each of a plurality of sub-function modules included in a target system to obtain an encapsulator corresponding to each sub-function module, specifically, adds a corresponding custom component to a code corresponding to each sub-function module in the plurality of sub-function modules included in the target system; and packaging the code corresponding to each sub-function module and the corresponding custom assembly to obtain a wrapper corresponding to each sub-function module.
In an embodiment, the processor 1000 is further configured to obtain second link address information of the wrapper corresponding to the second sub-function module; the second sub-function module is a sub-function module associated with the first sub-function module; and generating a link address format corresponding to the second sub-function module according to the second link address information by using the wrapper corresponding to the second sub-function module, so that the other equipment or the first sub-function module can access the second sub-function module according to the link address format of the second sub-function module.
In a specific implementation, the processor 1000, the input device 2000, and the output device 3000 described in this embodiment of the application may execute the implementation described in the embodiment of fig. 1A and fig. 2, or may execute the implementation described in this embodiment of the application, and are not described herein again.
The functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of sampling hardware, and can also be realized in a form of sampling software functional units.
It will be understood by those skilled in the art that all or part of the processes of the methods of the above embodiments may be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the above embodiments of the methods. The computer readable storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
Further, the computer usable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to the use of the blockchain node, and the like.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an 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.
While the invention has been described with reference to a preferred embodiment, it will be understood by those skilled in the art that various changes in form and detail may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (10)

1. A method for accessing a function, comprising:
packaging each sub-function module in a plurality of sub-function modules included in a target system to obtain a wrapper corresponding to each sub-function module;
acquiring first link address information of a wrapper corresponding to a first sub-function module in the plurality of sub-function modules; the first sub-function module is any one of the plurality of sub-function modules or a designated function module of the plurality of sub-function modules;
and generating a link address format corresponding to the first sub-function module according to the first link address information through the wrapper corresponding to the first sub-function module, so that other equipment can access the first sub-function module according to the link address format corresponding to the first sub-function module.
2. The method according to claim 1, wherein the obtaining the first link address information of the wrapper corresponding to the first sub-function module of the plurality of sub-function modules comprises:
scanning a specified configuration file; the specified configuration file indicates at least one sub-function module which can be accessed;
reading first link address information of a wrapper corresponding to the first sub-function module included in the specified configuration file;
the first link address information includes an identifier of the wrapper corresponding to the first sub-function module and an input parameter of the wrapper corresponding to the first sub-function module.
3. The method according to claim 1 or 2, wherein after the generating, by the wrapper corresponding to the first sub-function module, the link address format corresponding to the first sub-function module according to the first link address information, the method further comprises:
receiving an access request sent by the other equipment to the first sub-function module;
when the access request carries a target link address which accords with a link address format corresponding to the first sub-function module, acquiring data indicated by the target link address;
and sending the data indicated by the target link address to the other equipment.
4. The method according to claim 3, wherein when the access request carries a target link address conforming to the first link address format, acquiring data indicated by the target link address comprises:
when the access request carries a target link address which accords with the first link address format, inquiring an encapsulator corresponding to a first sub-function module according to an identifier, included in the target link address, of the encapsulator corresponding to the first sub-function module;
calling a wrapper corresponding to the first sub-function module to verify the security parameters included in the target link address;
and when the security parameter included in the target link address passes the verification, acquiring data indicated by the input parameter included in the target link address through a wrapper corresponding to the first sub-function module.
5. The method according to claim 3, wherein before receiving the access request to the first sub-function module sent by the other device, the method further comprises:
receiving a security parameter acquisition request which is sent by the other equipment and aims at the encapsulator corresponding to the first sub-function module, wherein the security parameter acquisition request carries a security key;
verifying the security key;
when the security key passes the verification, generating security parameters of the wrapper corresponding to the first sub-function module;
and sending the security parameters of the encapsulator corresponding to the first sub-function module to the other equipment.
6. The method according to claim 1, wherein the encapsulating each sub-function module of a plurality of sub-function modules included in the target system to obtain an encapsulator corresponding to each sub-function module comprises:
adding a corresponding self-defined component for a code corresponding to each sub-function module in a plurality of sub-function modules included in the target system;
and packaging the code corresponding to each sub-function module and the corresponding custom assembly to obtain a wrapper corresponding to each sub-function module.
7. The method of claim 1, further comprising:
acquiring second link address information of the wrapper corresponding to the second sub-function module; the second sub-function module is a sub-function module associated with the first sub-function module;
and generating a link address format corresponding to the second sub-function module according to the second link address information by using the wrapper corresponding to the second sub-function module, so that the other equipment or the first sub-function module can access the second sub-function module according to the link address format of the second sub-function module.
8. A function access apparatus, comprising:
the processing module is used for encapsulating each sub-function module in a plurality of sub-function modules included in the target system to obtain an encapsulator corresponding to each sub-function module;
the obtaining module is used for obtaining first link address information of the wrapper corresponding to a first sub-function module in the plurality of sub-function modules; the first sub-function module is any one of the plurality of sub-function modules or a designated function module of the plurality of sub-function modules;
the processing module is further configured to generate, by the wrapper corresponding to the first sub-function module, a link address format corresponding to the first sub-function module according to the first link address information, so that other devices access the first sub-function module according to the link address format corresponding to the first sub-function module.
9. An electronic device, comprising a processor and a memory, the processor and the memory being interconnected, wherein the memory is configured to store a computer program comprising program instructions, the processor being configured to invoke the program instructions to perform the method of any of claims 1-7.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which is executed by a processor to implement the method according to any one of claims 1-7.
CN202010354730.7A 2020-04-29 2020-04-29 Function access method and device, electronic equipment and storage medium Pending CN111625373A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010354730.7A CN111625373A (en) 2020-04-29 2020-04-29 Function access method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010354730.7A CN111625373A (en) 2020-04-29 2020-04-29 Function access method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN111625373A true CN111625373A (en) 2020-09-04

Family

ID=72271771

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010354730.7A Pending CN111625373A (en) 2020-04-29 2020-04-29 Function access method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111625373A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114745357A (en) * 2022-04-08 2022-07-12 中国银行股份有限公司 Method and device for acquiring external link address
CN115617328A (en) * 2022-12-21 2023-01-17 广东省信息工程有限公司 Application generation method, system, equipment and medium of public support platform

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114745357A (en) * 2022-04-08 2022-07-12 中国银行股份有限公司 Method and device for acquiring external link address
CN115617328A (en) * 2022-12-21 2023-01-17 广东省信息工程有限公司 Application generation method, system, equipment and medium of public support platform
CN115617328B (en) * 2022-12-21 2023-03-31 广东省信息工程有限公司 Application generation method, system, equipment and medium for public support platform

Similar Documents

Publication Publication Date Title
CN111163129B (en) Resource processing method and device based on cross-link network
CN110601880B (en) Cloud platform, service processing method, command interface and computer equipment
CN112099972B (en) Office file processing method, device and equipment based on RPA robot
CN111625373A (en) Function access method and device, electronic equipment and storage medium
CN113010378B (en) Log processing method and device of microservice module, storage medium and electronic device
CN111371702B (en) Data forwarding method and device, electronic equipment and storage medium
CN109343975B (en) Method and apparatus for inter-page asynchronous communication
CN111427570A (en) Intelligent interface processing method and device
EP4224316A1 (en) Mirror image management method and apparatus
CN111163052A (en) Method, device, medium and electronic equipment for connecting Internet of things platform
CN105224594B (en) Service-oriented architecture data interconnection query system and query method
CN112887199B (en) Gateway, cloud platform, configuration method and device thereof, and computer-readable storage medium
CN113190360A (en) Logistics data sharing method, device, equipment and storage medium based on cloud platform
CN113434254A (en) Client deployment method, client deployment apparatus, computer device, and storage medium
CN112463414A (en) Multi-client data interaction method and device, electronic equipment and storage medium
CN111857985A (en) Calling method and device of browser plug-in, storage medium and terminal
CN112350868B (en) Wall opening processing method, device, server, system and readable storage medium
CN114968822A (en) Interface testing method and device, computer equipment and storage medium
CN113918245A (en) Data calling method, device, equipment and computer readable storage medium
CN113312577A (en) Webpage resource processing method and device, electronic equipment and storage medium
CN113626222A (en) Message processing method and device, computer equipment and storage medium
CN109582481B (en) Transmission method, device and equipment of call result and storage medium
CN111506846A (en) Web page generation method and device, electronic equipment and storage medium
CN115964435A (en) Transaction uplink method, device, electronic equipment and storage medium
CN113590426B (en) Cross-trust-domain service monitoring method and system based on blockchain

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