Mini-program mode management method, device and storage medium

By obtaining user touch commands and configuration information, flexible switching of mini program mode is achieved, which solves the problem of low flexibility in mini program rendering and improves user experience.

CN113485630BActive Publication Date: 2025-08-22BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110807253.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-16
Publication Date
2025-08-22
Estimated Expiration
2041-07-16

AI Technical Summary

Technical Problem

The mini program's mode rendering flexibility is not high, and users cannot change the rendering mode in time, resulting in poor user experience.

Method used

By obtaining the user's touch instructions, obtaining the configuration information of the target mode, and configuring the identification information on the front end of the applet based on the configuration information, extracting and rendering the display information, achieving flexible mode switching.

Benefits of technology

It improves the rendering flexibility of different modes of the mini program, allowing users to change the rendering mode at any time, improving the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113485630B_ABST
    Figure CN113485630B_ABST
Patent Text Reader

Abstract

The present invention provides a method, device and storage medium for mini-program mode management and control, which obtains a touch instruction for a target mode; obtains configuration information of the target mode in response to the touch instruction; configures identification information of the target mode through the mini-program front end based on the configuration information; extracts display information of the target mode corresponding to the current page based on the identification information; and renders and displays the display information in the target mode. Since the user's touch instruction for the target mode is first obtained, and then the corresponding target mode parameter information and target mode identification information are formed based on the touch instruction, and then the mode rendering of the current page of the mini-program is performed, the user can input touch instructions of different modes at any time to render the mini-program in different modes, thereby improving the rendering flexibility of different modes of the mini-program.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of computer and software technology, and in particular to a mini-program mode management method, device and storage medium. Background Art

[0002] Mini programs are apps that can be used without installation, embodying the concept of "use it and go." Users don't need to worry about installing too many apps. Apps will be ubiquitous and available at any time, but there's no need to install or uninstall them. Dark mode is a high-contrast mode that's ideal for viewing phones in dark environments. Unlike traditional black text on a white background, dark mode makes viewing a phone for extended periods at night less uncomfortable and more comfortable.

[0003] Mini Program mode rendering solutions are mainly divided into two categories: one is the native rendering component, and the other is the web view rendering component. Among them, the mode rendering of the native rendering component can be performed through the terminal operating system. Therefore, the native rendering component's rendering of the mini program is consistent with the operating system mode, making it impossible for users to change the mini program's rendering mode in a timely manner, thereby making the mini program's mode rendering less flexible. The working principle of the web view rendering component is the same as that of the native rendering component, both of which are performed through the terminal operating system, thus making the mini program's mode rendering less flexible. Summary of the Invention

[0004] The embodiments of the present invention provide a method, device, and storage medium for mini-program mode management and control, which can improve the flexibility of mini-program mode rendering.

[0005] The technical solution of the present invention is achieved as follows:

[0006] An embodiment of the present invention provides a method for managing and controlling a mini-program mode, including:

[0007] Get touch commands for the target mode;

[0008] In response to the touch instruction, acquiring configuration information of the target mode; the configuration information includes relevant information corresponding to identification information of multiple modes of the mini program;

[0009] Based on the configuration information, configure the identification information of the target mode through the mini program front end;

[0010] Based on the identification information, extracting display information of the target mode corresponding to the current page;

[0011] In the target mode, the display information is rendered and displayed.

[0012] In the above solution, obtaining the touch control instruction for the target mode includes:

[0013] A startup instruction for starting the applet in the target mode is obtained, and the startup instruction serves as the touch instruction.

[0014] In the above solution, the step of obtaining the configuration information of the target mode in response to the touch instruction includes:

[0015] In response to the touch instruction, opening the mini program in the mini program's host application;

[0016] When the applet is started, the configuration information of the applet is loaded.

[0017] In the above solution, after loading the configuration information of the mini-program when the mini-program is started, the method further includes:

[0018] The native end of the host application reads the configuration information and detects whether the configuration information includes parameter information of the target mode.

[0019] In the above solution, after the native end of the host application reads the configuration information and detects whether the configuration information includes the parameter information of the target mode, the method further includes:

[0020] Detecting that the configuration information includes the parameter information;

[0021] The native end of the host application responds to the touch instruction and extracts the parameter information from the configuration information.

[0022] In the above solution, configuring the identification information of the target mode through the mini-program front end based on the configuration information includes:

[0023] The native end of the host application adds the identification information to the front-end tag tree of the mini program based on the parameter information in the configuration information.

[0024] In the above solution, obtaining the touch control instruction for the target mode includes:

[0025] A touch instruction for starting the mini program is obtained, and a trigger instruction for the target mode is obtained when the mini program is in the started state.

[0026] In the above solution, after obtaining the configuration information of the target mode in response to the touch instruction, and before configuring the identification information of the target mode through the mini-program front end based on the configuration information, the method further includes:

[0027] The host application responds to the trigger instruction, updates the current mode parameter information to the parameter information, and generates mode change event information;

[0028] The native end of the host application transmits the mode change event information to the front end of the mini program and updates the parameter information in the configuration information; the mode change event information includes the parameter information.

[0029] In the above solution, extracting the display information of the target mode corresponding to the current page based on the identification information includes:

[0030] Extracting the target mode related information from the configuration information through the text object model of the applet and the identification information;

[0031] Acquire multiple element identification information of multiple elements of the current page; the multiple elements represent multiple display contents of the current page;

[0032] A plurality of display information corresponding to the plurality of element identification information is extracted from the target mode related information.

[0033] In the above solution, after extracting the plurality of display information corresponding to the plurality of element identification information from the target mode related information, and before rendering and displaying the display information in the target mode, the method further includes:

[0034] Obtaining multiple position information of the multiple elements;

[0035] The rendering and displaying of the display information in the target mode includes:

[0036] In the target mode, the plurality of display information is rendered and displayed at the plurality of position information.

[0037] In the above solution, after the native end of the host application reads the configuration information and detects whether the configuration information includes the parameter information of the target mode, the method further includes:

[0038] detecting that the configuration information does not include the parameter information, thereby forming original execution information;

[0039] Based on the original execution information, obtaining original mode parameter information in the configuration information;

[0040] Based on the original mode parameter information, configure the original mode identification information through the mini program front-end configuration;

[0041] Extracting original display information of the original mode corresponding to the current page based on the original mode identification information;

[0042] In the original mode, the original display information is rendered and displayed.

[0043] An embodiment of the present invention further provides a mini-program mode management and control device, comprising:

[0044] The native end is configured to obtain a touch control instruction for a target mode; and in response to the touch control instruction, obtain configuration information of the target mode;

[0045] The rendering layer is used to configure the identification information of the target mode through the mini program front end based on the configuration information; based on the identification information, extract the display information of the target mode corresponding to the current page; and render and display the display information in the target mode.

[0046] An embodiment of the present invention further provides a mode control device, comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and the processor implements the steps in the above method when executing the program.

[0047] An embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which implements the steps in the above method when executed by a processor.

[0048] In an embodiment of the present invention, a touch instruction for a target mode is obtained; in response to the touch instruction, configuration information of the target mode is obtained; based on the configuration information, identification information of the target mode is configured through the mini-program front end; based on the identification information, display information of the target mode corresponding to the current page is extracted; and in the target mode, the display information is rendered and displayed. Since the user's touch instruction for the target mode is first obtained, and then the corresponding target mode parameter information and target mode identification information are formed based on the touch instruction, and then the mode rendering of the current page of the mini-program is performed, the user can input touch instructions of different modes at any time to render the mini-program in different modes, thereby improving the flexibility of rendering different modes of the mini-program. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 An optional flowchart of the mini-program mode management method provided in an embodiment of the present invention;

[0050] Figure 2 A schematic diagram of an optional effect of the mini-program mode management and control method provided by an embodiment of the present invention;

[0051] Figure 3 An optional flowchart of the mini-program mode management method provided in an embodiment of the present invention;

[0052] Figure 4 An optional flowchart of the mini-program mode management method provided in an embodiment of the present invention;

[0053] Figure 5An optional flowchart of the mini-program mode management method provided in an embodiment of the present invention;

[0054] Figure 6 An optional flowchart of the mini-program mode management method provided in an embodiment of the present invention;

[0055] Figure 7 An optional flowchart of the mini-program mode management method provided in an embodiment of the present invention;

[0056] Figure 8 A schematic diagram of the structure of a mini-program mode control device provided by an embodiment of the present invention;

[0057] Figure 9 A schematic diagram of a hardware entity of the mini-program mode control device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0058] In order to make the purpose, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention are further elaborated in detail below with reference to the accompanying drawings and embodiments. The described embodiments should not be regarded as limiting the present invention. All other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0059] In the following description, reference is made to “some embodiments”, which describes a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0060] If similar descriptions of "first / second" appear in the invention document, the following explanation is added. In the following description, the terms "first\second\third" involved are only used to distinguish similar objects and do not represent a specific order for the objects. It can be understood that "first\second\third" can be interchanged with the specific order or sequence where permitted, so that the embodiments of the invention described herein can be implemented in an order other than that illustrated or described herein.

[0061] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which the present invention pertains. The terms used herein are for the purpose of describing embodiments of the present invention only and are not intended to limit the present invention.

[0062] Figure 1 An optional flow chart of the mini-program mode management method provided in the embodiment of the present invention will be combined with Figure 1 The steps shown are explained.

[0063] S101: Acquire a touch instruction for a target mode.

[0064] In an embodiment of the present invention, a terminal receives a touch command sent to the terminal by a target object. The touch command includes a single-click or double-click operation by the target object on a host application on the terminal. The touch command includes an instruction for the target object to launch a mini-program on the terminal, and may also include a trigger instruction for rendering the current mode into a target mode. For example, the target mode may be a white mode or a dark mode.

[0065] In the embodiment of the present invention, the terminal is configured with host software, and the applet is a program on the host software that can be used without downloading.

[0066] In an embodiment of the present invention, a target user can launch the mini-program via a touch command within the host application on the terminal. After the target user launches the mini-program and the mini-program has been running in the current mode for a period of time, the target user can send a target mode trigger command to the terminal by clicking the target mode button on the terminal system. This trigger command indicates that the current mode is updated to the target mode.

[0067] In the embodiment of the present invention, the target object first clicks the target mode button on the native page of the host application on the terminal, and then the terminal obtains the target mode trigger instruction. After the terminal obtains the target mode trigger instruction, the target object then opens the mini program through the host application.

[0068] S102 : Responding to the touch command, obtaining configuration information of the target mode.

[0069] In the embodiment of the present invention, after the terminal obtains the touch command, the terminal responds to the touch command and opens the applet. While opening the applet, the terminal loads the configuration information of the target mode.

[0070] The configuration information of the target mode can be a data packet. The configuration information includes relevant information corresponding to the identification information of multiple modes of the mini-program. The configuration information can include parameter information of the target mode, which can be a string.

[0071] In the embodiment of the present invention, after the terminal obtains the touch command, the terminal changes the current mode parameter information of the host application to the parameter information of the target mode, and the host application of the terminal sends the target mode parameter information to the mini program.

[0072] S103. Based on the configuration information, configure the identification information of the target mode through the mini program front end.

[0073] In an embodiment of the present invention, if the configuration information of the mini-program in the terminal includes parameter information of the target mode or the mini-program receives parameter information of the target mode sent by the host application, the terminal responds to a preset program instruction and adds identification information of the target mode to the tag tree of the mini-program.

[0074] The identification information of the target mode may be a character string.

[0075] S104: Extracting display information of the target mode corresponding to the current page based on the identification information.

[0076] In the embodiment of the present invention, the rendering layer of the terminal applet extracts the display information of the current page, that is, the target mode related information, from the configuration information based on the identification information of the target mode. Then, the terminal displays the display information of the current page of the applet in the target mode.

[0077] In the embodiment of the present invention, the document object model tree of the terminal applet extracts the display information of the current page from the configuration information according to the identification information of the target mode, and the terminal displays the current page in the target mode according to the display information of the current page.

[0078] In an embodiment of the present invention, the terminal applet's document object model tree obtains the location information of multiple elements on the current page. The terminal applet's document object model tree extracts multiple display information corresponding to the multiple elements from the configuration file and displays them. The multiple display information is also the target mode display information.

[0079] S105: Render and display the display information in target mode.

[0080] In the embodiment of the present invention, after the rendering layer of the terminal obtains the display information of the current page, it displays the display information in the target mode according to a preset procedure.

[0081] For example, combined Figure 2 After the target object sends a touch command to the terminal, when the terminal opens the mini-program, the page manager of the mini-program front-end rendering layer initializes the mini-program page. The mini-program injects the configuration file through the page controller. The mini-program front-end sets the target mode parameter information based on the received target mode touch command. The mini-program front-end adds or deletes the corresponding identifier in the tag tree. The document object model tree of the mini-program front-end performs the initial rendering of the mini-program based on this identifier.

[0082] Combine Figure 2Correspondingly, after the target object opens the mini program, the target object sends a trigger instruction for the target mode to the terminal. The host application sends a mode change event to the mini program's page manager. The mini program's page manager passes the mode change event to the page controller. The mini program's front-end page component listens to the mode change event and extracts the target mode parameter information in the mode change event. The mini program's front-end configures the addition or deletion of corresponding identifiers in the tag tree based on the target mode parameter information. The mini program's front-end style redrawing component renders the mini program's style based on the identifier.

[0083] Combine Figure 2 The logic layer of the mini-program frontend listens for the host application's mode change event and passes it to the frontend's event framework. The event framework then chooses whether to mount or unmount the event. The mini-program frontend's development data interface retrieves the response data packet and executes the event.

[0084] In an embodiment of the present invention, a touch instruction for a target mode is obtained; in response to the touch instruction, configuration information of the target mode is obtained; based on the configuration information, identification information of the target mode is configured through the mini-program front end; based on the identification information, display information of the target mode corresponding to the current page is extracted; and in the target mode, the display information is rendered and displayed. Since the user's touch instruction for the target mode is first obtained, and then the corresponding target mode parameter information and target mode identification information are formed based on the touch instruction, and then the mode rendering of the current page of the mini-program is performed, the user can input touch instructions of different modes at any time to render the mini-program in different modes, thereby improving the flexibility of rendering different modes of the mini-program.

[0085] In some embodiments, see Figure 3 , Figure 3 An optional flowchart of the mini-program mode management method provided in an embodiment of the present invention is provided. Figure 1 The illustrated S101 can also be implemented through S106 to S112 , which will be described in conjunction with each step.

[0086] S106: Obtain a startup instruction for starting the applet in the target mode, and use the startup instruction as a touch instruction.

[0087] In an embodiment of the present invention, the target object is pre-set with a target mode in the terminal settings or the host application settings. The terminal obtains a start instruction of the mini-program of the target object in the target mode, which is also a touch instruction of the mini-program in the target mode.

[0088] S107 . In response to the touch command, the mini program is opened in the mini program's host application.

[0089] In an embodiment of the present invention, a host application is installed on a terminal, which includes a mini-program. A target user first launches the host application through the terminal's human-computer interaction device. The target user then sends a touch command on the host application's page, and the terminal responds to the touch command and launches the mini-program.

[0090] In an embodiment of the present invention, the target object can find the mini program in the host application page and send a touch instruction by single-clicking or double-clicking the mini program button. After the terminal obtains the touch instruction, it opens the mini program.

[0091] S108. When the mini program is started, the configuration information of the mini program is loaded; the configuration information includes relevant information corresponding to the identification information of multiple modes of the mini program.

[0092] In the embodiment of the present invention, when the terminal opens the mini-program, the terminal loads the configuration information of the mini-program into the local storage.

[0093] Among them, the configuration information includes relevant information corresponding to the identification information of multiple modes of the mini program.

[0094] S109: The native end of the host application reads the configuration information and detects whether the configuration information includes parameter information of the target mode.

[0095] In an embodiment of the present invention, after the terminal loads the mini-program configuration information, the native host application of the mini-program reads the mini-program configuration information and detects whether parameter information corresponding to the target mode exists in the configuration information.

[0096] In this embodiment of the present invention, the initial rendering is performed when the mini program is opened. When the mini program page is initially rendered, the native end injects configuration information, which may include parameter information for the dark mode. The dark mode is also the target mode.

[0097] In this embodiment of the present invention, during the mini-program startup phase, the mini-program downloads its configuration information and prepares to load it. At this point, the host application's native client reads the mini-program's configuration information and checks whether it contains parameters for dark mode. If so, it reads the dark mode configuration information and renders the mini-program; otherwise, it reads the day mode configuration information and renders the mini-program.

[0098] S110: Detect and obtain that the configuration information includes parameter information.

[0099] In the embodiment of the present invention, the native end of the host application detects and obtains parameter information of the target mode in the configuration information.

[0100] The parameter information of the target mode may be parameter information representing a dark mode, or parameter information representing a light mode. For example, the parameter information may be "0102".

[0101] S111. The native end of the host application responds to the touch command and extracts parameter information from the configuration information.

[0102] In the embodiment of the present invention, the native end of the terminal host application responds to the touch instruction of the target mode and extracts the parameter information of the target mode from the configuration information.

[0103] S112. The native end of the host application adds identification information to the front-end tag tree of the mini program based on the parameter information in the configuration information.

[0104] In an embodiment of the present invention, the native end of the host application on the terminal responds to a preset program and adds identification information of the target mode in the tag tree of the mini program according to the parameter information of the target mode.

[0105] In this embodiment of the present invention, the native host application injects the current target mode parameter information into the mini-program startup configuration parameter file before rendering the mini-program page. Specifically, the native host application adds the class: dark corresponding to the target mode parameter information to the mini-program's tag tree. The mini-program's document object model tree then renders the mini-program based on this class.

[0106] For example, combined Figure 4 , which is an optional flow chart of the mini-program mode management method provided by an embodiment of the present invention. It will be described in conjunction with each step.

[0107] S201. Open the mini program.

[0108] In the embodiment of the present invention, the target object opens the mini-program through the host application on the terminal.

[0109] S202: Load the mini-program package.

[0110] In the embodiment of the present invention, the applet loads the applet package, that is, the configuration information.

[0111] S203: Read the applet configuration file.

[0112] In an embodiment of the present invention, the front end of the host application reads the mini-program configuration file.

[0113] S204: Dark mode.

[0114] In the embodiment of the present invention, the front end of the host application detects whether the configuration file contains data related to the dark mode. In this case, the dark mode is the target mode.

[0115] S205: Read the mini program night mode.

[0116] In an embodiment of the present invention, if the host application front end detects dark mode related data, the dark mode related data is configured in the mini program front end.

[0117] S206: Read the mini program daytime mode.

[0118] In an embodiment of the present invention, if the host application front end does not detect dark mode related data, other mode related data, such as mini program day mode related data, is extracted from the configuration file.

[0119] S207. Mini program configuration.

[0120] S208. The server injects target mode parameter information.

[0121] In an embodiment of the present invention, the front-end rendering layer of the mini program renders the mini program according to the dark mode related data, including: the mini program server injects target mode parameter information.

[0122] S209: Inject target mode parameter information into the web page view.

[0123] S210, page rendering.

[0124] In an embodiment of the present invention, the mini-program web page view injects target mode parameter information to perform page rendering of the mini-program.

[0125] In some embodiments, see Figure 5 , Figure 5 An optional flowchart of the mini-program mode management method provided in an embodiment of the present invention is provided. Figure 1 The illustrated S101 can also be implemented through S113 , which will be described in conjunction with each step.

[0126] S113: Acquire a touch instruction for starting the mini-program, and acquire a trigger instruction for the target mode when the mini-program is in the startup state.

[0127] In the embodiment of the present invention, the target object first sends a touch instruction to start the mini-program to the terminal. After the mini-program has been started for a period of time, the target object then sends a trigger instruction for the target mode to the terminal.

[0128] The touch instruction may be a single click or double click of the target object on a mini-program button of the host application. The trigger instruction may be a single click or double click of the target object on a button of a target mode set in the host application or the terminal.

[0129] In some embodiments, see Figure 5 , Figure 5 An optional flowchart of the mini-program mode management method provided in an embodiment of the present invention is provided. Figure 1 The steps S102 to S103 shown also include S114 to S115 , which will be described in conjunction with each step.

[0130] S114 : The host application responds to the trigger instruction, updates the current mode parameter information to the parameter information, and generates mode change event information.

[0131] In an embodiment of the present invention, a host application on a terminal launches a mini-program based on a touch command obtained from a target object. The terminal then loads the mini-program configuration information. After the mini-program has run for a period of time, the terminal receives a trigger instruction for a target mode transmitted by the target object. The host application responds to the target mode trigger instruction by changing the current mode parameter information to the target mode parameter information. The host application native terminal generates mode change event information based on the target mode parameter information.

[0132] The mode change event information includes parameter information of the target mode.

[0133] In an embodiment of the present invention, during the mini-program running phase, the host application changes the dark mode parameter information based on the system or application internal configuration. The host application notifies the mini-program mode management module through a communication mechanism, and then notifies the opened mini-program through multi-process communication. The opened mini-program has registered a mode listener during the startup phase, and adjusts the current page by listening for dark mode changes. In other words, the target mode parameter information in the mode change event information is obtained, and then rendering is performed according to the target mode parameter information.

[0134] S115. The native end of the host application transmits the mode change event information to the front end of the mini program, and updates the parameter information in the configuration information; the mode change event information includes the parameter information.

[0135] In an embodiment of the present invention, the native end of the host application transmits mode change event information to the mini-program front end, and updates the parameter information in the mini-program configuration information; wherein the mode change event information includes the target mode parameter information.

[0136] In some embodiments, see Figure 5 , Figure 5An optional flowchart of the mini-program mode management method provided in an embodiment of the present invention is provided. Figure 1 S104 to S105 shown can also be implemented through S116 to S120, which will be explained in conjunction with each step.

[0137] S116. Extract target mode related information from the configuration information through the text object model and identification information of the applet.

[0138] In the embodiment of the present invention, when the mini program of the terminal is rendering, the text object model tree of the mini program extracts target mode related information from the configuration information based on the identification information of the target mode.

[0139] The target mode related information represents the display content information of the corresponding applet.

[0140] S117: Acquire multiple element identification information of multiple elements of the current page; the multiple elements represent multiple display contents of the current page.

[0141] In an embodiment of the present invention, the document object model tree of the mini-program obtains multiple element identification information of multiple elements in the current page of the mini-program.

[0142] The element represents the display content of the current page. For example, the element can be a text message in the current page. The element identification information can be a string of characters corresponding to the element.

[0143] S118. Extract multiple display information corresponding to multiple element identification information from the target mode related information.

[0144] In the embodiment of the present invention, the document object model tree of the applet extracts multiple display information of multiple elements from the target mode related information according to the identification information of the multiple elements.

[0145] The target mode related information includes multiple display information of multiple elements, wherein each display information includes identification information of the corresponding element.

[0146] S119. Obtain multiple position information of multiple elements.

[0147] In the embodiment of the present invention, the document object model tree of the mini-program obtains multiple location information corresponding to multiple elements in the basic data package of the mini-program.

[0148] Among them, the basic data package includes all relevant data information of the mini program.

[0149] S120 : In target mode, render and display multiple display information at multiple location information.

[0150] In the embodiment of the present invention, the rendering layer of the document object model of the applet displays the multiple display information of the multiple elements at the positions of the corresponding elements.

[0151] For example, combined Figure 6 , Figure 6 This is an optional flowchart of the mini-program mode management method provided by an embodiment of the present invention. Each step will be described.

[0152] S211. Update the dark value.

[0153] In the embodiment of the present invention, the host application of the terminal responds to the target mode touch instruction and updates the mode value of the native terminal to a dark value.

[0154] S212: Notify the mini program of the mode change event.

[0155] In an embodiment of the present invention, the native end of the host application notifies the front end of the mini program that a mode change event has occurred.

[0156] S213. Notify all opened mini-programs.

[0157] In an embodiment of the present invention, the native end of the host software sends mode change event information to all opened mini-programs.

[0158] S214. Update the native page of the mini program.

[0159] S215, Settings, About, History, etc.

[0160] In an embodiment of the present invention, the mini program updates the mini program native page according to the mode change event information, and configures the target mode for the settings page, about page, and history page.

[0161] S216. Update the native components of the mini program.

[0162] S217, conversation chat, etc.

[0163] S218. Update page control.

[0164] S219. Read the applet configuration file.

[0165] S220. Update the opened mini program page.

[0166] S221. Update service.

[0167] S222: Target mode parameter information.

[0168] S223. Update the web page view.

[0169] S224: Target mode parameter information.

[0170] S225, front-end page rendering.

[0171] In some embodiments, see Figure 7 , Figure 7 An optional flowchart of the mini-program mode management method provided in an embodiment of the present invention is provided. Figure 3 The illustrated S109 also includes S121 to S125, which will be described in conjunction with each step.

[0172] S121. Detect that the configuration information does not include parameter information, thereby forming original execution information.

[0173] In the embodiment of the present invention, the native terminal of the host application on the terminal detects that the configuration information does not include parameter information of the target mode. Then, the terminal executes a preset program to form original execution information.

[0174] The original execution information represents the display information of the applet in the original mode.

[0175] Exemplarily, the target mode is dark mode, and the native detection configuration information of the host application does not include parameter information of the dark mode.

[0176] S122. Based on the original execution information, obtain original mode parameter information in the configuration information.

[0177] In the embodiment of the present invention, the native end of the host application of the terminal executes a preset program based on the original execution information and extracts the original mode parameter information in the configuration information.

[0178] Exemplarily, the native end of the host application extracts the white mode parameter information in the configuration information.

[0179] S123. Based on the original mode parameter information, configure the original mode identification information through the mini program front-end configuration.

[0180] In an embodiment of the present invention, the native end of the host application configures the original mode identification information in the front-end tag tree of the mini program based on the original mode parameter information.

[0181] S124. Extracting original display information of the original mode corresponding to the current page based on the original mode identification information.

[0182] In the embodiment of the present invention, the document object model tree of the applet extracts multiple display information corresponding to multiple elements in the original mode from the configuration information according to the original model identification information.

[0183] S125. Render and display the original display information in the original mode.

[0184] See also Figure 8 , which is a structural diagram of the mini-program mode control device provided in an embodiment of the present invention.

[0185] An embodiment of the present invention further provides a mini-program mode management and control device 800 , comprising: a native end 803 and a rendering layer 804 .

[0186] The native terminal 803 is configured to obtain a touch control instruction for a target mode; and in response to the touch control instruction, obtain configuration information of the target mode;

[0187] The rendering layer 804 is used to configure the identification information of the target mode through the mini program front end based on the configuration information; based on the identification information, extract the display information of the target mode corresponding to the current page; and render and display the display information in the target mode.

[0188] In the embodiment of the present invention, the native end 803 in the mini-program mode management and control device 800 is used to obtain a startup instruction for starting the mini-program in the target mode, and the startup instruction serves as the touch instruction.

[0189] In an embodiment of the present invention, the native end 803 in the mini-program mode control device 800 is used to respond to the touch instruction and start the mini-program in the host application of the mini-program; when the mini-program is started, the configuration information of the mini-program is loaded.

[0190] In an embodiment of the present invention, the native end 803 in the mini program mode control device 800 is used as the native end of the host application to read the configuration information and detect whether the configuration information includes the parameter information of the target mode.

[0191] In an embodiment of the present invention, the native end 803 in the mini program mode management and control device 800 is used to detect that the configuration information includes the parameter information; the native end of the host application responds to the touch instruction and extracts the parameter information from the configuration information.

[0192] In an embodiment of the present invention, the rendering layer 804 in the mini program mode control device 800 is used by the native end of the host application to add the identification information in the front-end tag tree of the mini program based on the parameter information in the configuration information.

[0193] In an embodiment of the present invention, the native end 803 in the mini-program mode management and control device 800 is used to obtain a touch instruction for starting the mini-program, and obtain a trigger instruction for the target mode when the mini-program is in the startup state.

[0194] In an embodiment of the present invention, the native end 803 in the mini program mode control device 800 is used for the host application to respond to the trigger instruction, update the current mode parameter information to the parameter information, and form mode change event information; the native end of the host application transmits the mode change event information to the front end of the mini program, and updates the parameter information in the configuration information; the mode change event information includes the parameter information.

[0195] In an embodiment of the present invention, the rendering layer 804 in the mini program mode control device 800 is used to extract the target mode related information from the configuration information through the text object model of the mini program and the identification information; obtain multiple element identification information of multiple elements of the current page; the multiple elements represent multiple display contents of the current page; and extract multiple display information corresponding to the multiple element identification information from the target mode related information.

[0196] In an embodiment of the present invention, the rendering layer 804 in the mini program mode management and control device 800 is used to obtain multiple position information of the multiple elements; in the target mode, the multiple display information is rendered and displayed at the multiple position information.

[0197] In an embodiment of the present invention, the native end 803 in the mini program mode control device 800 is used to detect that the configuration information does not include the parameter information, and then form the original execution information; based on the original execution information, the original mode parameter information in the configuration information is obtained; in an embodiment of the present invention, the rendering layer 804 in the mini program mode control device 800 is used to configure the original mode identification information based on the original mode parameter information through the mini program front-end configuration; based on the original mode identification information, the original display information of the original mode corresponding to the current page is extracted; in the original mode, the original display information is rendered and displayed.

[0198] In an embodiment of the present invention, a touch instruction for a target mode is obtained through the native terminal 803; the native terminal 803 obtains configuration information of the target mode in response to the touch instruction; the identification information of the target mode is configured through the mini-program front end based on the configuration information through the rendering layer 804; the display information of the target mode corresponding to the current page is extracted through the rendering layer 804 based on the identification information; and the display information is rendered and displayed in the target mode through the rendering layer 804. Since the touch instruction of the user's target mode is first obtained, and then the corresponding target mode parameter information and target mode identification information are formed based on the touch instruction, and then the mode rendering of the current page of the mini-program is performed, the user can input touch instructions of different modes at any time to render the mini-program in different modes, thereby improving the rendering flexibility of different modes of the mini-program.

[0199] It should be noted that, in the embodiment of the present invention, if the above-mentioned mini-program mode control method is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention, or the part that contributes to the relevant technology, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a mode control device (which can be a personal computer, etc.) to execute all or part of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a magnetic disk or an optical disk. In this way, the embodiment of the present invention is not limited to any specific combination of hardware and software.

[0200] Correspondingly, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which implements the steps in the above method when executed by a processor.

[0201] Correspondingly, an embodiment of the present invention provides a mini-program mode management and control device, including a memory 802 and a processor 801, wherein the memory 802 stores a computer program that can be run on the processor 801, and the processor 801 implements the steps in the above method when executing the program.

[0202] It should be noted that the description of the above storage medium and device embodiments is similar to the description of the above method embodiments and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium and device embodiments of the present invention, please refer to the description of the method embodiments of the present invention for understanding.

[0203] It should be noted that Figure 9 A hardware entity diagram of a mini-program mode control device provided by an embodiment of the present invention, such as Figure 9 As shown, the hardware entity of the mini-program mode control device 800 includes: a processor 801 and a memory 802, wherein;

[0204] The processor 801 generally controls the overall operation of the mini-program mode management device 800 .

[0205] The memory 802 is configured to store instructions and applications executable by the processor 801, and can also cache data to be processed or processed by the processor 801 and each module in the mini-program mode control device 800 (for example, image data, audio data, voice communication data and video communication data), which can be implemented through flash memory (FLASH) or random access memory (Random Access Memory, RAM).

[0206] It should be understood that "one embodiment" or "an embodiment" mentioned throughout the specification means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present invention. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present invention, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention. The serial numbers of the above-mentioned embodiments of the present invention are for description only and do not represent the advantages and disadvantages of the embodiments.

[0207] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.

[0208] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0209] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed across multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the scheme of this embodiment.

[0210] In addition, all functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0211] Those skilled in the art will understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiments; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM), magnetic disks or optical disks, and other media that can store program codes.

[0212] Alternatively, if the above-mentioned integrated unit of the present invention is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention, or the part that contributes to the relevant technology, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks, or optical disks.

[0213] The above description is merely an embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present invention should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.

Claims

1. A method for controlling a mini-program mode, characterized in that: include: Obtaining a touch command for the target mode; the touch command is used to open the mini-program and render the current mode into the target mode; In response to the touch instruction, the configuration information of the target mode is obtained, and the current mode parameter information of the host application is changed to the parameter information in the configuration information of the target mode, and the host application sends the parameter information of the target mode to the mini program; the configuration information includes relevant information corresponding to the identification information of multiple modes of the mini program; Based on the configuration information, configure the identification information of the target mode through the mini program front end; Based on the identification information, extracting display information of the target mode corresponding to the current page; In the target mode, the display information is rendered and displayed.

2. The mini program mode management and control method according to claim 1, characterized in that: The acquiring of the touch control instruction for the target mode includes: A startup instruction for starting the applet in the target mode is obtained, and the startup instruction serves as the touch instruction.

3. The mini program mode management and control method according to claim 1, characterized in that: The acquiring, in response to the touch instruction, configuration information of the target mode includes: In response to the touch instruction, opening the mini-program in the host application of the mini-program; When the applet is started, the configuration information of the applet is loaded.

4. The mini program mode management and control method according to claim 3, characterized in that: When the mini-program is started, after loading the configuration information of the mini-program, the method further includes: The native end of the host application reads the configuration information and detects whether the configuration information includes parameter information of the target mode.

5. The mini program mode management and control method according to claim 4, characterized in that: After the native end of the host application reads the configuration information and detects whether the configuration information includes parameter information of the target mode, the method further includes: Detecting that the configuration information includes the parameter information; The native end of the host application responds to the touch instruction and extracts the parameter information from the configuration information.

6. The mini program mode management and control method according to claim 5, characterized in that: Configuring identification information of the target mode through the mini-program front end based on the configuration information includes: The native end of the host application adds the identification information to the front-end tag tree of the mini program based on the parameter information in the configuration information.

7. The mini program mode management and control method according to claim 3, characterized in that: The acquiring of the touch control instruction for the target mode includes: A touch instruction for starting the mini program is obtained, and a trigger instruction for the target mode is obtained when the mini program is in the started state.

8. The mini program mode management method according to any one of claims 1 to 7, characterized in that: The extracting, based on the identification information, display information of the target mode corresponding to the current page includes: Extracting the target mode related information from the configuration information through the text object model of the applet and the identification information; Acquire multiple element identification information of multiple elements of the current page; the multiple elements represent multiple display contents of the current page; A plurality of display information corresponding to the plurality of element identification information is extracted from the target mode related information.

9. The mini program mode management and control method according to claim 8, characterized in that: After extracting the plurality of display information corresponding to the plurality of element identification information from the target mode related information, and before rendering and displaying the display information in the target mode, the method further includes: Obtaining multiple position information of the multiple elements; The rendering and displaying of the display information in the target mode includes: In the target mode, the plurality of display information is rendered and displayed at the plurality of position information.

10. The mini program mode management and control method according to claim 4, characterized in that: After the native end of the host application reads the configuration information and detects whether the configuration information includes parameter information of the target mode, the method further includes: detecting that the configuration information does not include the parameter information, thereby forming original execution information; Based on the original execution information, obtaining original mode parameter information in the configuration information; Based on the original mode parameter information, configure the original mode identification information through the mini program front-end configuration; Extracting original display information of the original mode corresponding to the current page based on the original mode identification information; In the original mode, the original display information is rendered and displayed.

11. A mini-program mode control device, characterized in that: include: The native end is used to obtain touch instructions for the target mode; the touch instructions are used to open the mini program and render the current mode into the target mode; In response to the touch instruction, obtaining the configuration information of the target mode, and changing the current mode parameter information of the host application to the parameter information in the configuration information of the target mode, and the host application sending the parameter information of the target mode to the mini program; The rendering layer is used to configure the identification information of the target mode through the mini-program front end based on the configuration information; based on the identification information, extract the display information of the target mode corresponding to the current page; In the target mode, the display information is rendered and displayed.

12. A mini-program mode control device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the program, the steps in the method according to any one of claims 1 to 10 are implemented.

13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.

Citation Information

Patent Citations

  • Method and equipment for presenting hosting program

    CN110321192A

  • Page rendering method and device based on applet, equipment and storage medium

    CN112861057A