Method, device, electronic device and storage medium for generating mini program display interface
By receiving layout files and parsing and rendering the mini-program display interface when the target application of the electronic device is started, the problem of difficulty in updating the mini-program display interface in the existing technology is solved, flexible configuration and AB testing are realized, and the intelligence of the electronic device is improved. and user experience.
Patent Information
- Application Number
- CN201911426175.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-12-31
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2040-02-23
AI Technical Summary
The existing applet display interface lacks flexible configuration capabilities when the application is started, making it difficult to achieve rapid updates and AB testing, which affects the intelligence and user experience of electronic devices.
When the target application of the first electronic device is started, a data request is sent to the second electronic device to receive the layout file, and a mini program display interface is generated through visual component analysis and rendering, and the interface is dynamically updated using historical data and account interactive data to ensure that The interface can be updated every time it starts.
It realizes flexible configuration and rapid update of the mini program display interface, which facilitates developers to conduct AB testing, and improves the intelligence and user experience of electronic devices.
Smart Images

Figure CN113127115B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet technology, specifically to the field of interface generation technology, and in particular to a method for generating a mini-program display interface, a device for generating a mini-program display interface, an electronic device and a computer storage medium. Background Art
[0002] With the advancement of electronic technology, electronic devices are getting smaller and smaller, which makes the use of electronic devices more and more. Applications in electronic devices are gradually showing more and more functions. Current applications have the characteristics of fast response speed and rich functions. Specifically, an application can be set up with a small program module, and users can perform different operations through the small program module to meet the user's diverse usage needs. Summary of the invention
[0003] An embodiment of the present invention provides a method, device, electronic device and computer storage medium for generating a mini-program display interface. When a first electronic device starts a target application, it generates a mini-program display interface by receiving a layout file sent by a second electronic device, which is conducive to the flexible configuration of the mini-program display interface and enhances the intelligence of the electronic device.
[0004] On the one hand, an embodiment of the present invention provides a method for generating a mini-program display interface, the method for generating a mini-program display interface comprising:
[0005] When the target application in the first electronic device is started, sending a data request to the second electronic device;
[0006] Receiving the layout file sent by the second electronic device;
[0007] Parsing the layout file through visual components to generate view information;
[0008] When a display request for the mini-program display interface is detected, a rendering operation is performed on the view information by the visual component to generate the mini-program display interface.
[0009] The layout file is composed of a JSON string, and the JSON string is generated according to the TypeScript code entered into the second electronic device.
[0010] Wherein, the visual component is a graphic display component arranged in the target application.
[0011] Wherein, the electronic device runs an Android operating system, and the visual component is a WebView component.
[0012] Wherein, after generating the view information and before performing the rendering operation on the view information by the visual component, the method further includes:
[0013] Obtain historical data of a first account currently logged in by the target application;
[0014] Determine a preset number of mini-programs to be recommended based on the historical data;
[0015] The view information is updated according to the preset number of mini-programs to be recommended, so that the mini-program display interface generated by performing a rendering operation on the view information includes the preset number of mini-programs to be recommended.
[0016] The historical data includes the usage time of at least one mini program within a preset time period before the current time point, and determining the preset number of mini programs to be recommended based on the historical mini program usage data includes:
[0017] Sort the at least one mini program according to the usage time of each mini program in the at least one mini program to obtain a mini program sequence corresponding to the at least one mini program;
[0018] Determine the first preset number of mini-programs in the mini-program sequence as the preset number of mini-programs to be recommended.
[0019] The historical data includes a usage time interval of at least one mini program within a preset time period before the current time point, and the preset time period is greater than a natural day. The determining of a preset number of mini programs to be recommended based on the historical mini program usage data includes:
[0020] Determine a first time range according to the current time point;
[0021] Determine the cumulative usage time of each mini program in the at least one mini program within the first time range according to the usage time interval of the at least one mini program within the preset time period;
[0022] Sorting the at least one mini program according to the accumulated usage time of each mini program to obtain a mini program sequence corresponding to the at least one mini program;
[0023] Determine the first preset number of mini-programs in the mini-program sequence as the preset number of mini-programs to be recommended.
[0024] Wherein, after generating the view information and before performing the rendering operation on the view information by the visual component, the method further includes:
[0025] Determining at least one second account that interacted with the first account within a preset time period before the current time point;
[0026] Determine a mini program corresponding to each second account in the at least one second account;
[0027] The view information is updated according to a mini program corresponding to each second account, so that the mini program display interface generated by performing a rendering operation on the view information includes a mini program corresponding to each second account.
[0028] On the other hand, an embodiment of the present invention provides a device for generating a mini-program display interface, the device for generating a mini-program display interface comprising:
[0029] a communication unit, configured to send a data request to a second electronic device when a target application in the first electronic device is started; and to receive a layout file sent by the second electronic device;
[0030] A processing unit is used to parse the layout file through a visual component to generate view information; and when a display request for the mini-program display interface is detected, perform a rendering operation on the view information through the visual component to generate the mini-program display interface.
[0031] In another aspect, an embodiment of the present invention provides an electronic device, the electronic device comprising an input device and an output device, the electronic device further comprising:
[0032] a processor adapted to implement one or more instructions; and,
[0033] A computer storage medium storing one or more instructions, wherein the one or more instructions are suitable for being loaded by the processor and executing the following steps:
[0034] When the target application in the first electronic device is started, sending a data request to the second electronic device;
[0035] Receiving the layout file sent by the second electronic device;
[0036] Parsing the layout file through visual components to generate view information;
[0037] When a display request for the mini-program display interface is detected, a rendering operation is performed on the view information by the visual component to generate the mini-program display interface.
[0038] In another aspect, an embodiment of the present invention provides a computer storage medium, wherein the computer storage medium stores one or more instructions, wherein the one or more instructions are suitable for being loaded by a processor and executing the following steps:
[0039] When the target application in the first electronic device is started, sending a data request to the second electronic device;
[0040] Receiving the layout file sent by the second electronic device;
[0041] Parsing the layout file through visual components to generate view information;
[0042] When a display request for the mini-program display interface is detected, a rendering operation is performed on the view information by the visual component to generate the mini-program display interface.
[0043] It can be seen that in the embodiment of the present invention, when the target application in the first electronic device is started, a data request is sent to the second electronic device; a layout file sent by the second electronic device is received; the layout file is parsed by the visual component to generate view information; when a display request for the mini-program display interface is detected, a rendering operation is performed on the view information by the visual component to generate the mini-program display interface. It can be seen that in the embodiment of the present invention, when the target application program is started, the first electronic device can obtain the layout file from the second electronic device, and then perform parsing and rendering operations according to the layout file to generate the mini-program display interface, so that the mini-program display interface can be updated according to the layout file sent by the second electronic device each time the target application is started, which is conducive to realizing the flexible configuration of the mini-program display interface; because the mini-program display interface can be updated each time the target application is started, it is convenient for the developers of the mini-program display interface to perform AB testing on the mini-program display interface, and then quickly and efficiently determine the appropriate mini-program display interface, thereby improving the intelligence of the electronic device. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.
[0045] Figure 1 is a schematic diagram of the architecture of a communication system provided by an embodiment of the present invention;
[0046] Figure 2A It is a flowchart of a method for generating a mini-program display interface provided by an embodiment of the present invention;
[0047] Figure 2B is an architecture diagram of another communication system provided by an embodiment of the present invention;
[0048] Figure 2Cis a schematic diagram of a mini-program display interface provided by an embodiment of the present invention;
[0049] Figure 2D is a schematic diagram of a small program display interface generated by static code provided by an embodiment of the present invention;
[0050] Figure 2E is a schematic diagram of a mini-program display interface generated by an ark template provided by an embodiment of the present invention;
[0051] Figure 3 is a flowchart of a method for generating a mini-program display interface provided by another embodiment of the present invention;
[0052] Figure 4 It is a structural schematic diagram of a device for generating a mini-program display interface provided by an embodiment of the present invention;
[0053] Figure 5 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0054] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0055] See also Figure 1 , Figure 1It is an architecture diagram of a communication system provided by an embodiment of the present invention, which includes an electronic device 101 and an electronic device 102; a target application is installed in the electronic device 101, a small program can be installed in the target application, and a small program display interface is set in the target application. Each time the application is started, the electronic device 101 sends a data request for the associated small program display interface to the electronic device 102; the electronic device 102 returns a layout file of the associated small program display interface to the electronic device 101, and the electronic device 101 can parse the layout file to obtain view information, and render the small program display interface according to the view information. It should be noted that the electronic device 102 can be a server, and the electronic device 102 can communicate with at least one electronic device currently logged in to the target application, and can send the layout file of the small program display interface to at least one electronic device. When the user uses the electronic device 101, the user can use a preset operation (such as after entering the target application, click the corresponding area on the screen according to the indication of the display screen; through voice control; or through eye tracking, the user makes the eye gaze point stay in the corresponding area for a time longer than the preset time according to the indication of the display screen) to make the electronic device 101 display the small program display interface in the target application on the display screen.
[0056] The electronic devices in the real-time example of the present invention may include various handheld devices with wireless communication functions, vehicle-mounted devices, wearable devices (such as smart watches, smart bracelets, pedometers, etc.), computing devices or other processing devices connected to wireless modems, and various forms of user equipment (UE), mobile stations (MS), terminal devices, etc. For the convenience of description, the above-mentioned devices are collectively referred to as electronic devices.
[0057] It should be noted that the terms "first", "second", etc. in the description and claims of the embodiments of the present invention and the above-mentioned drawings are used to distinguish different objects rather than to describe a specific order.
[0058] Based on the above description, an embodiment of the present invention provides a method for generating a mini-program display interface, which can be executed by a first electronic device. Figure 2A The method for generating the mini-program display interface may include the following steps S201-S204:
[0059] S201, when a target application in a first electronic device is started, the first electronic device sends a data request to a second electronic device, and the target application includes a small program display interface.
[0060] The second electronic device may be a server for constructing a mini-program display interface. The second electronic device may store data of all mini-programs required by the first electronic device to run the target application.
[0061] Optionally, the second electronic device may be a mini-program master server, see Figure 2B , Figure 2B It is an architecture diagram of another communication system provided by an embodiment of the present invention, which includes: a first electronic device, a mini-program main server, and at least one sub-server. Among them, the first electronic device can be connected to the mini-program main server in communication; the mini-program main server is connected to at least one sub-server in communication, and the sub-server includes a server corresponding to each mini-program and a server corresponding to the mini-program display interface; when the first electronic device obtains the first data (the first data can be the data required by the first electronic device for the normal operation of a mini-program or the data required by the first electronic device for generating the mini-program display interface), the first electronic device first sends data request information for the first data to the mini-program main server, and after the mini-program main server receives the data request information for the first data, it analyzes the data request information for the first data and determines the first sub-server that stores the first data; then the mini-program main server sends data request information for the first data to the first sub-server, the first sub-server parses the data request information for the first data, generates the first data, and sends the first data to the mini-program main server, the mini-program main server forwards the first data to the first electronic device, and the first electronic device completes the normal operation of the mini-program or the generation of the mini-program display interface according to the first data. For example, the target application contains N applets in total, where N is a positive integer, and each of the N applets is developed by a different developer, so the N applets correspond to N sub-servers; the server corresponding to the applet display interface is used to generate a layout file. The first electronic device obtains the layout file in the following manner: when the target application in the first electronic device is started, the first electronic device sends a data request for the associated applet display interface to the applet master server, and after receiving the data request sent by the first electronic device, the applet master server sends a data request to the server corresponding to the applet display interface, receives the layout file returned by the server corresponding to the applet display interface, and sends the layout file to the first electronic device.
[0062] S202: The first electronic device receives a layout file sent by the second electronic device.
[0063] Among them, the layout file is a string compiled and generated by the developer of the mini-program display interface according to the product design requirements. Specifically, the designer of the mini-program display interface first designs the display interface, and then hands the designed display interface to the developer of the mini-program display interface. The developer of the mini-program display interface writes TypeScript code according to the display interface; after the developer completes the writing, it is compiled on the electronic device to generate a layout file consisting of a JSON (JavaScript Object Notation, JS object notation) string, and stored in the second electronic device; when the second electronic device receives the data request sent by the first electronic device, the second electronic device sends the layout file to the first electronic device.
[0064] Among them, see Figure 2C , Figure 2C : is a schematic diagram of a mini-program display interface provided by an embodiment of the present invention. The entire display interface includes two modules: everyone is playing and popular rankings; the first electronic device can determine the number and types of modules displayed in the display interface according to the layout file, for example, the display interface can also include the best reputation module, the friends are playing module, the may like module, etc.
[0065] S203: The first electronic device parses the layout file through the visual component to generate view information.
[0066] The view information is data that can be read, identified, and rendered by the first electronic device; the first electronic device can perform rendering operations based on the data to generate a mini-program display interface.
[0067] Among them, the visual component is a graphic display component set in the target application. The visual component can parse the JSON string to obtain the view information; and can perform rendering operations based on the view information to generate the mini-program display interface.
[0068] Optionally, the electronic device runs an Android operating system, and the visual component is a web view (WebView) component.
[0069] S204: When the first electronic device detects a display request for the mini-program display interface, it performs a rendering operation on the view information through a visual component to generate the mini-program display interface.
[0070] Among them, a specific method for detecting a display request for the mini-program display interface may be: after the user starts the target application, the user enters the main interface of the target application, and the user clicks on the area corresponding to the display screen according to the instruction information of the main interface, and the first electronic device determines it as a display request for the mini-program display interface; or the first electronic device has an eye tracking function, and the user gazes at the area corresponding to the display screen according to the instruction information of the main interface, and the first electronic device detects that the user's gaze point stays on the area corresponding to the display screen for longer than a preset time, then the first electronic device determines it as a display request for the mini-program display interface; or, the first electronic device detects a voice control instruction for opening the mini-program display interface, and determines it as a display request for the mini-program display interface; or, after entering the main interface of the target application, the first electronic device detects a preset gesture, and determines it as a display request for the mini-program display interface.
[0071] Optionally, after generating the view information, before performing the rendering operation on the view information through the visual component, the method further includes: determining at least one second account that interacts with the first account within a preset time period before the current time point; determining a mini program corresponding to each second account in the at least one second account; updating the view information according to a mini program corresponding to each second account, so that the mini program display interface generated by performing the rendering operation on the view information includes a mini program corresponding to each second account. The second account may be an account that logs in to the target application on an electronic device other than the first electronic device. The interaction may be sending messages between the two accounts, and the process of generating information interaction such as one party liking, collecting, and forwarding the content posted by the other party between the two accounts may be regarded as the interaction between the two accounts. The preset time period may be pre-set by the developer of the target application according to actual conditions, such as one week, one month, etc. The method for determining a mini program corresponding to each second account in the at least one second account may be: determining that the mini program with the longest usage time of each second account within the preset time period before the current time point is a mini program corresponding to each second account.
[0072] It can be seen that in the embodiment of the present invention, when the target application in the first electronic device is started, a data request is sent to the second electronic device, and the target application includes a small program display interface; a layout file sent by the second electronic device is received; the layout file is parsed by the visual component to generate view information; when a display request for the small program display interface is detected, a rendering operation is performed on the view information by the visual component to generate the small program display interface. It can be seen that in the embodiment of the present invention, when the target application is started, the first electronic device can obtain the layout file from the second electronic device, and then perform parsing and rendering operations according to the layout file to generate the small program display interface, so that the small program display interface can be updated according to the layout file sent by the second electronic device each time the target application is started, which is conducive to realizing the flexible configuration of the small program display interface; because the small program display interface can be updated each time the target application is started, it is convenient for the developers of the small program display interface to perform AB testing on the small program display interface, and then quickly and efficiently determine the appropriate small program display interface, thereby improving the intelligence of the electronic device.
[0073] Optionally, the method for generating the mini-program display interface may also be: when the target application in the first electronic device is started, the static code corresponding to the mini-program display interface is loaded, and the mini-program display interface is generated according to the static code; background data sent by the second electronic device is received, wherein the background data includes information for instructing the first electronic device to display a first number of mini-programs; the first electronic device updates the mini-program display interface according to the background data, so that the mini-program display interface finally generated includes the first number of mini-programs. Figure 2D , Figure 2D It is a schematic diagram of a small program display interface generated by static code provided by an embodiment of the present invention.
[0074] Optionally, an ark template is provided in the target application, and the ark template can render a corresponding display interface according to the input data, wherein the input data can be data composed of Extensible Markup Language (XML); the method for generating the mini-program display interface can also be: when the target application in the first electronic device is started, the ark template is loaded; when it is detected that the loading of the ark template is completed, the layout file is parsed by the ark template to obtain the parsed data; the rendering operation is performed according to the parsed data to generate the mini-program display interface;
[0075] Before parsing the layout file through the ark template, the method further includes: the first electronic device receiving the layout file sent by the second electronic device;
[0076] Wherein, while the first electronic device loads the ark template, the first electronic device sends a data request to the second electronic device; or, after the first electronic device completes loading the ark template and before the first electronic device receives the layout file sent by the second electronic device, the first electronic device sends a data request to the second electronic device, wherein the data request is used to obtain the layout file;
[0077] See also Figure 2E , Figure 2E It is a schematic diagram of a mini-program display interface generated by an ark template provided in an embodiment of the present invention.
[0078] See also Figure 3 , is a flowchart of another method for generating a mini-program display interface provided by an embodiment of the present invention. The method for generating a mini-program display interface can be executed by a first electronic device. Figure 3 As shown, the method for generating the mini-program display interface may include the following steps S301-S307:
[0079] S301, when a target application in a first electronic device is started, a data request is sent to a second electronic device, wherein the target application includes a mini-program display interface.
[0080] S302: The first electronic device receives a layout file sent by the second electronic device.
[0081] S303: The first electronic device parses the layout file through the visual component to generate view information.
[0082] S304, the first electronic device obtains historical data of the first account currently logged in by the target application;
[0083] The first electronic device may communicate with a server corresponding to the target application to obtain the historical data of the first account; or the first electronic device may read local cache data to obtain the historical data of the first account.
[0084] S305: The first electronic device determines a preset number of mini-programs to be recommended based on historical data.
[0085] In one embodiment, the historical data includes the usage time of at least one mini-program within a preset time period before the current time point, and step S305 may include the following steps: the first electronic device sorts at least one mini-program according to the usage time of each mini-program in the at least one mini-program to obtain a mini-program sequence corresponding to the at least one mini-program; the first electronic device determines that the first preset number of mini-programs in the mini-program sequence are a preset number of mini-programs to be recommended.
[0086] The mini-program sequence may be arranged from largest to smallest according to the usage time of the mini-programs. The preset number is a positive integer. If the number of mini-programs in the mini-program sequence is less than the preset number, it is determined that all mini-programs in the mini-program sequence are mini-programs to be recommended.
[0087] Among them, the mini-program display interface includes a may-like module; after the first electronic device determines a preset number of mini-programs to be recommended, it may also include: the first electronic device obtains category information of the preset number of mini-programs to be recommended, and divides the preset number of mini-programs to be recommended into a second number of categories according to the category information of the preset number of mini-programs to be recommended; determines the number of mini-programs contained in each category of the second number of categories; the number of mini-programs contained in each category determines the target category with the largest number of mini-programs in the second number of categories; uses the target category as a query identifier, queries the ranking list corresponding to the target category, and obtains information on the top K mini-programs in the ranking list corresponding to the target category, where K is a positive integer; updates the view information according to the information of the K mini-programs, so that the may-like module in the final mini-program display interface includes the above-mentioned K mini-programs.
[0088] In another embodiment, the historical data includes a usage time interval of at least one mini program within a preset time period before the current time point, and the preset time period is greater than a natural day. Step S305 may include the following steps: the first electronic device determines a first time range based on the current time point; the first electronic device determines the cumulative usage time of each mini program in at least one mini program within the first time range based on the usage time interval of at least one mini program within the preset time period; the first electronic device sorts at least one mini program based on the cumulative usage time of each mini program to obtain a mini program sequence corresponding to at least one mini program; the first electronic device determines the first preset number of mini programs in the mini program sequence as a preset number of mini programs to be recommended.
[0089] Wherein, the preset number is a positive integer. If the number of mini-programs in the mini-program sequence is less than the preset number, it is determined that all mini-programs in the mini-program sequence are mini-programs to be recommended. The first time range can be determined as follows: if the first time range is from a first time point to a second time point, the first time point is a time point M minutes before the current time point, and the second time point is a time point N minutes after the current time point. Wherein, the first time range is less than a natural day; wherein, the cumulative duration refers to the sum of the duration of using the mini-program in each time range within the preset duration. For example, the preset duration is 2 days, the current time point is 18:00, M is 20, and N is 30, then the first time range is 17:40 to 18:30; currently at least one mini-program is two mini-programs, the first of the two mini-programs is used for 10 minutes between 17:40 and 18:30 on the first day of the 2 days, and is used for 20 minutes between 17:40 and 18:30 on the second day of the 2 days, then the cumulative usage time of the first mini-program is 30 minutes; the second of the two mini-programs is used for 5 minutes between 17:40 and 18:30 on the first day of the 2 days, and is used for 27 minutes between 17:40 and 18:30 on the second day of the 2 days, then the cumulative usage time of the first mini-program is 32 minutes. Arranged from large to small according to the duration, the first mini-program is arranged first in the mini-program sequence, and the second mini-program is arranged second. If the preset number is 1, the first mini-program is determined to be the mini-program to be recommended.
[0090] S306: The first electronic device updates the view information according to the preset number of mini-programs to be recommended, so that the mini-program display interface generated by performing a rendering operation on the view information includes the preset number of mini-programs to be recommended.
[0091] S307: When the first electronic device detects a display request for the mini-program display interface, it performs a rendering operation on the view information through a visual component to generate the mini-program display interface.
[0092] In an embodiment of the present invention, when a target application in a first electronic device is started, a data request is sent to a second electronic device, where the target application includes a mini-program display interface; a layout file sent by the second electronic device is received; the layout file is parsed through a visual component to generate view information, so that the view information can be updated each time the application is started, which is conducive to flexible configuration of the mini-program display interface generated according to the view information; then the first electronic device obtains historical data of the first account currently logged in by the target application; determines a preset number of mini-programs to be recommended based on the historical data; updates the view information based on the preset number of mini-programs to be recommended, so that the mini-program display interface generated according to the updated view information is more closely associated with the first account, thereby improving the intelligence of the electronic device; finally, when a display request for the mini-program display interface is detected, a rendering operation is performed on the view information through the visual component to generate the mini-program display interface.
[0093] Based on the description of the embodiment of the method for generating a mini-program display interface, the embodiment of the present invention further discloses a device for generating a mini-program display interface. The device for generating a mini-program display interface may be a computer program (including program code) running in an electronic device. The device for generating a mini-program display interface may execute Figure 2A or Figure 3 See the method shown in Figure 4 , the device for generating the mini-program display interface may run the following units:
[0094] The communication unit 101 is used to send a data request to a second electronic device when a target application in the first electronic device is started; and to receive a layout file sent by the second electronic device;
[0095] The processing unit 102 is used to parse the layout file through the visual component to generate view information; and when a display request for the mini-program display interface is detected, perform a rendering operation on the view information through the visual component to generate the mini-program display interface.
[0096] In one implementation, the layout file is composed of a JSON string, and the JSON string is generated based on the TypeScript code entered into the second electronic device.
[0097] In yet another embodiment, the visual component is a graphic display component provided in the target application.
[0098] In another embodiment, after the view information is generated and before the rendering operation is performed on the view information through the visual component, the processing unit 102 can also be used to: obtain historical data of the first account currently logged in to the target application; determine a preset number of mini-programs to be recommended based on the historical data; update the view information based on the preset number of mini-programs to be recommended, so that the mini-program display interface generated by performing the rendering operation on the view information includes the preset number of mini-programs to be recommended.
[0099] In another embodiment, the historical data includes the usage time of at least one mini-program within a preset time period before the current time point. When the processing unit 102 is used to determine a preset number of mini-programs to be recommended based on the historical mini-program usage data, it is specifically used to: sort the at least one mini-program according to the usage time of each mini-program in the at least one mini-program to obtain a mini-program sequence corresponding to the at least one mini-program; and determine the first preset number of mini-programs in the mini-program sequence as the preset number of mini-programs to be recommended.
[0100] In another embodiment, the historical data includes a usage time interval of at least one mini program within a preset time period before a current time point, and the preset time period is greater than a natural day. The processing unit 102 is used to determine a preset number of mini programs to be recommended based on the historical mini program usage data, specifically for: determining a first time range based on the current time point; determining a cumulative usage time of each mini program in the at least one mini program within the first time range based on the usage time interval of the at least one mini program within the preset time period; sorting the at least one mini program based on the cumulative usage time of each mini program to obtain a mini program sequence corresponding to the at least one mini program; determining the first preset number of mini programs in the mini program sequence as the preset number of mini programs to be recommended.
[0101] In another embodiment, after the view information is generated and before the rendering operation is performed on the view information through the visual component, the processing unit 102 can also be used to: determine at least one second account that interacted with the first account within a preset time period before the current time point; determine a mini program corresponding to each second account in the at least one second account; update the view information according to a mini program corresponding to each second account, so that the mini program display interface generated by performing the rendering operation on the view information includes a mini program corresponding to each second account.
[0102] According to one embodiment of the present invention, Figure 2A or Figure 3 Each step involved in the method shown can be performed by Figure 4The small program display interface shown is executed by various units in the generating device. For example, Figure 2A The steps S201 and S202 shown in FIG. 1 can be performed by Figure 4 The communication unit 101 shown in FIG. 1 is used to perform the steps S203 and S204. Figure 4 , the processing unit 102 shown in is executed; for example, Figure 3 Steps S301 and S302 shown in FIG. Figure 4 The communication unit 101 shown in FIG. 1 is executed, and steps S303 to S307 can be performed by Figure 4 The processing unit 102 shown in FIG.
[0103] According to another embodiment of the present invention, Figure 4 The various units in the generating device of the mini-program display interface shown can be separately or completely combined into one or several other units to constitute, or one (some) of the units can also be split into multiple smaller units in function to constitute, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present invention. The above-mentioned units are divided based on logical functions. In practical applications, the function of one unit can also be realized by multiple units, or the functions of multiple units can be realized by one unit. In other embodiments of the present invention, the generating device based on the mini-program display interface can also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented by the collaboration of multiple units.
[0104] According to another embodiment of the present invention, the program can be executed by running a program on a general computing device such as a computer including a central processing unit (CPU), a random access memory medium (RAM), a read-only memory medium (ROM), and other processing elements and storage elements. Figure 2A or Figure 3 A computer program (including program code) for each step involved in the corresponding method shown in Figure 4 The device for generating the mini-program display interface shown in the embodiment of the present invention is provided, and the method for generating the mini-program display interface is provided. The computer program can be recorded on a computer-readable recording medium, for example, and loaded into the computing device through the computer-readable recording medium and run therein.
[0105] It can be seen that in the embodiment of the present invention, when the target application in the first electronic device is started, a data request is sent to the second electronic device; a layout file sent by the second electronic device is received; the layout file is parsed by the visual component to generate view information; when a display request for the mini-program display interface is detected, a rendering operation is performed on the view information by the visual component to generate the mini-program display interface. It can be seen that in the embodiment of the present invention, when the target application program is started, the first electronic device can obtain the layout file from the second electronic device, and then perform parsing and rendering operations according to the layout file to generate the mini-program display interface, so that the mini-program display interface can be updated according to the layout file sent by the second electronic device each time the target application is started, which is conducive to realizing the flexible configuration of the mini-program display interface; because the mini-program display interface can be updated each time the target application is started, it is convenient for the developers of the mini-program display interface to perform AB testing on the mini-program display interface, and then quickly and efficiently determine the appropriate mini-program display interface, thereby improving the intelligence of the electronic device.
[0106] Based on the description of the above method embodiment and device embodiment, the present invention also provides an electronic device. Figure 5 The electronic device at least includes a processor 201, an input device 202, an output device 203, and a computer storage medium 204. The processor 201, the input device 202, the output device 203, and the computer storage medium 204 in the electronic device may be connected via a bus or other means.
[0107] The computer storage medium 204 can be stored in the memory of the electronic device, and the computer storage medium 204 is used to store a computer program, and the computer program includes program instructions, and the processor 201 is used to execute the program instructions stored in the computer storage medium 204. The processor 201 (or CPU (Central Processing Unit)) is the computing core and control core of the electronic device, which is suitable for implementing one or more instructions, and is specifically suitable for loading and executing one or more instructions to implement the corresponding method flow or corresponding function; in one embodiment, the processor 201 described in the embodiment of the present invention can be used to perform a series of mini-program display interface generation processing, including: when the target application in the first electronic device is started, sending a data request to the second electronic device; receiving the layout file sent by the second electronic device; parsing the layout file through the visual component to generate view information; when a display request for the mini-program display interface is detected, performing a rendering operation on the view information through the visual component to generate the mini-program display interface.
[0108] The embodiment of the present invention also provides a computer storage medium (Memory), which is a memory device in an electronic device for storing programs and data. It is understandable that the computer storage medium here can include both built-in storage media in the electronic device and, of course, extended storage media supported by the electronic device. The computer storage medium provides a storage space, which stores the operating system of the electronic device. In addition, one or more instructions suitable for being loaded and executed by the processor 201 are also stored in the storage space, and these instructions can be one or more computer programs (including program codes). It should be noted that the computer storage medium here can be a high-speed RAM memory, or a non-volatile memory (non-volatile memory), such as at least one disk storage; optionally, it can also be at least one computer storage medium located away from the aforementioned processor.
[0109] In one embodiment, the processor 201 may load and execute one or more instructions stored in a computer storage medium to implement the corresponding steps of the method in the above-mentioned embodiment of generating a mini-program display interface; in a specific implementation, the processor 201 loads one or more instructions in a computer storage medium and executes the following steps:
[0110] When the target application in the first electronic device is started, sending a data request to the second electronic device;
[0111] Receiving the layout file sent by the second electronic device;
[0112] Parsing the layout file through visual components to generate view information;
[0113] When a display request for the mini-program display interface is detected, a rendering operation is performed on the view information by the visual component to generate the mini-program display interface.
[0114] In one implementation, the layout file is composed of a JSON string, and the JSON string is generated based on the TypeScript code entered into the second electronic device.
[0115] In yet another embodiment, the visual component is a graphic display component provided in the target application.
[0116] In another embodiment, after the view information is generated and before the rendering operation is performed on the view information through the visual component, the one or more instructions may also be loaded and specifically executed by the processor 201: obtaining historical data of the first account currently logged in to the target application; determining a preset number of mini-programs to be recommended based on the historical data; updating the view information based on the preset number of mini-programs to be recommended, so that the mini-program display interface generated by performing the rendering operation on the view information includes the preset number of mini-programs to be recommended.
[0117] In another embodiment, the historical data includes the usage time of at least one mini-program within a preset time period before the current time point. When used to determine a preset number of mini-programs to be recommended based on the historical mini-program usage data, the one or more instructions can also be loaded and specifically executed by the processor 201: sorting the at least one mini-program according to the usage time of each mini-program in the at least one mini-program to obtain a mini-program sequence corresponding to the at least one mini-program; determining the first preset number of mini-programs in the mini-program sequence as the preset number of mini-programs to be recommended.
[0118] In another embodiment, the historical data includes a usage time interval of at least one mini-program within a preset time period before a current time point, and the preset time period is greater than a natural day. When used to determine a preset number of mini-programs to be recommended based on the historical mini-program usage data, the one or more instructions can also be loaded and specifically executed by the processor 201: determine a first time range based on the current time point; determine the cumulative usage time of each mini-program in the at least one mini-program within the first time range based on the usage time interval of the at least one mini-program within the preset time period; sort the at least one mini-program based on the cumulative usage time of each mini-program to obtain a mini-program sequence corresponding to the at least one mini-program; determine the first preset number of mini-programs in the mini-program sequence as the preset number of mini-programs to be recommended.
[0119] In another embodiment, after the view information is generated and before the rendering operation is performed on the view information through the visual component, the one or more instructions may also be loaded by the processor 201 and specifically executed: determining at least one second account that interacted with the first account within a preset time period before the current time point; determining a mini program corresponding to each second account in the at least one second account; updating the view information according to a mini program corresponding to each second account, so that the mini program display interface generated by performing the rendering operation on the view information includes a mini program corresponding to each second account.
[0120] It can be seen that in the embodiment of the present invention, when the target application in the first electronic device is started, a data request is sent to the second electronic device; a layout file sent by the second electronic device is received; the layout file is parsed by the visual component to generate view information; when a display request for the mini-program display interface is detected, a rendering operation is performed on the view information by the visual component to generate the mini-program display interface. It can be seen that in the embodiment of the present invention, when the target application program is started, the first electronic device can obtain the layout file from the second electronic device, and then perform parsing and rendering operations according to the layout file to generate the mini-program display interface, so that the mini-program display interface can be updated according to the layout file sent by the second electronic device each time the target application is started, which is conducive to realizing the flexible configuration of the mini-program display interface; because the mini-program display interface can be updated each time the target application is started, it is convenient for the developers of the mini-program display interface to perform AB testing on the mini-program display interface, and then quickly and efficiently determine the appropriate mini-program display interface, thereby improving the intelligence of the electronic device.
[0121] The above disclosure is only the preferred embodiment of the present invention, which certainly cannot be used to limit the scope of the present invention. Therefore, equivalent changes made according to the claims of the present invention are still within the scope of the present invention.
Claims
1. A method for generating a mini-program display interface, characterized in that: The method comprises: When the target application in the first electronic device is started, sending a data request to the second electronic device; Receiving the layout file sent by the second electronic device; Parsing the layout file through visual components to generate view information; Determine at least one second account that interacted with the first account within a preset time period before the current time point, the first account being an account currently logged into the target application on the first electronic device, and the second account being an account logged into the target application on an electronic device other than the first electronic device; Determine a mini program corresponding to each second account in the at least one second account; Updating the view information according to a small program corresponding to each second account; When a display request for the mini-program display interface is detected, a rendering operation is performed on the view information through the visual component to generate the mini-program display interface, and the mini-program display interface includes a mini-program corresponding to each second account.
2. The method according to claim 1, characterized in that The layout file is composed of a JSON string, and the JSON string is generated according to the TypeScript code entered into the second electronic device.
3. The method according to claim 1, characterized in that: The visual component is a graphic display component provided in the target application.
4. The method according to any one of claims 1 to 3, characterized in that: After generating the view information and before performing a rendering operation on the view information by the visual component, the method further includes: Obtain historical data of a first account currently logged in by the target application; Determine a preset number of mini-programs to be recommended based on the historical data; The view information is updated according to the preset number of mini-programs to be recommended, so that the mini-program display interface generated by performing a rendering operation on the view information includes the preset number of mini-programs to be recommended.
5. The method according to claim 4, characterized in that The historical data includes the usage time of at least one mini-program within a preset time period before the current time point, and determining a preset number of mini-programs to be recommended according to the historical data includes: Sort the at least one mini program according to the usage time of each mini program in the at least one mini program to obtain a mini program sequence corresponding to the at least one mini program; Determine the first preset number of mini-programs in the mini-program sequence as the preset number of mini-programs to be recommended.
6. The method according to claim 4, characterized in that The historical data includes a usage time interval of at least one mini-program within a preset time period before the current time point, the preset time period is greater than a natural day, and determining a preset number of mini-programs to be recommended based on the historical data includes: Determine a first time range according to the current time point; Determine the cumulative usage time of each mini program in the at least one mini program within the first time range according to the usage time interval of the at least one mini program within the preset time period; Sorting the at least one mini program according to the accumulated usage time of each mini program to obtain a mini program sequence corresponding to the at least one mini program; Determine the first preset number of mini-programs in the mini-program sequence as the preset number of mini-programs to be recommended.
7. A device for generating a mini-program display interface, characterized in that: include: a communication unit, configured to send a data request to a second electronic device when a target application in the first electronic device is started; and for receiving a layout file sent by the second electronic device; A processing unit, used for parsing the layout file through a visual component to generate view information; Determine at least one second account that interacted with the first account within a preset time period before the current time point, the first account being an account currently logged into the target application on the first electronic device, and the second account being an account logged into the target application on an electronic device other than the first electronic device; Determine a mini program corresponding to each second account in the at least one second account; and update the view information according to a mini program corresponding to each second account; And when a display request for the mini-program display interface is detected, the mini-program display interface is generated by performing a rendering operation on the view information through the visual component, wherein the mini-program display interface includes a mini-program corresponding to each second account.
8. An electronic device, comprising an input device and an output device, characterized in that: Also includes: a processor adapted to implement one or more instructions; as well as, A computer storage medium storing one or more instructions, wherein the one or more instructions are suitable for being loaded by the processor and executing the method for generating a mini-program display interface as described in any one of claims 1-6.
9. A computer storage medium, characterized in that The computer storage medium stores one or more instructions, and the one or more instructions are suitable for being loaded by a processor and executing the method for generating a mini-program display interface as described in any one of claims 1-6.
