A method, device and computing device for constructing a common component library of a small program

By extracting and compatible with the public user interface components of the applet and generating a public component library, the problem of language incompatibility of different APP platforms is solved, and efficient development and compatibility improvement of applets are achieved.

CN111694569BActive Publication Date: 2024-12-27BEIJING QIHOOD TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN201910199820.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-03-15
Publication Date
2024-12-27
Estimated Expiration
2039-03-15

AI Technical Summary

Technical Problem

During the development of existing technology, due to the incompatibility of languages ​​of different APP platforms, common components are repeatedly developed, increasing the amount of code development and affecting development efficiency.

Method used

Extract the public user interface components in applets of different application service platforms, and perform compatible processing, provide call interfaces, and generate a public component library to make them compatible and shared among different platforms.

Benefits of technology

By integrating common parts of applets and compatible processing, the generated public component library is used as a language unified standard framework to achieve convenient development on different platforms, improving the compatibility and stability of development efficiency and atomized services .

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111694569B_ABST
    Figure CN111694569B_ABST
Patent Text Reader

Abstract

The present invention provides a method, device and computing device for constructing a common component library for mini-programs. The method includes: extracting common user interface components from mini-programs of different application service platforms; performing compatibility processing on the common user interface components for the different application service platforms according to the syntax of the mini-programs of the different application service platforms; providing a corresponding calling interface for the common user interface components, so that in the development of mini-programs, the common user interface components can be called and loaded through the calling interface according to the application service platform of the developed mini-program and the identifier of the component to be called; and packaging the processed common user interface components and the corresponding calling interface to generate a common component library. The common component library constructed by the present invention provides shared use of common user interface components in the process of developing mini-programs of different application service platforms, improves the development efficiency of mini-programs, and further enhances the compatibility and stability of atomic services.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method for constructing a small program common component library, a device for constructing a small program common component library, a computer storage medium, and a computing device. Background Art

[0002] A mini program refers to a mobile application APP that is developed based on a specific programming language and can be used without downloading and installing. Its biggest feature is that it is easy to use and does not require manual installation in the mobile operating system. It is usually used based on large platform-level APPs (such as WeChat, Alipay, etc.) as a carrier to provide users with atomic services.

[0003] In the Internet cloud era, there are now more and more mini-programs that are atomic products and rely on platform-level APPs provided by various application service providers (such as Tencent, Alibaba, etc.), such as WeChat mini-programs, Alipay mini-programs, Baidu mini-programs, Toutiao mini-programs, etc. Each mini-program has its own set of syntax, and there are also common components in these mini-programs. However, there is no technology in the prior art to extract the common parts of the mini-programs and componentize them, which leads to problems such as language incompatibility of mini-programs on different APP platforms and repeated development of common components when developing mini-programs on different APP platforms, which increases the amount of code development and affects the development efficiency of the mini-programs.

[0004] Therefore, there is an urgent need for a technology that can provide a common UI (User Interface) component so that mini-programs on different APP platforms can be referenced and loaded, thereby improving the efficiency of mini-program development. Summary of the invention

[0005] In view of the above problems, the present invention is proposed to provide a method for constructing a mini-program common component library, an apparatus for constructing a mini-program common component library, a computer storage medium, and a computing device that overcome the above problems or at least partially solve the above problems.

[0006] According to one aspect of an embodiment of the present invention, a method for constructing a mini-program common component library is provided, comprising:

[0007] Extract common user interface components from applets on different application service platforms;

[0008] According to the syntax of the applet of the different application service platform, the common user interface component is processed for compatibility with the different application service platform;

[0009] Providing a corresponding calling interface for the public user interface component, so that in the development of the mini-program, the public user interface component can be called and loaded through the calling interface according to the application service platform of the developed mini-program and the identifier of the component to be called;

[0010] The processed common user interface components and corresponding calling interfaces are packaged to generate a common component library.

[0011] Optionally, performing compatibility processing on the common user interface component for the different application service platforms according to the syntax of the applet of the different application service platforms includes:

[0012] A compatibility mechanism is set for the common user interface component. When the common user interface component is called, the compatibility mechanism converts the format of the common user interface component according to the syntax template of the application service platform of the developed mini-program, so that the converted common user interface component can be loaded and run on the application service platform after being called.

[0013] Optionally, performing compatibility processing on the common user interface component for the different application service platforms according to the syntax of the applet of the different application service platforms includes:

[0014] The format of the public user interface component is converted according to the syntax template of the applet of each application service platform in the different application service platforms, and corresponding public user interface components that can be loaded and run on the application service platform after being called are generated respectively.

[0015] Optionally, after packaging the processed common user interface components and the corresponding calling interfaces to generate a common component library, the method further includes:

[0016] The functionality of the common user interface component is expanded.

[0017] Optionally, the extracted common user interface components adopt JS language.

[0018] Optionally, after extracting the common user interface components in the applets of different application service platforms, the method further includes:

[0019] Determine whether the extracted code of the common user interface component only contains JS language code;

[0020] If so, there is no need to perform compatibility processing on the common user interface component;

[0021] If not, the common user interface component is processed for compatibility with the different application service platforms according to the syntax of the applet of the different application service platforms.

[0022] Optionally, the public user interface components include a first type of public user interface components that are common among applets on different application service platforms and do not require adjustment after being loaded, and a second type of public user interface components that are compatible among applets on different application service platforms and can be personalized after being loaded.

[0023] Optionally, the first type of public user interface components includes at least one of the following:

[0024] Protocol component, security component, encryption / decryption algorithm component, audio compression / processing algorithm component, video compression / processing algorithm component, image compression / processing algorithm component, artificial intelligence processing component;

[0025] The second type of public user interface components includes at least one of the following:

[0026] Check box, search box, drop-down box, input box, button, color frame, style frame, folding frame, font component.

[0027] Optionally, the different application service platforms include at least two of the following:

[0028] WeChat, Toutiao, Baidu, and Alipay.

[0029] According to another aspect of an embodiment of the present invention, there is also provided a device for constructing a mini-program common component library, including:

[0030] A component extraction module, suitable for extracting common user interface components from applets on different application service platforms;

[0031] A compatibility processing module, adapted to perform compatibility processing on the common user interface component for the different application service platforms according to the syntax of the applet of the different application service platforms;

[0032] An interface providing module, adapted to provide a corresponding calling interface for the public user interface component, so that the public user interface component can be called and loaded through the calling interface according to the application service platform of the developed mini program and the identifier of the component to be called during the development of the mini program; and

[0033] The packaging module is adapted to package the processed common user interface components and corresponding calling interfaces to generate a common component library.

[0034] Optionally, the compatibility processing module is further adapted to:

[0035] A compatibility mechanism is set for the common user interface component. When the common user interface component is called, the compatibility mechanism converts the format of the common user interface component according to the syntax template of the application service platform of the developed mini-program, so that the converted common user interface component can be loaded and run on the application service platform after being called.

[0036] Optionally, the compatibility processing module is further adapted to:

[0037] The format of the public user interface component is converted according to the syntax template of the applet of each application service platform in the different application service platforms, and corresponding public user interface components that can be loaded and run on the application service platform after being called are generated respectively.

[0038] Optionally, the device further comprises:

[0039] The function extension module is adapted to perform function extension on the common user interface component after the packaging module packages the processed common user interface component and the corresponding calling interface to generate a common component library.

[0040] Optionally, the extracted common user interface components adopt JS language.

[0041] Optionally, the device further comprises:

[0042] A compatibility judgment module, adapted to judge whether the code of the extracted common user interface component only contains JS language code after the component extraction module extracts the common user interface component in the applet of different application service platforms;

[0043] If so, there is no need to perform compatibility processing on the common user interface component;

[0044] If not, the compatibility processing module is triggered to perform compatibility processing for the different application service platforms on the common user interface component according to the syntax of the applet of the different application service platforms.

[0045] Optionally, the public user interface components include a first type of public user interface components that are common among applets on different application service platforms and do not require adjustment after being loaded, and a second type of public user interface components that are compatible among applets on different application service platforms and can be personalized after being loaded.

[0046] Optionally, the first type of public user interface components includes at least one of the following:

[0047] Protocol component, security component, encryption / decryption algorithm component, audio compression / processing algorithm component, video compression / processing algorithm component, image compression / processing algorithm component, artificial intelligence processing component;

[0048] The second type of public user interface components includes at least one of the following:

[0049] Check box, search box, drop-down box, input box, button, color frame, style frame, folding frame, font component.

[0050] Optionally, the different application service platforms include at least two of the following:

[0051] WeChat, Toutiao, Baidu, and Alipay.

[0052] According to another aspect of an embodiment of the present invention, a computer storage medium is provided, which stores a computer program code. When the computer program code runs on a computing device, the computing device executes the method for constructing a mini-program common component library according to any one of the above texts.

[0053] According to another aspect of an embodiment of the present invention, there is further provided a computing device, including:

[0054] Processor; and

[0055] a memory storing computer program code;

[0056] When the computer program code is executed by the processor, it causes the computing device to execute the method for constructing a mini-program common component library according to any one of the above texts.

[0057] The method and device for constructing a common component library of a mini-program proposed in an embodiment of the present invention first extracts common user interface components from mini-programs of different application service platforms, then performs compatibility processing for different application service platforms on the extracted common user interface components, and provides a calling interface for the common user interface components so that the common user interface components can be called and loaded in the development of mini-programs, and finally the processed common user interface components and the corresponding calling interface are packaged to generate a common component library. By extracting the common parts of mini-programs of different application service platforms and componentizing them and performing unified processing for compatibility of different application service platforms, the generated common component library can be used as a unified language standard framework for atomic service mini-programs, and provides shared use of common user interface components in the process of developing mini-programs of different application service platforms, so that mini-programs of any platform can be developed conveniently based on the common component library, greatly improving the development efficiency of mini-programs, and thus improving the compatibility and stability of atomic services. The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the content of the specification, and in order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are specifically cited below.

[0058] Based on the following detailed description of specific embodiments of the present invention in conjunction with the accompanying drawings, those skilled in the art will become more aware of the above and other objects, advantages and features of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0060] Figure 1 A flowchart showing a method for constructing a mini-program common component library according to an embodiment of the present invention is shown;

[0061] Figure 2 A flowchart showing a method for constructing a mini-program common component library according to another embodiment of the present invention is shown;

[0062] Figure 3 A schematic diagram showing the structure of a device for constructing a mini-program common component library according to an embodiment of the present invention; and

[0063] Figure 4 A schematic diagram of the structure of a device for constructing a mini-program common component library according to another embodiment of the present invention is shown. DETAILED DESCRIPTION

[0064] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0065] In the prior art, mini-programs on different APP platforms have their own set of syntax. Since the common parts of the mini-programs are not extracted and componentized, it is inevitable to repeatedly develop some common components when developing mini-programs on different APP platforms. For example, when it is necessary to develop WeChat mini-programs, Alipay mini-programs, Baidu mini-programs, and Toutiao mini-programs that provide a certain service, some common components will be repeatedly developed four times. In addition, since the languages ​​and syntaxes of these four mini-programs are incompatible, when developing mini-programs on different APP platforms, it is necessary to increase the compatibility and scalability of the newly added mini-programs. All of these require a lot of code development, which is troublesome and inefficient.

[0066] In order to solve the above technical problems, an embodiment of the present invention proposes a method for constructing a mini-program common component library. Figure 1 FIG. 1 is a flowchart showing a method for constructing a mini-program common component library according to an embodiment of the present invention. Figure 1 The method may at least include the following steps S102 to S108.

[0067] Step S102, extracting common user interface components in applets of different application service platforms.

[0068] Step S104, performing compatibility processing for the different application service platforms on the common user interface component according to the syntax of the applet of the different application service platforms.

[0069] Step S106, providing a corresponding calling interface for the public user interface component, so that in the development of the mini program, the public user interface component can be called and loaded through the calling interface according to the application service platform of the developed mini program and the identifier of the component to be called.

[0070] Step S108: Packaging the processed common user interface components and the corresponding calling interfaces to generate a common component library.

[0071] The method for constructing a common component library for mini-programs provided in an embodiment of the present invention extracts the common parts of mini-programs for different application service platforms, componentizes them, and performs unified processing on the compatibility of different application service platforms, so that the generated common component library can be used as a language unified standard framework for atomic service mini-programs, and provides shared use of common user interface components in the process of developing mini-programs for different application service platforms, thereby enabling the convenient development of mini-programs for any platform based on the common component library, greatly improving the development efficiency of mini-programs, and thereby enhancing the compatibility and stability of atomic services.

[0072] The different application service platforms mentioned in step S102 above refer to various large platform-level APPs that can serve as carriers for mini-programs, including but not limited to WeChat, Toutiao, Baidu, Alipay, etc.

[0073] The extracted public user interface components can be some general frameworks written in JS language, which mainly adopt JS standard syntax, such as standardized ES5 syntax, and also adopt some commonly used ES6 and / or ES7 syntax. Furthermore, the public component library built based on the extracted public user interface components also adopts JS format, mainly based on JS standard syntax, and can also be compatible with ES6 and / or ES7 syntax, providing rich JS syntax support, which can be generally applied to the page development of various current mini-programs, which is conducive to streamlining code and achieving efficient development.

[0074] The extracted common user interface components can include the following two types:

[0075] (1) The first type of public user interface components that can be used between mini-programs on different application service platforms and do not require any personalized adjustments after being called and loaded. Specifically, this type of public user interface component may include at least one of a protocol component, a security component, an encryption / decryption algorithm component, an audio compression / processing algorithm component, a video compression / processing algorithm component, an image compression / processing algorithm component, an artificial intelligence processing component, etc.

[0076] The protocol components may include commonly used HTTP (HyperText Transfer Protocol) protocols, RPC (Remote Procedure Call) protocols, LDAP (Lightweight Directory Access Protocol), etc. The artificial intelligence processing component may specifically be a neural network processing component, such as a deep neural network, etc.

[0077] (2) The second type of public user interface components that are compatible between mini-programs on different application service platforms and can be personalized after being called and loaded. Specifically, this type of public user interface components may include at least one of a check box, a search box, a drop-down list box, an input box, a button, a color frame, a style frame, a folding frame, a font component, etc.

[0078] For the second type of public user interface components, after being called and loaded to fill in the overall framework of the mini-program during mini-program development, the user (developer) can personalize the component according to the actual effect requirements. For example, for the drop-down list box that is called and loaded, the size (such as width and height) can be adjusted. In actual operation, personalized adjustment can be achieved through CSS (Cascading Style Sheets) and the like.

[0079] In the above step S104, in order to enable the constructed public component library to support the reference loading of applets on different application service platforms, compatibility processing is performed on the extracted public user interface components.

[0080] In an optional embodiment of the present invention, there are two ways to perform compatibility processing on the extracted common user interface components:

[0081] The first method is to set a compatibility mechanism for the extracted common user interface components. When the common user interface components are called, the compatibility mechanism converts the format of the extracted common user interface components according to the syntax template of the application service platform of the developed mini-program, so that the converted common user interface components can be loaded and run on the application service platform after being called.

[0082] The grammar template mentioned here refers to the grammar template of the application service platform generated by extracting the common grammar in the mini-program of each application service platform. For each application service platform, the common grammar mentioned here may include the common grammar for implementing functions in different mini-programs of the application service platform, the grammar provided by the application service platform to third-party developers for mini-program development and use, etc. For example, the grammar template of WeChat mini-program, the grammar template of Baidu mini-program, the grammar template of Toutiao mini-program, and the grammar template of Alipay mini-program are generated by respectively extracting the common grammar of WeChat mini-program, Baidu mini-program, Toutiao mini-program, and Alipay mini-program.

[0083] The running form of the mini program is a page. In order to realize the function of each element (or component) in the page, in addition to the general JS language code, corresponding tags must be defined for each element. For the mini programs of different existing application service platforms, these tags usually include general THML tags (such as div, etc.), as well as specific tags that make the mini program compatible with the application service platform so that the mini program can run on the application service platform. Different application service platform mini programs define different tags for the same element.

[0084] In an exemplary embodiment, when a public user interface component in a public component library is called during the development of a small program, the compatibility mechanism will match the syntax template of the application service platform of the developed small program (which may be referred to as the target application service platform) with the syntax of the public user interface component. Specifically, the labels in the two can be matched one by one, and the public user interface component can be made compatible with the target application service platform by translating the labels in the public user interface component into corresponding labels defined by the target application service platform. Then, the converted public user interface component is provided to the user (developer) so that the public user interface component is loaded and introduced into the small program of the target application service platform.

[0085] For example, for the extracted checkbox component, when the checkbox is called from the public component library during the development of the WeChat applet, the compatibility mechanism can perform corresponding format conversion on the called checkbox according to the syntax template of the WeChat applet to generate a checkbox compatible with the WeChat applet, and provide the generated checkbox component after conversion to the user (developer), so that the checkbox can be loaded and introduced into the developed WeChat applet. When the checkbox is called from the public component library during the development of the Baidu applet, the compatibility mechanism can perform corresponding format conversion on the called checkbox according to the syntax template of the Baidu applet to generate a checkbox compatible with the Baidu applet, so that the checkbox can be loaded and introduced into the developed Baidu applet.

[0086] The second method is to convert the format of the extracted public user interface components according to the syntax template of the applet of each application service platform in the different application service platforms, and generate corresponding public user interface components that can be loaded and run on the application service platform after being called.

[0087] For example, the extracted check box components can be formatted according to the syntax template of WeChat applet, the syntax template of Baidu applet, the syntax template of Toutiao applet, and the syntax template of Alipay applet, respectively, to generate check box components that are compatible with WeChat applet, Baidu applet, Toutiao applet, and Alipay applet.

[0088] In the existing mini-programs of different application service platforms, the JS code part adopts common technology and there is no compatibility problem. Therefore, in order to avoid unnecessary compatibility processing, in an optional embodiment of the present invention, before performing step S104, the following steps can also be performed:

[0089] Determine whether the extracted code of the common user interface component only contains JS language code;

[0090] If so, there is no need to perform compatibility processing on the extracted common user interface components;

[0091] If not, execute step S104.

[0092] The calling interface mentioned in the above step S106 may be a corresponding API (Application Programming Interface).

[0093] In the above step S108, the public user interface components and the corresponding calling interfaces after the compatibility processing can be packaged by a packaging tool such as webpack to generate a third-party public component library, such as a node.js library.

[0094] In an optional embodiment of the present invention, the function of the public user interface component in the public component library can also be expanded. For example, after the public component library is built, the encryption / decryption algorithm component in the public component library can be functionally expanded as needed. Furthermore, the mini-programs of different application service platforms (such as WeChat mini-programs, Baidu mini-programs, etc.) modify their own programs by calling the encryption / decryption algorithm component in the public component library.

[0095] The above introduces Figure 1 There are multiple implementation methods for each link of the illustrated embodiment. The implementation process of the method for constructing a mini-program common component library of the present invention will be described in detail below through specific embodiments.

[0096] Figure 2 A schematic diagram of a process for constructing a common component library of a small program according to a specific embodiment of the present invention is shown. Figure 2 As shown, the method may at least include the following steps S202 to S212.

[0097] Step S202: extracting common user interface components from applets on different application service platforms.

[0098] In this embodiment, the different application service platforms may include WeChat, Toutiao, Baidu, Alipay, etc.

[0099] The extracted common user interface components are written in JS language.

[0100] The extracted common user interface components include at least one of a protocol component, a security component, an encryption / decryption algorithm component, an audio compression / processing algorithm component, a video compression / processing algorithm component, an image compression / processing algorithm component, an artificial intelligence processing component, a button, a check box, a color frame, a style frame, a folding frame, etc.

[0101] Step S204, determine whether the code of the extracted common user interface component only contains JS language code; if so, there is no need to perform compatibility processing on the extracted common user interface component, and go to step S208; if not, execute step S206.

[0102] Step S206, setting a compatibility mechanism for the extracted common user interface component, which converts the format of the extracted common user interface component according to the syntax template of the application service platform of the developed mini-program when the common user interface component is called, so that the converted common user interface component can be loaded and run on the application service platform after being called.

[0103] Step S208, providing a corresponding API for the public user interface component, so that in the development of the mini program, the public user interface component can be called and loaded through the API according to the application service platform of the developed mini program and the identifier of the component to be called.

[0104] Step S210: Pack the public user interface components and corresponding APIs after the compatibility processing to generate a public component library.

[0105] In this step, the webpack tool is used for packaging, and the generated public component library is the node.js library.

[0106] Step S212: extending the functions of the common user interface components in the common component library.

[0107] The embodiment of the present invention provides shared use of common user interface components in the process of developing applets for different application service platforms by performing unified compatibility processing and functional expansion on the extracted common user interface components of applets, thereby effectively improving the development efficiency of applets.

[0108] Based on the same inventive concept, an embodiment of the present invention further provides a device for constructing a mini-program common component library, which is used to support a method for constructing a mini-program common component library provided by any one of the above embodiments or a combination thereof. Figure 3 FIG. 3 is a schematic diagram showing a structure of a device 300 for constructing a common component library of a mini-program according to an embodiment of the present invention. Figure 3 The device 300 may at least include: a component extraction module 310, a compatibility processing module 320, an interface providing module 330 and a packaging module 340.

[0109] The functions of the components or devices of the apparatus 300 for constructing a common component library of a mini-program according to an embodiment of the present invention and the connection relationship between the components are now introduced:

[0110] The component extraction module 310 is suitable for extracting common user interface components in applets of different application service platforms.

[0111] The compatibility processing module 320 is connected to the component extraction module 310 and is adapted to perform compatibility processing for the extracted common user interface components for the different application service platforms according to the syntax of the applet of the different application service platforms.

[0112] The interface providing module 330 is connected to the compatible processing module 320 and is suitable for providing a corresponding calling interface for the public user interface component, so that in the development of the mini-program, the public user interface component can be called and loaded through the calling interface according to the application service platform of the developed mini-program and the identifier of the component to be called.

[0113] The packaging module 340 is connected to the interface providing module 330 and is suitable for packaging the processed common user interface components and the corresponding calling interfaces to generate a common component library.

[0114] The different application service platforms mentioned above refer to various large-scale platform-level APPs that can serve as carriers for mini-programs, including but not limited to WeChat, Toutiao, Baidu, Alipay, etc.

[0115] In an optional embodiment of the present invention, the compatibility processing module 320 is further adapted to:

[0116] A compatibility mechanism is set for the extracted common user interface component. When the common user interface component is called, the compatibility mechanism converts the format of the common user interface component according to the syntax template of the application service platform of the developed mini-program, so that the converted common user interface component can be loaded and run on the application service platform after being called.

[0117] In an optional embodiment of the present invention, the compatibility processing module 320 is further adapted to:

[0118] The extracted public user interface components are formatted according to the syntax template of the applet of each application service platform in the different application service platforms, and corresponding public user interface components are generated respectively, which can be loaded and run on the application service platform after being called.

[0119] In an alternative embodiment of the present invention, referring to Figure 4 As shown, the device 300 may further include a function extension module 350. The function extension module 350 may be connected to the packaging module 340 and is adapted to perform function extension on the public user interface components in the public component library after the packaging module 340 packages the processed public user interface components and the corresponding calling interfaces to generate a public component library.

[0120] In an optional embodiment of the present invention, the extracted common user interface components can be written in JS language.

[0121] Further, in an optional embodiment of the present invention, still referring to Figure 4 As shown, the device 300 may also include a compatibility judgment module 360. The compatibility judgment module 360 ​​may be connected to the component extraction module 310 and the compatibility processing module 320 respectively, and is suitable for judging whether the code of the extracted common user interface component only contains JS language code after the component extraction module 310 extracts the common user interface component in the applet of different application service platforms; if so, there is no need to perform compatibility processing on the common user interface component; if not, the compatibility processing module 320 is triggered to perform compatibility processing on the extracted common user interface component for the different application service platforms according to the syntax of the applet of the different application service platforms.

[0122] In an optional embodiment of the present invention, the extracted common user interface components may include a first type of common user interface components that are common among applets on different application service platforms and do not require adjustment after being loaded, and a second type of common user interface components that are compatible among applets on different application service platforms and can be personalized after being loaded.

[0123] Further, the first type of public user interface components may include at least one of the following:

[0124] Protocol component, security component, encryption / decryption algorithm component, audio compression / processing algorithm component, video compression / processing algorithm component, image compression / processing algorithm component, and artificial intelligence processing component.

[0125] The second category of common user interface components may include at least one of the following:

[0126] Check box, search box, drop-down list box, input box, button, color frame, style frame, folding frame, font component. Based on the same inventive concept, an embodiment of the present invention also provides a computer storage medium. The computer storage medium stores a computer program code, and when the computer program code is executed on a computing device, the computing device executes the method for constructing a mini-program common component library according to any one of the above embodiments or a combination thereof.

[0127] Based on the same inventive concept, an embodiment of the present invention further provides a computing device. The computing device may include:

[0128] Processor; and

[0129] a memory storing computer program code;

[0130] When the computer program code is executed by the processor, it causes the computing device to execute the method for constructing a mini-program common component library according to any one of the above embodiments or a combination thereof.

[0131] According to any one of the above optional embodiments or a combination of multiple optional embodiments, the embodiments of the present invention can achieve the following beneficial effects:

[0132] The method and device for constructing a common component library for mini-programs proposed in the embodiments of the present invention first extract common user interface components from mini-programs on different application service platforms, then perform compatibility processing on the extracted common user interface components for different application service platforms, and provide a calling interface for the common user interface components so that the common user interface components can be called and loaded during mini-program development, and finally the processed common user interface components and the corresponding calling interface are packaged to generate a common component library. By extracting the common parts of mini-programs on different application service platforms and componentizing them and performing unified processing for compatibility with different application service platforms, the generated common component library can be used as a unified language standard framework for atomic service mini-programs, providing shared use of common user interface components in the process of developing mini-programs on different application service platforms, and realizing the ability to conveniently develop mini-programs for any platform based on the common component library, greatly improving the development efficiency of mini-programs, and further improving the compatibility and stability of atomic services.

[0133] Those skilled in the art can clearly understand that the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments, and for the sake of brevity, they are not further described here.

[0134] In addition, the functional units in various embodiments of the present invention may be physically independent of each other, or two or more functional units may be integrated together, or all functional units may be integrated into one processing unit. The above integrated functional units may be implemented in the form of hardware, or in the form of software or firmware.

[0135] Those skilled in the art can understand that if the integrated functional unit is implemented in the form of software and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention can essentially or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, which includes a number of instructions to enable a computing device (such as a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention when running the instructions. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk and other media that can store program codes.

[0136] Alternatively, all or part of the steps of implementing the aforementioned method embodiments may be accomplished by hardware associated with program instructions (such as a computing device such as a personal computer, a server, or a network device), and the program instructions may be stored in a computer-readable storage medium. When the program instructions are executed by a processor of a computing device, the computing device executes all or part of the steps of the methods described in the embodiments of the present invention.

[0137] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that within the spirit and principles of the present invention, the technical solutions described in the aforementioned embodiments can still be modified, or some or all of the technical features therein can be replaced by equivalents. However, these modifications or replacements do not deviate from the protection scope of the present invention.

Claims

1. A method for constructing a mini program common component library, comprising: Extract common user interface components from applets on different application service platforms; According to the syntax of the applet of the different application service platform, the common user interface component is processed for compatibility with the different application service platform; Providing a corresponding calling interface for the public user interface component, so that in the development of the mini-program, the public user interface component can be called and loaded through the calling interface according to the application service platform of the developed mini-program and the identifier of the component to be called; Packaging the processed common user interface components and corresponding calling interfaces to generate a common component library; The performing compatibility processing on the common user interface component for the different application service platforms according to the syntax of the applet of the different application service platforms includes: A compatibility mechanism is set for the public user interface component, and the compatibility mechanism converts the format of the public user interface component according to the syntax template of the application service platform of the developed mini-program when the public user interface component is called, so that the converted public user interface component can be loaded and run on the application service platform after being called; The performing compatibility processing on the common user interface component for the different application service platforms according to the syntax of the applet of the different application service platforms includes: The format of the public user interface component is converted according to the syntax template of the applet of each application service platform in the different application service platforms, and corresponding public user interface components that can be loaded and run on the application service platform after being called are generated respectively.

2. The method according to claim 1, wherein: After packaging the processed common user interface components and the corresponding calling interfaces to generate a common component library, the method further includes: The functionality of the common user interface component is expanded.

3. The method according to claim 1, wherein: The extracted common user interface components are in JS language.

4. The method according to claim 3, wherein: After extracting the common user interface components in the applets of different application service platforms, it also includes: Determine whether the extracted code of the common user interface component only contains JS language code; If so, there is no need to perform compatibility processing on the common user interface component; If not, the common user interface component is processed for compatibility with the different application service platforms according to the syntax of the applet of the different application service platforms.

5. The method according to claim 1, wherein: The public user interface components include a first type of public user interface components that are common among applets on different application service platforms and do not require adjustment after being loaded, and a second type of public user interface components that are compatible among applets on different application service platforms and can be personalized after being loaded.

6. The method according to claim 5, wherein: The first type of public user interface components includes at least one of the following: Protocol component, security component, encryption / decryption algorithm component, audio compression / processing algorithm component, video compression / processing algorithm component, image compression / processing algorithm component, artificial intelligence processing component; The second type of public user interface components includes at least one of the following: Check box, search box, drop-down box, input box, button, color frame, style frame, folding frame, font component.

7. The method according to any one of claims 1 to 6, wherein: The different application service platforms include at least two of the following: WeChat, Toutiao, Baidu, and Alipay.

8. A device for constructing a mini-program common component library, comprising: A component extraction module, suitable for extracting common user interface components from applets on different application service platforms; A compatibility processing module, adapted to perform compatibility processing on the common user interface component for the different application service platforms according to the syntax of the applet of the different application service platforms; An interface providing module, adapted to provide a corresponding calling interface for the public user interface component, so that the public user interface component can be called and loaded through the calling interface according to the application service platform of the developed mini program and the identifier of the component to be called during the development of the mini program; as well as A packaging module, adapted to package the processed common user interface components and corresponding calling interfaces to generate a common component library; The compatibility processing module is further adapted to set a compatibility mechanism for the public user interface component, wherein the compatibility mechanism converts the format of the public user interface component according to the syntax template of the application service platform of the developed mini-program when the public user interface component is called, so that the converted public user interface component can be loaded and run on the application service platform after being called; The compatibility processing module is also suitable for converting the format of the public user interface component according to the syntax template of the applet of each application service platform in the different application service platforms, and generating corresponding public user interface components that can be loaded and run on the application service platform after being called.

9. The device according to claim 8, wherein: Also includes: The function extension module is adapted to perform function extension on the common user interface component after the packaging module packages the processed common user interface component and the corresponding calling interface to generate a common component library.

10. The device according to claim 8, wherein: The extracted common user interface components are in JS language.

11. The device according to claim 10, wherein: Also includes: A compatibility judgment module, adapted to judge whether the code of the extracted common user interface component only contains JS language code after the component extraction module extracts the common user interface component in the applet of different application service platforms; If so, there is no need to perform compatibility processing on the common user interface component; If not, the compatibility processing module is triggered to perform compatibility processing for the different application service platforms on the common user interface component according to the syntax of the applet of the different application service platforms.

12. The device according to claim 8, wherein: The public user interface components include a first type of public user interface components that are common among applets on different application service platforms and do not require adjustment after being loaded, and a second type of public user interface components that are compatible among applets on different application service platforms and can be personalized after being loaded.

13. The device according to claim 12, wherein: The first type of public user interface components includes at least one of the following: Protocol component, security component, encryption / decryption algorithm component, audio compression / processing algorithm component, video compression / processing algorithm component, image compression / processing algorithm component, artificial intelligence processing component; The second type of public user interface components includes at least one of the following: Check box, search box, drop-down box, input box, button, color frame, style frame, folding frame, font component.

14. The device according to any one of claims 8 to 13, wherein: The different application service platforms include at least two of the following: WeChat, Toutiao, Baidu, and Alipay.

15. A computer storage medium storing a computer program code, which, when executed on a computing device, causes the computing device to execute the method for constructing a mini-program common component library according to any one of claims 1 to 7.

16. A computing device comprising: processor; as well as a memory storing computer program code; When the computer program code is executed by the processor, it causes the computing device to execute the method for constructing a mini-program common component library according to any one of claims 1-7.

Citation Information

Patent Citations

  • Automation HMI visualization utilizing GUI function blocks

    CN101149741A

  • User interface rendering method and device

    CN108572818A