Small program construction method and device, medium and program product

By obtaining the user interface cache information and requesting the source files generated by the server, the problem that the applet cannot reuse code on different platforms is solved, and the code reuse and development costs are reduced.

CN120144117APending Publication Date: 2025-06-13SHANGHAI SIGEYUAN INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510122526.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-24
Publication Date
2025-06-13

AI Technical Summary

Technical Problem

When existing applets are developed on different platforms, different codes are required for each platform, which makes the code unable to be reused and increases development costs.

Method used

The client device obtains the user interface cache information and requests the mini program source file from the server. The server generates source files suitable for different platforms based on flutter code. The client device parses and displays the mini program application interface.

Benefits of technology

It realizes the reuse of mini program code, reduces development costs, and improves the efficiency of mini programs built across platforms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120144117A_ABST
    Figure CN120144117A_ABST
Patent Text Reader

Abstract

The embodiment of the invention is suitable for the technical field of computers, and provides an applet construction method and device, a medium and a program product, the method is applied to client equipment, and the method comprises the steps that in response to a construction instruction of an applet, user interface cache information of the applet is obtained from an application program platform where the applet is located; displaying a user interface on an interface of the client device based on the user interface cache information; obtaining user information through the user interface; the user information is sent to a server so as to request a source file of the applet from the server, and the server is used for generating the source file suitable for the application program platform according to the flutter code of the applet; and displaying an application interface of the applet on an interface of the client equipment according to the source file so as to complete construction of the applet. By means of the method, code reuse of the applet can be achieved, and the development cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of computer technology, and particularly relates to a method, device, medium, and program product for constructing a small program. Background Art

[0002] A small program is an application that can be used without being downloaded and installed. Each platform can implement the reachability of applications based on small programs.

[0003] Currently, small programs on each platform have different programming languages and frameworks. Therefore, when the same small program is installed on different platforms, it is necessary to use the programming language of the corresponding platform and write code under the framework of that platform. Since the components and APIs of each platform are different, the small program needs to develop corresponding code for each platform, and the code cannot be reused, resulting in high development costs for small programs.

[0004] Application Content

[0005] In view of this, the embodiments of this application provide a method, device, medium, and program product for constructing a small program to achieve code reuse of small programs and reduce development costs.

[0006] The first aspect of the embodiments of this application provides a method for constructing a small program, which is applied to a client device and includes:

[0007] In response to a construction instruction of the small program, obtain the user interface cache information of the small program from the application program platform where the small program is located;

[0008] Based on the user interface cache information, display the user interface on the interface of the client device;

[0009] Obtain user information through the user interface;

[0010] Send the user information to the server to request the source file of the small program from the server. The server is used to generate a source file applicable to the application program platform according to the flutter code of the small program;

[0011] According to the source file, display the application interface of the small program on the interface of the client device to complete the construction of the small program.

[0012] The second aspect of the embodiments of this application provides a method for constructing a small program, which is applied to a server and includes:

[0013] If user information from a client device is received, verify the user information;

[0014] If the user information verification is passed, obtain the flutter code of the applet;

[0015] Based on the flutter code, generate source files applicable to the application platform where the applet is located;

[0016] Send the source files to the client device.

[0017] The third aspect of the embodiments of the present application provides a building system for applets, including a client device and a server. The client device is deployed with a browser engine and a user module, and the server includes a flutter framework. The server is deployed with a component library and a cache module, where

[0018] The user module is configured to, in response to a building instruction of an applet, obtain the user interface cache information of the applet from the application platform where the applet is located; based on the user interface cache information, display a user interface on the interface of the client device through the browser engine to obtain user information; send the user information to the server;

[0019] The server is configured to obtain the component data and flutter code of the applet from the component library and the cache module according to the user information, and generate a JavaScript source file of the applet based on the component data and the flutter code;

[0020] The client device is further configured to parse the JavaScript source file through the browser engine and display the application interface of the applet on the client device to complete the building of the applet.

[0021] The fourth aspect of the embodiments of the present application provides a building device for applets, which is applied to a client device. The device includes:

[0022] A cache information acquisition module, which, in response to a building instruction of an applet, obtains the user interface cache information of the applet from the application platform where the applet is located;

[0023] A user interface display module, which displays a user interface on the interface of the client device based on the user interface cache information;

[0024] A user information acquisition module, which is configured to obtain user information through the user interface;

[0025] A user information sending module, which is configured to send the user information to a server to request the source file of the applet from the server. The server is configured to generate a source file applicable to the application platform according to the flutter code of the applet;

[0026] A building module, configured to display an application interface of the applet on an interface of the client device according to the source file, so as to complete the building of the applet.

[0027] A fifth aspect of the embodiments of the present application provides an applet building device, which is applied to a server. The device includes:

[0028] A verification module, configured to verify the user information if the user information from the client device is received;

[0029] An acquisition module, configured to acquire the flutter code of the applet if the user information passes the verification;

[0030] A generation module, configured to generate a source file applicable to the application program platform where the applet is located based on the flutter code;

[0031] A sending module, configured to send the source file to the client device.

[0032] A sixth aspect of the embodiments of the present application provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the method described in the first aspect or the second aspect above is implemented.

[0033] A seventh aspect of the embodiments of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the method described in the first aspect or the second aspect above is implemented.

[0034] An eighth aspect of the embodiments of the present application provides a computer program product. When the computer program product runs on a computer device, the computer device is enabled to execute the method described in the first aspect or the second aspect above.

[0035] Compared with the prior art, the embodiments of the present application include the following advantages:

[0036] When applying the method in the embodiments of the present application, when the applet is used on different platforms, the same source file can be used for building, thereby reducing the development cost of the applet. In the embodiments of the present application, when the client device loads the applet, it can request the source file of the applet from the server through the user login information, and then only needs to parse the source file of the applet to load the applet. The source file is sent from the server to the applet, and the server can generate source files applicable to different platforms based on the same set of codes, thereby realizing code reuse of the applet and reducing the development cost. Description of the Drawings

[0037] To more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the accompanying drawings required for use in the embodiments or the description of the prior art.

[0038] Figure 1 It is a schematic flowchart of the steps of a method for constructing a small program provided by an embodiment of the present application;

[0039] Figure 2 It is a schematic flowchart of the steps of another method for constructing a small program provided by an embodiment of the present application;

[0040] Figure 3 It is a schematic flowchart of the steps of a method for constructing a small program provided by an embodiment of the present application;

[0041] Figure 4 It is a schematic diagram of a system for constructing a small program provided by an embodiment of the present application;

[0042] Figure 5 It is a schematic diagram of a device for constructing a small program provided by an embodiment of the present application;

[0043] Figure 6 It is a schematic diagram of another device for constructing a small program provided by an embodiment of the present application;

[0044] Figure 7 It is a schematic diagram of a computer device provided by an embodiment of the present application. Detailed implementation manners

[0045] In the following description, specific details such as specific system architectures and technologies are proposed for the purpose of illustration rather than limitation, so as to thoroughly understand the embodiments of the present application. However, those skilled in the art should clearly understand that the present application can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid unnecessary details from interfering with the description of the present application.

[0046] The small programs on traditional platforms each have different programming languages and frameworks. For example, WeChat Mini Programs use WXML and WXSS, and Alipay Mini Programs use AXML and ACSS. The components and APIs (Application Programming Interfaces) of different platforms are inconsistent, resulting in the inability to reuse code. Code needs to be developed for each platform, and the code cannot be developed once and run on multiple platforms, resulting in high development costs.

[0047] In addition, the existing mini-program UI (User Interface) and interaction experience are limited. The native UI component libraries provided by mini-programs on each platform are limited, and the degree of customization is not high. For complex UI and interaction designs, developers may need to write a large number of custom components additionally, increasing the development complexity. And it is difficult to maintain a unified user experience, especially in the case of rapid iteration or frequent function updates.

[0048] The offline capabilities are limited. The local cache mechanisms of mini-programs on different platforms rely on different local storage APIs provided by the platform, such as wx.setStorage or my.setStorag. The cache capacities of these APIs are relatively limited; and the data structures of the caches are single, only supporting the simple key-value form and unable to store complex structured data; at the same time, the platform will automatically clear the cache according to the device space situation, resulting in the instability of the cached data and affecting the user experience.

[0049] The common solution is for each platform to maintain a set of codes and build and customize relevant UI components respectively to ensure the stable operation of each platform, but the development cost is high; there are also some cross-platform conversion technologies commonly used, such as the Antmove mini-program conversion tool, which can realize the conversion of mini-program codes on multiple terminals. Although it solves the cross-terminal development problem to a certain extent, a large amount of code conversion and adaptation work is carried out during the construction process, and there is a certain performance overhead in the finally generated mini-program. For the APIs of different platforms, there are also problems that some relatively new APIs may not be supported in time.

[0050] Based on this, the embodiments of the present application provide a method for constructing a mini-program, which can reuse the mini-program code, thereby reducing the development cost.

[0051] The technical solution of the present application will be described below through specific embodiments.

[0052] Refer to Figure 1 , which shows the schematic diagram of the step flow of a method for constructing a mini-program provided by the embodiments of the present application. Specifically, it may include the following steps:

[0053] S101, in response to the construction instruction of the mini-program, obtain the user interface cache information of the mini-program from the application program platform where the mini-program is located.

[0054] The execution entity of this example can be a client device. The client device can include, but is not limited to, a personal computer (PC), a smartphone, a netbook, a tablet computer, a smart camera, a personal digital assistant (PDA), a portable multimedia player (PMP), a projection device, a smart screen device, an augmented reality (AR) / virtual reality (VR) device, a mixed reality (MR) device, a television, or a motion-sensing game console in a human-computer interaction scenario, etc. The specific functions and structures of the client device are not limited in this embodiment.

[0055] The above construction instructions can be triggered by the user. When the user clicks on the icon or link of the applet, the client device can detect the user's click operation.

[0056] The above application can be an application capable of launching an applet, such as a social application, a payment application, a food delivery application, etc. The application is deployed with a browser engine, and the browser engine is used to render the user interface and the application interface.

[0057] The user interface cache information can be cached in the application platform, so that the application can obtain the user interface cache information from the application platform.

[0058] S102, Based on the user interface cache information, display the user interface on the interface of the client device.

[0059] Based on the user interface cache information, the browser engine can render the user interface, so that the user interface can be displayed on the interface of the client.

[0060] The above user interface can be a user login interface.

[0061] As an example, when the user clicks on a link in WeChat on the mobile phone, the applet is triggered. The mobile phone can obtain the cached user login interface information from WeChat, so that the user login interface of the applet is displayed on the mobile phone.

[0062] S103, Obtain user information through the user interface.

[0063] The user interface can provide an information filling area to fill in user information. The client device can extract the information filled in by the user to obtain user information.

[0064] S104. Send the user information to the server to request the source file of the applet from the server. The server is used to generate a source file applicable to the application platform according to the Flutter code of the applet.

[0065] The client device can send the user information to the server, so that the server can perform user authentication based on the user information. After user authentication, a source file applicable to the application platform can be generated according to the Flutter code of the applet. The server can send the source file to the client device.

[0066] S105. Display the application interface of the applet on the interface of the client device according to the source file to complete the construction of the applet.

[0067] In this embodiment, the client device only needs to cache the user interface information, reducing the storage pressure on the client device. For different client devices and different application platforms, the source file of the applet can be obtained from the server to build the applet. The server can generate source files applicable to various applications based on the Flutter code, thus solving the problem of quickly and efficiently cross-platform building application applets with the same set of code for different platforms.

[0068] Refer to Figure 2 , which shows a schematic flow chart of steps of another method for building an applet provided by an embodiment of the present application, and specifically may include the following steps:

[0069] S201. If user information from a client device is received, verify the user information.

[0070] The execution subject of this embodiment is the server, and the server can be equipped with a Flutter platform. The server may include a cache module for storing user data, and the user data may include user identity information, user operation records, personalized configurations of the user for the applet, etc.

[0071] After receiving the user information, the server can verify the user identity. For example, the server can obtain the user information from the cached data and compare the received user information with the user information in the cache. If the two are the same, the verification passes.

[0072] It should be noted that encrypted communication can be carried out between the client device and the server to ensure the security of user information. The client device may include an encryption module, and the server may include a decryption module. The client device can use the encryption module to encrypt the user information, and the server can use the decryption module to decrypt the received user information.

[0073] The client device and the server can perform encryption and decryption using pre-agreed cryptographic algorithms. As an example, the AES algorithm can be used for encryption or decryption.

[0074] S202, if the user information verification passes, obtain the flutter code of the applet.

[0075] Each applet can develop a corresponding set of flutter code, which is stored in the server. If the user information verification passes, the flutter code of the applet can be found in the server's memory according to the applet identifier carried in the user information.

[0076] If the user information verification fails, the user information error can be returned to the server to prompt that the username or password is incorrect.

[0077] S203, based on the flutter code, generate source files suitable for the application program platform where the applet is located.

[0078] Obtain component data from the component library of the server. The component library includes a network module component library and an interface design component library; based on the flutter code and the component data, generate the JavaScript source file of the applet.

[0079] The server includes a cache module, which is implemented using the data warehouse analysis system Hive. The cache module is used for data storage in a custom binary format, and is used to associate and store the user data of the applet and the user information based on key-value pairs.

[0080] S204, send the source file to the client device.

[0081] In this embodiment, the server can cache the data, thereby reducing the storage pressure on the client device. At the same time, when storing data in the server, since there is no need to consider the storage space, data can be stored in a custom binary format, so that personalized configuration information can be stored and the personalized extension of the applet can be realized.

[0082] In this embodiment, based on flutter, the server can build the source files of applets on multiple platforms through a set of codes, thereby realizing code reuse and reducing development costs.

[0083] Refer to Figure 3 , which shows the step flow diagram of another method for building an applet provided by the embodiment of the present application, and specifically may include the following steps:

[0084] S301. The client device, in response to the build instruction of the mini-program, obtains the user interface cache information of the mini-program from the application platform where the mini-program is located.

[0085] S302. The client device displays the user interface on the interface of the client device based on the user interface cache information.

[0086] S303. The client device obtains user information through the user interface.

[0087] S304. The client device sends the user information to the server to request the source file of the mini-program from the server. The server is used to generate the source file applicable to the application platform according to the flutter code of the mini-program.

[0088] The client device can encrypt the user information and then send it to the server.

[0089] S305. If the server receives the user information from the client device, it verifies the user information.

[0090] After receiving the user information, the server can decrypt it to obtain the user information.

[0091] S306. If the user information passes the verification on the server, the server obtains the flutter code of the mini-program.

[0092] S307. The server generates the source file applicable to the application platform where the mini-program is located based on the flutter code.

[0093] S308. The server sends the source file to the client device.

[0094] S309. The client device displays the application interface of the mini-program on the interface of the client device according to the source file to complete the construction of the mini-program.

[0095] When applying the method in the embodiment of the present application, when the mini-program is used on different platforms, the same source file can be used for construction, thereby reducing the development cost of the mini-program. In the embodiment of the present application, when the client device loads the mini-program, it can request the source file of the mini-program from the server through the user login information, and then only needs to parse the source file of the mini-program to load the mini-program. The source file is sent from the server to the mini-program. The server can generate the source files applicable to different platforms based on the same set of codes, thereby realizing code reuse of the mini-program and reducing the development cost.

[0096] It should be noted that the sequence numbers of the steps in the above embodiments do not indicate the order of execution. The execution order of each process should be determined by its function and internal logic, and should not impose any limitation on the implementation process of the embodiments of the present application.

[0097] The embodiment of the present application provides a construction system for mini-programs, including a client device and a server. The client device is deployed with a browser engine and a user module. The server includes a Flutter framework, and the server is deployed with a component library and a cache module. Among them,

[0098] The user module is used to, in response to a mini-program construction instruction, obtain the user interface cache information of the mini-program from the application platform where the mini-program is located; based on the user interface cache information, display the user interface on the interface of the client device through the browser engine to obtain user information; and send the user information to the server.

[0099] The server is used to obtain the component data and Flutter code of the mini-program from the component library and the cache module according to the user information, and generate the JavaScript source file of the mini-program based on the component data and the Flutter code.

[0100] The client device is further used to parse the JavaScript source file through the browser engine and display the application interface of the mini-program on the client device to complete the construction of the mini-program.

[0101] The client device further includes an encryption module, and the server further includes a decryption module. Among them;

[0102] The encryption module is used to encrypt the user information to be sent before the client device sends the user information to the server.

[0103] The decryption module is used to decrypt the encrypted user information received by the server.

[0104] During the communication process between the mini-program and the Flutter side, the AES encryption algorithm is used to encode the user sensitive information to ensure security and reliability.

[0105] Figure 4 It is a schematic diagram of a construction system for a mini-program provided by an embodiment of the present application. As Figure 4 shown, as Figure 4 shown, the device where the mini-program is located is the above-mentioned client device, and the device where Flutter is located is the above-mentioned server.

[0106] As Figure 4As shown, the shell project of the mini-program contains a Client module and an AES encryption module. The Client module is associated with the Webkit rendering engine, and the AES encryption module encodes the URL parameters and transmits them to the Flutter part. The Flutter part has a DIO network module, a Hive cache module, and a UI library module. After being processed by dartdevc and dart2js, a JS source file is generated, and the JS source file interacts with the Webkit rendering engine.

[0107] Among them, the Client module can be responsible for functions related to the mini-program client, such as interacting with users and processing business logic. The AES encryption module can be used to encrypt data to ensure the security of data transmission. The Webkit rendering engine can be responsible for rendering the interface of the mini-program and presenting it to the user. The DIO network module can be used for network requests, such as obtaining data from the server. The Hive cache module can cache data to improve the data access speed and reduce the number of network requests. The UI library module can provide components and tools for building user interfaces. dartdevc and dart2js are tools related to the Dart language. dartdevc can be used for compilation during the development stage, and dart2js can be used to convert Dart code into JavaScript code for running in environments such as browsers.

[0108] Based on Figure 4 In the architecture described above, this application provides a cross-platform mini-program construction method based on Flutter. Among them, on the Flutter side, through Dart, unified construction functions and business modules such as UI and DIO are used, and they are compiled, transformed, and deployed as web applications; on the mini-program side, a web interface is embedded through a built-in Web rendering engine, and a user login module is set up; among them, the Flutter project includes using the NoSQL database Hive to build a flexible and powerful cache module to increase the cache capacity and support complex data structures; and during the communication process between the user login module and the Flutter side, the user's sensitive information is encoded and decoded in the URL through the encryption algorithm AES.

[0109] The mini-program can use the JavaScript language. When performing data communication, encrypted communication can be carried out. For example, the crypto-js library is used in JavaScript for AES (Advanced Encryption Standard) encryption. For the mini-program side using JavaScript, the crypto-js library is used for AES encryption, and the whole process can be as follows:

[0110] Prepare the data. First, the data to be encrypted (such as user authentication information) can be converted into JSON string format for subsequent processing.

[0111] Define the key. A secure key can be predefined, and this key should be consistent with the decryption end. As an example, keys of 128, 192, or 256 bits can be used.

[0112] Perform AES encryption. By calling the CryptoJS.AES.encrypt() method and passing in the data string and the key, the encryption operation is performed. This method can adopt a multi-round encryption algorithm to perform complex substitution and permutation operations on the input data to generate the ciphertext.

[0113] Perform URL encoding. To ensure that the ciphertext can be securely transmitted as a URL parameter, the generated ciphertext can be encoded to prevent transmission errors caused by special characters.

[0114] Among them, the encryption code can be as follows:

[0115] import CryptoJS from 'crypto-js';

[0116] const secretKey = 'your-secret-key';

[0117] const authInfoJsonStr = JSON.stringify(authInfoJson);

[0118] const encryptedAuthInfo = CryptoJS.AES.encrypt(authInfoJsonStr, secretKey).toString();

[0119] const authInfoStr = encodeURIComponent(encryptedAuthInfo);

[0120] h5Url += `?authInfo=${authInfoStr}`;

[0121] On the Flutter side, the encrypt library can be used for AES decryption. The encrypt library is a collection of tools for encryption operations and usually supports common symmetric encryption algorithms such as AES and DES, as well as asymmetric encryption algorithms such as RSA. The steps are as follows:

[0122] Perform key and initialization vector (IV) preparation. Ensure that the same key is used during decryption as during encryption. The key can be converted to a 32-byte format to meet the AES requirements. Additionally, the initialization vector can adopt the default length. In practical applications, a randomly generated IV can also be used.

[0123] During the decryption process, an AES decrypter can be created using the encrypt.Encrypter class, and the decrypt64() method can be called to decrypt the encrypted ciphertext. This method converts the ciphertext to the original data format.

[0124] Data parsing. Parse the decrypted string into a JSON object for subsequent data processing and business logic execution.

[0125] As an example, the decryption code can be as follows:

[0126] import 'dart:convert'; import 'package:encrypt / encrypt.dart' as encrypt;

[0127] import 'package:encrypt / encrypt.dart';

[0128] import 'package:convert / convert.dart';

[0129] final secretKey = 'your-secret-key';

[0130] String decrypt(String encrypted) { final key = encrypt.Key.fromUtf8(secretKey.padRight(32, '0')); final iv = encrypt.IV.fromLength(16);

[0131] final encrypter = encrypt.Encrypter(encrypt.AES(key));

[0132] final decrypted = encrypter.decrypt64(encrypted, iv: iv);

[0133] return decrypted;}

[0134] final Uri currentUri = Uri.base;

[0135] final String? authInfoJson = currentUri.queryParameters['authInfo'];

[0136] if (authInfoJson != null) { / / Decrypt final String decryptedAuthInfo = decrypt(authInfoJson); _setLanguageFromAuthInfo(decryptedAuthInfo);}

[0137] final authInfo = authInfoJson != null? UserLoginResponseEntity.fromJson(jsonDecode(decryptedAuthInfo)) : UserLoginResponseEntity.fromJson({});

[0138] Figure 4 The cache module in [description] can provide key - value storage through a lightweight and fast Hive plugin based on a NoSQL database. It has a simple API (Application Programming Interface) and supports data persistence, enabling efficient reading and writing of data even in offline mode. Based on Hive, the cache module can have high performance: Hive uses a custom binary format for data storage, with extremely fast read and write speeds, suitable for application scenarios that require frequent access. Based on Hive, the cache module can have flexibility: Hive supports dynamic data structures and can store various complex objects, facilitating the handling of irregular or changing data. The steps to build the cache module can be as follows:

[0139] In this embodiment, the Flutter side can introduce the Hive dependency.

[0140] Add the Hive dependency in the pubspec.yaml file as follows:

[0141] yaml

[0142] Copy the code

[0143] dependencies:

[0144] hive:^2.0.0

[0145] hive_flutter:^1.0.0

[0146] Initialize Hive

[0147] In the entry file of the Flutter application, initialize Hive as follows:

[0148]

[0149] Create a data model

[0150] Define a data model to support complex data structures. You can implement the storage of custom data types through TypeAdapter:

[0151] dart

[0152] Copy the code

[0153] class User{

[0154] final String id;

[0155] final String name;

[0156] User({required this.id, required this.name});

[0157] }

[0158] class UserAdapter extends TypeAdapter <user>{

[0159] @override

[0160] final typeId = 0;

[0161] @override

[0162] User read(BinaryReader reader) {

[0163] return User(

[0164] id: reader.read(),

[0165] name: reader.read(), );

[0167] }

[0168] @override

[0169] void write(BinaryWriter writer, User obj) {

[0170] writer.write(obj.id);

[0171] writer.write(obj.name);

[0172] }

[0173] }

[0174] On the Flutter side, the StorageService class can be used. The StorageService class implements a flexible and powerful local data storage using Hive, manages dependencies using GetX, simplifies data storage and reading operations, and supports multiple data types and batch deletion functions. It effectively improves the data management efficiency of Flutter applications.

[0175]

[0176] return_box.put(key, value);

[0177] }

[0178] String getString(String key, {String defaultValue = ""}) {

[0179] return_box.get(key, defaultValue: defaultValue) as String;

[0180] }

[0181] int getInt(String key, {int defaultValue = 0}) {

[0182] return_box.get(key, defaultValue: defaultValue) as int;

[0183] }

[0184] double getDouble(String key, {double defaultValue = 0.0}) {

[0185] return_box.get(key, defaultValue: defaultValue) as double;

[0186] }

[0187] bool getBool(String key, {bool defaultValue = false}) {

[0188] return_box.get(key, defaultValue: defaultValue) as bool;

[0189] }

[0190] Map<dynamic, dynamic> getMap(String key) {

[0191] return_box.get(key, defaultValue: <dynamic, dynamic>{})

[0192] as Map<dynamic, dynamic>;

[0193] }

[0194] Future <void>remove(String key) async {

[0195] return_box.delete(key);

[0196] }

[0197] Future <void>deleteAll(List <string>keys) async {

[0198] return_box.deleteAll(keys);

[0199] }

[0200] In this embodiment, a Web application is built and deployed across platforms using Flutter, enabling it to be embedded and run via WebView in mini-programs on multiple platforms. A more flexible caching and offline capability is achieved through the NoSQL database Hive based on IndexedDB, thus no longer being restricted by the caching mechanism of the mini-program platform. A component library is provided through the declarative framework Flutter, allowing for unified and flexible customization of modules such as UI components and networking.

[0201] Refer to Figure 5 , which shows a schematic diagram of a mini-program construction device provided by an embodiment of the present application. This device is applied to a client device and specifically may include a cache information acquisition module 51, a user interface display module 52, a user information acquisition module 53, a user information sending module 54, and a construction module 55, where:

[0202] The cache information acquisition module 51, in response to a mini-program construction instruction, acquires the user interface cache information of the mini-program from the application platform where the mini-program is located;

[0203] The user interface display module 52 displays the user interface on the interface of the client device based on the user interface cache information;

[0204] The user information acquisition module 53 is used to acquire user information through the user interface;

[0205] The user information sending module 54 is used to send the user information to the server to request the source file of the mini-program from the server. The server is used to generate a source file applicable to the application platform according to the flutter code of the mini-program;

[0206] The construction module 55 is used to display the application interface of the mini-program on the interface of the client device according to the source file to complete the construction of the mini-program.

[0207] In a possible implementation, a browser engine is deployed on the application platform, and the browser engine is used to render the user interface and the application interface.

[0208] Refer to Figure 6 , which shows a schematic diagram of another mini-program construction device provided by an embodiment of the present application. This device is applied to a server and specifically may include a verification module 61, an acquisition module 62, a generation module 63, and a sending module 64:

[0209] A verification module 61, configured to verify the user information if the user information is received from a client device;

[0210] An acquisition module 62, configured to acquire the flutter code of the applet if the user information passes the verification;

[0211] A generation module 63, configured to generate a source file applicable to the application program platform where the applet is located based on the flutter code;

[0212] A sending module 64, configured to send the source file to the client device.

[0213] In a possible implementation manner, the above-mentioned generation module 63 includes:

[0214] A component data acquisition sub-module, configured to acquire component data from the component library of the server, where the component library includes a network module component library and an interface design component library;

[0215] A source file generation sub-module, configured to generate a JavaScript source file of the applet based on the flutter code and the component data.

[0216] In a possible implementation manner, the server includes a cache module, which is implemented using the data warehouse analysis system Hive. The cache module is configured to store data in a custom binary format, and the cache module is configured to associate and store the user data of the applet and the user information based on key-value pairs.

[0217] For the device embodiments, since they are basically similar to the method embodiments, the description is relatively simple. For related parts, refer to the description in the method embodiment section.

[0218] Figure 7 This is a schematic structural diagram of a computer device provided by an embodiment of the present application. As Figure 7 shown, the computer device 7 of this embodiment includes: at least one processor 70 ( Figure 7 only one is shown in the figure), a memory 71, and a computer program 72 stored in the memory 71 and executable on the at least one processor 70. When the processor 70 executes the computer program 72, the steps in any of the above-mentioned method embodiments are implemented.

[0219] The computer device 7 may be the above-mentioned client device or server. The computer device may include, but is not limited to, a processor 70 and a memory 71. Those skilled in the art can understand, Figure 7 This is only an example of the computer device 7 and does not constitute a limitation on the computer device 7. It may include more or fewer components than those shown in the figure, or combine certain components, or different components. For example, it may also include input / output devices, network access devices, etc.

[0220] The so-called processor 70 may be a central processing unit (CPU). The processor 70 may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0221] In some embodiments, the memory 71 may be an internal storage unit of the computer device 7, such as the hard disk or memory of the computer device 7. In some other embodiments, the memory 71 may also be an external storage device of the computer device 7, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the computer device 7. Further, the memory 71 may also include both the internal storage unit and the external storage device of the computer device 7. The memory 71 is used to store an operating system, application programs, a boot loader, data, and other programs, such as the program code of the computer program. The memory 71 may also be used to temporarily store data that has been output or will be output.

[0222] The embodiments of the present application also provide a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned various method embodiments can be implemented.

[0223] The embodiments of the present application provide a computer program product. When the computer program product runs on a computer device, the computer device is caused to execute the steps in the above-mentioned various method embodiments.

[0224] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.< / string> < / void> < / void> < / user>

Claims

1. A method for constructing a small program, characterized in that: Applied to client devices, including: In response to a construction instruction of the mini-program, acquiring user interface cache information of the mini-program from an application platform where the mini-program is located; Based on the user interface cache information, displaying a user interface on the interface of the client device; Obtaining user information through the user interface; Sending the user information to a server to request the source file of the mini program from the server, wherein the server is used to generate a source file suitable for the application platform according to the flutter code of the mini program; According to the source file, the application interface of the applet is displayed on the interface of the client device to complete the construction of the applet.

2. The method according to claim 1, characterized in that The application program is deployed with a browser engine, and the browser engine is used to render the user interface and the application interface.

3. A method for constructing a mini program, characterized in that: Applicable to servers, including: If user information is received from the client device, verifying the user information; If the user information verification is successful, the flutter code of the mini program is obtained; Based on the flutter code, generate a source file suitable for the application platform where the mini program is located; The source file is sent to the client device.

4. The method according to claim 3, characterized in that The generating, based on the flutter code, a source file applicable to the application platform where the mini program is located includes: Acquire component data from a component library of the server, wherein the component library includes a network module component library and an interface design component library; Based on the flutter code and the component data, a JavaScript source file of the mini program is generated.

5. The method according to claim 3 or 4, characterized in that The server includes a cache module, which is implemented using the data warehouse analysis system Hive. The cache module is used to store data in a custom binary format. The cache module is used to associate and store user data of the mini program with user information based on key-value pairs.

6. A system for constructing a small program, characterized in that: It includes a client device and a server, wherein the client device is deployed with a browser engine and a user module, the server includes a flutter framework, and the server is deployed with a component library and a cache module, wherein: The user module is used to obtain the user interface cache information of the mini program from the application platform where the mini program is located in response to the mini program construction instruction; based on the user interface cache information, display the user interface on the interface of the client device through the browser engine to obtain user information; and send the user information to the server; The server is used to obtain component data and flutter code of the mini program from the component library and the cache module according to the user information, and generate a JavaScript source file of the mini program based on the component data and the flutter code; The client device is also used to parse the JavaScript source file through the browser engine and display the application interface of the applet on the client device to complete the construction of the applet.

7. The system according to claim 6, characterized in that The client device further includes an encryption module, and the server further includes a decryption module, wherein; The encryption module is used to encrypt the user information to be sent before the client device sends the user information to the server; The decryption module is used to decrypt the encrypted user information received by the server.

8. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 5 is implemented.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.

10. A computer program product, characterized in that When the computer program product is executed on a computer device, the computer device is caused to execute the method according to any one of claims 1 to 5.