CN114281436A - Applet communication method, apparatus, device and storage medium - Google Patents

Applet communication method, apparatus, device and storage medium Download PDF

Info

Publication number
CN114281436A
CN114281436A CN202111566784.0A CN202111566784A CN114281436A CN 114281436 A CN114281436 A CN 114281436A CN 202111566784 A CN202111566784 A CN 202111566784A CN 114281436 A CN114281436 A CN 114281436A
Authority
CN
China
Prior art keywords
applet
binding
host
base class
attribute
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
CN202111566784.0A
Other languages
Chinese (zh)
Inventor
王晓红
任涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202111566784.0A priority Critical patent/CN114281436A/en
Publication of CN114281436A publication Critical patent/CN114281436A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

The disclosure provides an applet communication method, an applet communication device, an applet communication equipment and a storage medium, relates to the field of computers, and particularly relates to an applet technology. The specific implementation scheme is as follows: responding to the triggering operation of the host function in the applet, and generating a host service request; calling a host service method corresponding to the host service request to realize a corresponding service function; wherein, the attribute type of the host service method inherits from a preset extension base class in the applet framework; the preset extension base class is provided with an extension binding method. According to the technology disclosed by the invention, the development difficulty and the understanding cost of the host program are reduced, the communication safety between the applet and the host program is improved, and meanwhile, the loss of partial functions of a mechanism when a host program system runs is avoided.

Description

Applet communication method, apparatus, device and storage medium
Technical Field
The present disclosure relates to the field of computers, and in particular, to an applet communication method, apparatus, device, and storage medium.
Background
The small program is a program which runs depending on a host program, and a user can experience services brought by different small programs by adding various small programs in the installed host program. The applet can be used without downloading, so that the dream of 'reach' of the application is realized, a user does not need to care about whether to install too many applications, and the concept of 'walking after use' is embodied.
Disclosure of Invention
The disclosure provides an applet communication method, apparatus, device and storage medium.
According to an aspect of the present disclosure, there is provided an applet communication method including:
responding to the triggering operation of the host function in the applet, and generating a host service request;
calling a host service method corresponding to the host service request to realize a corresponding service function;
the attribute type of the host business method is inherited from a preset extension base class in the applet framework; the extension binding method is implemented in the preset extension base class.
According to another aspect of the present disclosure, there is also provided an electronic device including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform any one of the applet communication methods provided by the disclosed embodiments.
According to another aspect of the present disclosure, there is also provided a non-transitory computer readable storage medium storing computer instructions for causing a computer to perform any one of the applet communication methods provided by the embodiments of the present disclosure.
According to the technology disclosed by the invention, the development difficulty and the understanding cost of the host program are reduced, the communication safety between the applet and the host program is improved, and meanwhile, the loss of partial functions of a mechanism when a host program system runs is avoided.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
fig. 1 is a flowchart of an applet communication method provided in an embodiment of the disclosure;
fig. 2 is a flow chart of another applet communication method provided in an embodiment of the disclosure;
fig. 3 is a block diagram of an applet communication device provided in an embodiment of the disclosure;
fig. 4 is a block diagram of an electronic device for implementing the applet communication method of an embodiment of the disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
The applet communication method and the applet communication device provided by the embodiment of the disclosure are suitable for an application scene of data communication between an applet and a host program of the applet. Each of the applet communication methods provided in the embodiments of the present disclosure may be executed by an applet communication apparatus, which may be implemented by software and/or hardware and is specifically configured in an electronic device.
For ease of understanding, the present disclosure first details each applet communication method.
Referring to fig. 1, an applet communication method includes:
and S101, responding to the trigger operation of the host function in the applet, and generating a host service request.
The host function is a function provided by a host program of the applet, and the function can be understood as an extension of an existing function in the applet framework.
The triggering operation of the host function in the applet may be a click, a slide, a drag, or the like of a preset area or a preset control in the applet. The present disclosure does not set any limit to the specific number of clicks, sliding distance, dragging distance, and the like.
S102, calling a host service method corresponding to the host service request to realize a corresponding service function; the attribute type to which the host service method belongs is inherited from a preset extension base class in the applet framework, and an extension binding method for binding the execution reference data of the applet for the attribute type is realized in the preset extension base class.
The host service method can be understood as an example method written in a host program required to be called for processing the host service request. The corresponding service function can be realized by the small program by calling the host service method. Typically, different hosted service requests correspond to different hosted service methods.
For example, when a control is closed by touching a network in an applet, a network close request is generated. At this time, the applet cannot provide the applet shutdown function itself, and the network shutdown function needs to be implemented by calling the network shutdown method in the host program.
The attribute type of the host business method is used for representing the class identifier of the abstract class corresponding to the host business method.
The base class is also called a parent class, which refers to a inherited class containing the same characteristics, and is defined as a class type containing the commonality of all entities in the object-oriented design. The preset extension base class in the present disclosure may be understood as a base class preset in an applet framework for the applet client to perform function extension, and a base class for the host program to extend the applet function.
The extended binding method may be understood as a method for providing a subclass (also called a derived class) that inherits the preset extended base class with a function of executing reference data binding, and the method is a core layer logic code of an applet client and is independent of actual services. Where the execution reference data may be understood as data required to support the applet to implement the business functions of the host. For example, at least one of the context of the front-end code of the applet execution and basic properties of the applet itself (such as the applet identification and the applet category, etc.) may be included.
Illustratively, the calling of the host service method is performed through a global variable exposed to the front end of the applet by the applet client, a preset extension base class, an attribute type to which the host service method belongs and the host service method, so that a service function corresponding to the host service method is realized. For example, if the host service method is a stopWifi () method for implementing a WiFi (wireless fidelity) shutdown function, the attribute type of the method is a WiFi bridge class, the preset extension base class is an extension class, and the global variable of the applet front end is _ nassan, then the applet front end can call the stopWifi () method of the host program through _ nassan.
In an optional embodiment, a host service method corresponding to the host service request may be determined according to the description information of each service method; determining the attribute type corresponding to the host business method, the preset extension base class and the overall variable of the small program client based on the class diagram in the development and design stage; constructing a calling logic code according to the determined global variable of the applet client, the preset extension base class, the attribute type corresponding to the host service method and the host service method; and running the calling logic code and calling the host service method corresponding to the host service request.
In an optional embodiment, the method for calling the host service corresponding to the host service request may be: and determining a host service method corresponding to the host service request according to the corresponding relation between each service request and each service method in the small program method call list, thereby avoiding the occurrence of the condition that the corresponding service function cannot be realized due to wrong method call. Meanwhile, the determination of the host service method corresponding to the host service request is carried out in a table look-up mode, so that the determination efficiency of the host service method is improved, and the improvement of the small program communication efficiency is facilitated.
The method and the device for binding the small program inherit the attribute type of the host business method in the host program to the preset extension base class in the small program frame and realize the extension binding method for supporting the data required by the small program to realize the business function of the host in the preset extension base class, thereby realizing the function extension of the small program by the host program. Because the applet client does not need to expose an expansion binding method irrelevant to the service to the host program, the communication safety between the applet and the host program is improved. In addition, the host program does not need to be classified to realize the extension binding method, so that the development difficulty and the understanding cost of the host program are reduced. Meanwhile, under a system operation mechanism, especially an IOS operation mechanism, the host program has different host program classification realization same extension binding methods, thereby avoiding the loss of partial host functions caused by classification realization of the same extension binding methods.
On the basis of the above technical solutions, the present disclosure also provides an alternative embodiment. In this alternative embodiment, a binding process between the property type to which the host business method belongs and the applet will be described in detail. In the present disclosure, reference may be made to the description of the foregoing embodiments.
Referring to fig. 2, an applet communication method includes:
s201, when the small program runs, obtaining attribute types of each host service method in a preset extension base class in a small program frame.
For example, when the applet runs, the attribute types to which the host service methods in the preset extension base class belong in the applet framework may be obtained, and an attribute list including the attribute types may be constructed.
S202, binding the execution reference data of the small program for each attribute type according to the extension binding method realized in the preset extension base class.
The extended binding method may be understood as a method for providing a function of binding reference data to a subclass (also called a derived class) inheriting the preset extended base class, and the method is a core layer logic code of an applet client and is unrelated to actual services. Where the execution reference data may be understood as data required to support the applet to implement the business functions of the host. For example, at least one of the context of the execution front-end code of the applet, basic properties of the applet itself (such as the applet identity and the applet class), and the like.
Illustratively, the property list may be traversed, and the execution reference data of the applet may be bound for each property type in the property list according to an extension binding method implemented in the preset extension base class.
In an optional embodiment, before binding the execution reference data of the applet for each property type according to the extended binding method, the method further includes: identifying a parent class inherited by each attribute type; and eliminating the attribute types of the parent class different from the preset extension base class.
Illustratively, the parent class inherited by each attribute type in the attribute list can be traversed; and removing the attribute types of the parent class and the preset extension base class in the attribute list so as to update the attribute list. Correspondingly, the updated attribute list is traversed subsequently, and the execution reference data of the small program is bound for each attribute type in the updated attribute list according to the extension binding method realized in the preset extension base class.
In general, the parent class inherited by the attribute type is a preset extension base class. When the parent class inherited by the attribute type is empty or the parent class inherited by the attribute type is different from the preset extension base class, the situation that the host program expands the applet wrongly may occur, so that the attribute types different from the parent class and the preset extension base class need to be removed, and the influence on the normal operation of the applet is avoided.
In an alternative embodiment, the extended binding method may include an environmental binding method; correspondingly, according to the extended binding method, the binding of the execution reference data of the applet for each attribute type may be: and binding the context environment of the front-end code executed by the small program for each property type according to the environment binding method.
The front-end code of the applet is usually js (js) (javascript) logic code, and the host business method implemented under each attribute type in the host program is usually OC (object-C, C-extended object-oriented programming language) logic code. In order to ensure that the applet can call the OC logic code in the host program, the execution environment of the JS code, i.e., the context (JSContext), needs to be bound for each property type of the host program.
When different host programs perform function extension on the same applet, the attribute types of the different host programs all need to be bound by context environment, and the situation of class classification realization of the corresponding logic codes of the environment binding method occurs at the moment. Due to the same classification under the IOS runtime mechanism, if the methods are of the same name, the situation of being covered will occur, and further the situation of losing part of host functions occurs, and the use experience is influenced. According to the method, the environment binding methods are classified according to the attribute types, and the implementation of the specific method under the corresponding attribute types is replaced by the implementation mode in the preset extension base class, so that the context environment of the front-end code executed by the small program is uniformly bound to different attribute types when the small program runs, and the situation that part of implementation is covered is avoided.
In another alternative embodiment, the extended binding method may include a base class property setting method; correspondingly, according to the extended binding method, the binding of the execution reference data of the applet for each attribute type may be: and setting the base class attribute for each attribute type according to the base class attribute setting method.
The base class attribute is used for representing attribute information of a preset extension base class in the applet. Optionally, the base class attribute may include identification information of the applet for uniquely characterizing the applet, thereby distinguishing between different applets. Or alternatively, the base class attribute may include class information of the applet for distinguishing the applet class. For example, the applet type may be a mini-game or an applet.
It can be understood that the richness of the base class property content is improved by detailing the base class property into the identification information and/or the category information of the applet, and data support is provided for binding the property type in the host program and the execution reference data of the applet. The identification information and/or the category information of the applet are only specific descriptions of the contents included in the base class attribute, and should not be construed as specific limitations of the contents included therein.
According to the method and the device, the base class attribute is set for each attribute type when the applet runs, so that the situation that the applet runs wrongly is avoided when each host program runs the applet, and the accuracy of the applet running process is improved.
And S203, responding to the trigger operation of the host function in the applet, and generating a host service request.
And S204, calling a host service method corresponding to the host service request to realize a corresponding service function. Wherein, the attribute type of the host service method is inherited from the preset extension base class.
According to the embodiment of the method and the device, the native class, namely the preset extension base class, is unified to bind the execution reference data for each attribute type when the applet runs, so that high cohesion of an extension process is realized, and errors in classification extension are avoided. In addition, when the host program expands the applet framework, only the attribute type of the host service method needs to be defined, core code logics which are irrelevant to services, such as an expansion binding method, do not need to be concerned, and the understanding cost and the expansion difficulty of the host are reduced. Meanwhile, the original class of the applet client does not need to be adapted and upgraded, and the applet client does not need to expose core code logic to the host program, so that convenience and safety of applet extension are improved.
As an implementation of each of the above applet communication methods, the present disclosure also provides an alternative embodiment of an execution device implementing the applet communication method. Referring further to fig. 3, an applet communication device 300 comprises: a host service request generation module 301 and a host service method calling module 302. Wherein the content of the first and second substances,
a host service request generation module 301, configured to generate a host service request in response to a trigger operation on a host function in an applet;
a host service method calling module 302, configured to call a host service method corresponding to the host service request, so as to implement a corresponding service function;
the attribute type to which the host service method belongs is inherited from a preset extension base class in an applet frame, and an extension binding method for binding execution reference data of the applet for the attribute type is realized in the preset extension base class.
The method and the device for binding the small program inherit the attribute type of the host business method in the host program to the preset extension base class in the small program frame and realize the extension binding method for supporting the data required by the small program to realize the business function of the host in the preset extension base class, thereby realizing the function extension of the small program by the host program. Because the applet client does not need to expose an expansion binding method irrelevant to the service to the host program, the communication safety between the applet and the host program is improved. In addition, the host program does not need to be classified to realize the extension binding method, so that the development difficulty and the understanding cost of the host program are reduced. Meanwhile, under a system operation mechanism, especially an IOS operation mechanism, the host program has different host program classification realization same extension binding methods, thereby avoiding the loss of partial host functions caused by classification realization of the same extension binding methods.
In an optional embodiment, the apparatus further comprises:
the attribute type acquisition module is used for acquiring the attribute types of the host business methods in the preset extension base class when the small program runs;
and the execution reference data binding module is used for binding the execution reference data for each attribute type according to the extended binding method.
In an optional embodiment, the extended binding method comprises an environmental binding method;
the execution reference data binding module comprises:
and the context environment binding unit is used for binding the context environment of the applet execution front-end code for each attribute type according to the environment binding method.
In an optional embodiment, the extended binding method comprises a base class property setting method;
the execution reference data binding module comprises:
and the base class attribute setting unit is used for setting the base class attribute for each attribute type according to the base class attribute setting method.
In an alternative embodiment, the base class attributes include identification information and/or class information of the applet.
In an optional embodiment, the apparatus further comprises:
a parent identification module, configured to identify a parent class inherited by each of the attribute types before the execution reference data is bound for each of the attribute types according to the extended binding method;
and the attribute type removing module is used for removing the attribute types of the parent class different from the preset extension base class.
In an optional embodiment, the apparatus further comprises:
and the host service method determining module is used for determining the host service method corresponding to the host service request according to the corresponding relation between each service request and the service method in the small program method call list.
The applet communication device can execute the applet communication method provided by any embodiment of the disclosure, and has functional modules and beneficial effects corresponding to the execution of each applet communication method.
In the technical scheme of the disclosure, the collection, storage, use, processing, transmission, provision, disclosure and other processing of the attribute types of the host service request and the host service method meet the regulations of relevant laws and regulations and do not violate the customs of the public order.
The present disclosure also provides an electronic device, a readable storage medium, and a computer program product according to embodiments of the present disclosure.
FIG. 4 shows a schematic block diagram of an example electronic device 400 that may be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 4, the apparatus 400 includes a computing unit 401 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM)402 or a computer program loaded from a storage unit 408 into a Random Access Memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the device 400 can also be stored. The computing unit 401, ROM 402, and RAM 403 are connected to each other via a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
A number of components in device 400 are connected to I/O interface 405, including: an input unit 406 such as a keyboard, a mouse, or the like; an output unit 407 such as various types of displays, speakers, and the like; a storage unit 408 such as a magnetic disk, optical disk, or the like; and a communication unit 409 such as a network card, modem, wireless communication transceiver, etc. The communication unit 409 allows the device 400 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
Computing unit 401 may be a variety of general and/or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 401 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The computing unit 401 executes the respective methods and processes described above, such as the applet communication method. For example, in some embodiments, the applet communication method may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 408. In some embodiments, part or all of the computer program may be loaded and/or installed onto the device 400 via the ROM 402 and/or the communication unit 409. When the computer program is loaded into RAM 403 and executed by computing unit 401, one or more steps of the applet communication method described above may be performed. Alternatively, in other embodiments, the computing unit 401 may be configured to perform the applet communication method by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service are overcome. The server may also be a server of a distributed system, or a server incorporating a blockchain.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in this disclosure may be performed in parallel or sequentially or in a different order, as long as the desired results of the technical solutions provided by this disclosure can be achieved, and are not limited herein.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.

Claims (17)

1. An applet communication method comprising:
responding to the triggering operation of the host function in the applet, and generating a host service request;
calling a host service method corresponding to the host service request to realize a corresponding service function;
the attribute type to which the host service method belongs is inherited from a preset extension base class in an applet framework, and an extension binding method for binding execution reference data of the applet for the attribute type is realized in the preset extension base class.
2. The method of claim 1, further comprising:
when the small program runs, acquiring the attribute type of each host service method in the preset extension base class;
and binding the execution reference data for each attribute type according to the extended binding method.
3. The method of claim 2, wherein the extended binding method comprises an environmental binding method;
the binding the execution reference data for each attribute type according to the extended binding method includes:
and binding the context environment of the front-end code executed by the small program for each attribute type according to the environment binding method.
4. The method of claim 2 or 3, wherein the extended binding method comprises a base class property setting method;
the binding the execution reference data for each attribute type according to the extended binding method includes:
and setting the base class attribute for each attribute type according to the base class attribute setting method.
5. The method of claim 4, wherein the base class attributes include identification information and/or category information of the applet.
6. The method according to any of claims 2-5, wherein prior to said binding said execution reference data for each of said property types according to said extended binding method, said method further comprises:
identifying a parent class inherited by each attribute type;
and eliminating the attribute types of the parent class different from the preset extension base class.
7. The method according to any of claims 1-6, wherein the host service method to which the host service request corresponds is determined based on:
and determining a host service method corresponding to the host service request according to the corresponding relation between each service request and each service method in the small program method call table.
8. An applet communication device comprising:
the host service request generation module is used for responding to the triggering operation of the host function in the applet and generating a host service request;
the host service method calling module is used for calling the host service method corresponding to the host service request to realize the corresponding service function;
the attribute type to which the host service method belongs is inherited from a preset extension base class in an applet framework, and an extension binding method for binding execution reference data of the applet for the attribute type is realized in the preset extension base class.
9. The apparatus of claim 8, further comprising:
the attribute type acquisition module is used for acquiring the attribute types of the host business methods in the preset extension base class when the small program runs;
and the execution reference data binding module is used for binding the execution reference data for each attribute type according to the extended binding method.
10. The apparatus of claim 9, wherein the extended binding method comprises an environmental binding method;
the execution reference data binding module comprises:
and the context environment binding unit is used for binding the context environment of the applet execution front-end code for each attribute type according to the environment binding method.
11. The apparatus according to claim 9 or 10, wherein the extended binding method comprises a base class property setting method;
the execution reference data binding module comprises:
and the base class attribute setting unit is used for setting the base class attribute for each attribute type according to the base class attribute setting method.
12. The apparatus of claim 11, wherein the base class attributes comprise identification information and/or category information of the applet.
13. The apparatus of any of claims 9-12, further comprising:
a parent identification module, configured to identify a parent class inherited by each of the attribute types before the execution reference data is bound for each of the attribute types according to the extended binding method;
and the attribute type removing module is used for removing the attribute types of the parent class different from the preset extension base class.
14. The apparatus of any of claims 8-13, further comprising:
and the host service method determining module is used for determining the host service method corresponding to the host service request according to the corresponding relation between each service request and the service method in the small program method call list.
15. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the applet communication method according to any one of claims 1-7.
16. A non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the applet communication method according to any one of claims 1-7.
17. A computer program product comprising computer programs/instructions which, when executed by a processor, carry out the steps of the applet communication method according to any one of claims 1-7.
CN202111566784.0A 2021-12-20 2021-12-20 Applet communication method, apparatus, device and storage medium Pending CN114281436A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111566784.0A CN114281436A (en) 2021-12-20 2021-12-20 Applet communication method, apparatus, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111566784.0A CN114281436A (en) 2021-12-20 2021-12-20 Applet communication method, apparatus, device and storage medium

Publications (1)

Publication Number Publication Date
CN114281436A true CN114281436A (en) 2022-04-05

Family

ID=80873327

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111566784.0A Pending CN114281436A (en) 2021-12-20 2021-12-20 Applet communication method, apparatus, device and storage medium

Country Status (1)

Country Link
CN (1) CN114281436A (en)

Similar Documents

Publication Publication Date Title
CN113342345A (en) Operator fusion method and device of deep learning framework
CN112506602B (en) Page generation method and device, electronic equipment and computer readable medium
CN113641677A (en) Data processing method and device, electronic equipment and storage medium
CN112015468A (en) Interface document processing method and device, electronic equipment and storage medium
CN112527281A (en) Operator upgrading method and device based on artificial intelligence, electronic equipment and medium
CN113392346A (en) Path processing method and device for resource file, electronic equipment and storage medium
CN112269706A (en) Interface parameter checking method and device, electronic equipment and computer readable medium
CN115168130A (en) Chip testing method and device, electronic equipment and storage medium
CN114389969A (en) Client test method and device, electronic equipment and storage medium
CN114398023A (en) File generation method and page configuration method and device
CN112925522A (en) Dependency graph generation method, dependency graph generation device, dependency graph generation apparatus, storage medium, and program product
CN112947916A (en) Method, device, equipment and storage medium for realizing online canvas
CN115934076B (en) Cross-platform client micro-service providing device and method and electronic equipment
CN114281436A (en) Applet communication method, apparatus, device and storage medium
CN110599112A (en) Method and device for developing and maintaining network page
CN114721740A (en) Message triggering method, device, equipment and storage medium
CN114218313A (en) Data management method, device, electronic equipment, storage medium and product
CN114090118A (en) Method, device and equipment for starting small program and storage medium
CN114138358A (en) Application program starting optimization method, device, equipment and storage medium
CN116431108B (en) Object type processing method and device, electronic equipment and storage medium
CN115481090A (en) File processing method and device, electronic equipment and storage medium
CN116467080A (en) Cloud computing resource supply management method, device and equipment
CN112860455A (en) Life cycle event processing method and device and electronic equipment
CN112988265A (en) Applet processing method, applet processing apparatus, device, medium and product
CN113961229A (en) Method for generating application program installation package and method for running application program

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