Application interface loading and interaction method, device and storage medium
By merging data items to be rendered into data blocks and calling native UI components in units of data blocks, the problem of slow loading speed of cross-platform application interfaces is solved, user experience is improved and interactivity is maintained.
Patent Information
- Application Number
- CN201910372273.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-05-06
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2039-05-06
AI Technical Summary
Applications developed across platforms are prone to lags during interface loading, resulting in long loading times and affecting user experience.
By merging multiple data items to be rendered into data blocks to be rendered, and calling native UI components for rendering in units of data blocks to be rendered, the number of calls to native UI components is reduced and the interface loading speed is improved.
It effectively solves the lag problem during interface loading, improves user experience, and ensures the interactivity of interface elements.
Smart Images

Figure CN111897607B
Abstract
Description
Technical Field
[0001] The present application relates to the field of software technology, and in particular to an application interface loading and interaction method, device and storage medium. Background Art
[0002] Cross-platform is an important concept in software development. It is independent of the operating system and the hardware environment. An application developed under one operating system can still run under other operating systems, which helps save development costs and shorten the development cycle.
[0003] In order to achieve a visual experience similar to that of native applications, cross-platform applications generally rely on native view components. For example, React Native (RN for short) uses JavaScriptCore as a bridge to convert JS calls to native calls. Compared with native applications, cross-platform applications are prone to freezes and take longer to load when the interface loads long content. Summary of the invention
[0004] Multiple aspects of the present application provide an application interface loading and interaction method, device and storage medium to solve the problem of interface jamming during loading, increase the interface loading speed, and thus improve the user experience.
[0005] An embodiment of the present application provides an application interface loading method, comprising: responding to an interface loading operation, obtaining interface data required for rendering an application interface, wherein the interface data comprises a plurality of data items to be rendered; dividing the plurality of data items to be rendered into blocks, obtaining at least one data block to be rendered and style attributes of the at least one data block to be rendered; and calling a native UI component to render the at least one data block to be rendered onto the application interface according to the style attributes.
[0006] An embodiment of the present application also provides an application interface interaction method, including: displaying an application interface including multiple interface elements, at least one of the multiple interface elements including multiple data items; in response to a trigger operation on a target interface element on the application interface, determining the relative position of the trigger operation in the target interface element; the target interface element is any interface element on the application interface that includes multiple data items; based on layout information between the data items included in the target interface element, determining the target data item corresponding to the relative position; and processing the target data item according to the processing method corresponding to the trigger operation.
[0007] An embodiment of the present application also provides a terminal device, including: a memory, a processor and a display screen; the memory is used to store computer programs and native UI components; the display screen is used to display an application interface; the processor is coupled to the memory and is used to execute the computer program to: respond to an interface loading operation, obtain interface data required for rendering an application interface, and the interface data includes multiple data items to be rendered; divide the multiple data items to be rendered into blocks to obtain at least one data block to be rendered and style attributes of the at least one data block to be rendered; call the native UI component to render the at least one data block to be rendered onto the application interface according to the style attributes.
[0008] An embodiment of the present application also provides a computer-readable storage medium storing computer instructions. When the computer instructions are executed by one or more processors, the one or more processors are caused to execute the steps in the application interface loading method provided in the embodiment of the present application.
[0009] An embodiment of the present application also provides a terminal device, including: a memory, a processor and a display screen; the memory is used to store a computer program; the display screen is used to display an application interface including multiple interface elements, at least one of the multiple interface elements includes multiple data items; the processor is coupled to the memory, and is used to execute the computer program, so as to: determine the relative position of the trigger operation in the target interface element in response to a trigger operation on the target interface element on the application interface; the target interface element is any interface element on the application interface that includes multiple data items; determine the target data item corresponding to the relative position based on layout information between the data items included in the target interface element; and process the target data item according to the processing method corresponding to the trigger operation.
[0010] An embodiment of the present application also provides a computer-readable storage medium storing computer instructions. When the computer instructions are executed by one or more processors, the one or more processors are caused to execute the steps in the application interface interaction method provided in the embodiment of the present application.
[0011] In an embodiment of the present application, during the application interface loading process, multiple data items to be rendered are merged into data blocks to be rendered, and native UI components are called for rendering in units of data blocks to be rendered, thereby reducing the number of interface elements that need to call native UI components for rendering during each loading process, reducing the number of interactions with native UI components, and helping to increase the interface loading speed. To a certain extent, it can solve the problem of freezes during interface loading and improve user experience.
[0012] Furthermore, for the interface elements rendered by the data blocks to be rendered, the embodiment of the present application also provides an interaction method, which can ensure the interactivity of the interface elements while improving the interface loading speed and meet the user's interaction needs. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0014] Figure 1a A schematic diagram of the structure of an application system provided for an exemplary embodiment of the present application;
[0015] Figure 1b An example of a text-based list provided for an exemplary embodiment of the present application: a schematic diagram of a country / region list;
[0016] Figure 1c Yes Figure 1b A schematic diagram showing the result of dividing the country names in the country / region list into a data block to be rendered every 3 country names;
[0017] Figure 1d Yes Figure 1b A schematic diagram showing the result of dividing the data blocks to be rendered according to the first letter of the pinyin of the country names in the country / region list;
[0018] Figure 1e Yes Figure 1b A schematic diagram showing the result of dividing the data blocks to be rendered according to the number of characters contained in the country names in the country / region list;
[0019] Figure 1f yes Figure 1b A schematic diagram of the previous application interface of the application interface where the country / region list is shown and the state after "Germany" is entered in the input box or input area;
[0020] Figure 1g It is a schematic diagram of the process of the terminal device calculating the distance between the trigger position and the top border of the target interface element;
[0021] Figure 2a A flowchart of an application interface loading method provided for an exemplary embodiment of the present application;
[0022] Figure 2b A flowchart of an application interface interaction method provided for an exemplary embodiment of the present application;
[0023] Figure 3 A schematic diagram of the structure of a terminal device provided for an exemplary embodiment of the present application;
[0024] Figure 4 A schematic diagram of the structure of another terminal device provided in an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0025] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.
[0026] In the process of loading the interface of existing cross-platform developed applications, especially when loading long content, it is easy to experience freezes and long loading times. In response to these technical problems, in some embodiments of the present application, during the loading process of the application interface, multiple data items to be rendered are merged into data blocks to be rendered, and native UI components are called for rendering in units of data blocks to be rendered, which reduces the number of interface elements that need to be called for rendering by native UI components during each loading process, reduces the number of interactions with native UI components, is conducive to improving the interface loading speed, can solve the freeze problem during the interface loading process to a certain extent, and improve the user experience.
[0027] Furthermore, for the interface elements rendered by the data blocks to be rendered, the embodiment of the present application also provides an interaction method, which can ensure the interactivity of the interface elements while improving the interface loading speed and meet the user's interaction needs.
[0028] The technical solutions provided by various embodiments of the present application are described in detail below in conjunction with the accompanying drawings.
[0029] Figure 1a The following is a schematic diagram of the structure of an application system provided by an exemplary embodiment of the present application. Figure 1a As shown, the application system includes: a terminal device 101 and a server device 102.
[0030] In this embodiment, the number of terminal devices 101 can be one or more. The terminal device 101 refers to a computer device located on the user side (generally referring to various users of the terminal device, which can be a user or another device) with certain computing, storage, communication and display capabilities, and can be a smart phone, tablet computer, personal computer, wearable device or other electronic device with a display screen. The terminal device 101 of this embodiment generally includes at least one processor, at least one memory and a display screen. The number of processors and memories depends on the configuration and type of the terminal device 101. The memory can include volatile, such as RAM, and can also include non-volatile, such as read-only memory (ROM), flash memory, etc., or can also include both types. The memory usually stores an operating system (OS), one or more application programs, and can also store program data, etc. In addition to the processor and memory, the terminal device 101 also includes some basic configurations, such as a network card chip, an IO bus, audio and video components, etc. Optionally, the terminal device 101 can also include some peripherals, such as a keyboard, a mouse, an input pen, a printer, etc. These peripheral devices are well known in the art and will not be described in detail here.
[0031] In this embodiment, the number of server devices 102 can be one or more. The server device 102 is a platform combining hardware and software designed to meet various application requirements, generally including components such as a processor, a hard disk, a memory, a system bus, and is similar to a general computer architecture. This embodiment does not limit the implementation form of the server device 102, for example, it can be a conventional server, a cloud server, a cloud host, a virtual center, or a server array.
[0032] In this embodiment, the terminal device 101 is connected to the server device 102 for communication. The terminal device 101 and the server device 102 may be connected via a wired or wireless network. Optionally, the terminal device 101 may be connected to the server device 102 for communication via a mobile network. Accordingly, the network standard of the mobile network may be any one of 2G (GSM), 2.5G (GPRS), 3G (WCDMA, TD-SCDMA, CDMA2000, UTMS), 4G (LTE), 4G+ (LTE+), 5G, WiMax or new network standards that will appear in the future. Optionally, the terminal device 101 may also be connected to the server device 102 for communication via Bluetooth, WiFi, infrared, zigbee or NFC.
[0033] In this embodiment, at least one application that can provide local services to users is installed on the terminal device 101. These applications can be native applications or cross-platform applications (referred to as cross-platform applications). Among them, native applications refer to applications developed specifically for the operating system of the terminal device 101 and cannot be run on other operating systems; correspondingly, cross-platform applications refer to applications developed based on a cross-platform development framework and can be run on different operating systems. In this embodiment, the cross-platform development framework used to develop cross-platform applications is not limited, for example, it can be Weex, Cordova, Ionic, AppCan, Dcloud, APICloud, or ReactNative. In this embodiment, the focus is on the cross-platform applications on the terminal device 101, and the subsequent description will focus on the cross-platform applications.
[0034] It is worth noting that this embodiment does not limit the cross-platform applications installed on the terminal device 101, which can be cross-platform applications that can provide any services, such as shopping applications, game applications, email applications, instant messaging applications, map applications, audio and video applications, e-reading applications, housekeeping service applications, or financial management applications, etc. developed across platforms.
[0035] Regardless of the cross-platform application that provides any service, the terminal device 101 runs the cross-platform application and can provide the user with an application interface, and the number of application interfaces can be one or more. In the case of multiple application interfaces, the application interfaces can be switched or jumped to each other; further, the application interfaces can have a hierarchical relationship. For any application interface, it generally contains multiple interface elements, such as but not limited to: pictures, text, buttons, scroll bars, input boxes, navigation controls, floating windows and / or page switching controls, etc. Among these interface elements, some interface elements have interactive functions, and some interface elements do not have interactive functions; of course, it is also an optional implementation method that all interface elements on the application interface have interactive functions. For interface elements with interactive functions, they can respond to the user's triggering operation and provide users with corresponding services, such as jumping to the next application interface, or popping up a dialog box, or outputting voice information to the user, or playing audio and video to the user, or displaying graphic information to the user, etc.
[0036] Optionally, the user can issue an interface loading operation to trigger the terminal device 101 to provide the application interface for the user. In different use states of the cross-platform application, the interface loading operation method and the application interface provided to the user will be different. This embodiment does not limit the interface loading operation and the provided application interface. For example, in the case of launching a cross-platform application, the user can double-click the application icon on the desktop of the terminal device 101, and the terminal device 101 can respond to the user's double-clicking of the application icon and display the application homepage to the user. For another example, in the process of using a cross-platform application, if the user returns to the previous application interface from the current application interface, the user can click the return control on the current application interface, such as "←", and the terminal device 101 can respond to the user's click on the return control and display the previous application interface to the user. For another example, in the process of using a cross-platform application, if the user loads a text list in the current application interface, the user can click the list loading control on the current application interface. Taking the loading of the country / region list involved in the address information as an example, the list loading control can be but is not limited to: "Location" selection control, and the terminal device 101 can respond to the user's click on the list loading control on the current application interface and display the text list to the user, such as Figure 1b A list of countries / regions is shown, which includes multiple country names.
[0037] For the terminal device 101, in response to the interface loading operation, the process of providing the corresponding application interface to the user includes but is not limited to: the operation of obtaining the interface data required for rendering the application interface, and the operation of rendering the application interface according to the interface data.
[0038] In some optional embodiments, the interface data already exists in the local storage space of the terminal device 101, and the terminal device 101 can directly obtain the interface data required for rendering the application interface from the local storage space in response to the interface loading operation. Optionally, the interface data can be pre-issued or pushed to the terminal device 101 by the server device 102, or can be pre-stored in the local storage space of the terminal device 101 by the user.
[0039] In other optional embodiments, the interface data needs to be provided in real time by the server device 102, and the terminal device 101 can send a data request to the server device 102 in response to the interface loading operation; the server device 102 obtains the corresponding interface data according to the data request and returns it to the terminal device 101; the terminal device 101 receives the interface data returned by the server device 102.
[0040] Among them, the server-side device 102 of this embodiment is installed with a server-side program corresponding to the cross-platform application on the terminal device 101, which can respond to various requests issued by the terminal device 101 during the operation of the cross-platform application, perform relevant processing on the requests, and return the processing results to the terminal device 101. It can also provide various resources to the terminal device 101, store relevant data for the terminal device 101, etc. Based on this, after receiving the data request sent by the terminal device 101, the server-side device 102 can obtain the interface data corresponding to the data request and return the interface data to the terminal device 101.
[0041] After obtaining the interface data required for rendering the application interface, in order to achieve a visual experience similar to that of the native application, the terminal device 101 can call the native user interface (UI) component to render the application interface of the cross-platform application according to the interface data. The native UI component is a UI component specifically developed for the operating system of the pointer terminal device 101, which mainly implements functions related to interface display. These native UI components include but are not limited to: text view components, image view components and / or scroll view components; among which, the text view component is mainly used to display text, the image view component is mainly used to display images, and the scroll view component is mainly a scroll component. Depending on the operating system of the terminal device 101, these components will also be different in implementation. For example, for the Android system, the text view component can be TextView, the image view component can be ImageView, and the scroll view component can be ScrollView. For the iOS system, the text view component can be UITextField, the image view component can be UIImageView, and the scroll view component can be UIScrollView.
[0042] In this embodiment, the interface data required for rendering the application interface may include one or more data items to be rendered. A data item to be rendered refers to a data item that needs to be rendered on the application interface, which may be, but is not limited to, a picture, text, a control, a floating window, audio and video, or a scroll bar, etc. Different data items to be rendered may be data of the same type, for example, all are text or pictures. Of course, different data items to be rendered may also be data of different types, for example, a part of the data items to be rendered is text, and a part of the data items to be rendered is a picture. In this embodiment, it is hoped that the data items to be rendered will be successfully rendered on the application interface, and a visual effect similar to that of the native application is guaranteed, so the native UI component is called to implement. In this embodiment, in order to increase the loading speed of the application interface and try not to cause a jamming phenomenon during the interface loading process, when the interface data required for rendering the application interface includes multiple data items to be rendered, the multiple data items to be rendered may be divided into blocks to obtain at least one data block to be rendered and the style attributes of at least one data block to be rendered; the native UI component is called to render at least one data block to be rendered on the application interface according to the style attributes. For native UI components, the data block to be rendered is used as the rendering unit, and each data block to be rendered is rendered to the application interface according to the style attributes of each data block to be rendered.
[0043] In the present embodiment, each data block to be rendered includes at least one data item to be rendered. Theoretically, the number of data blocks to be rendered that are divided is less than the number of data items to be rendered, but is not limited to this. In special cases, the number of data blocks to be rendered that are divided can be the same as the number of data items to be rendered, that is, one data item to be rendered is divided into one data block to be rendered. It is worth noting that the probability of the occurrence of special cases is low, and the embodiment of the present application focuses on the case where the number of data blocks to be rendered that are divided is less than the number of data items to be rendered. In the case where the number of data blocks to be rendered that are divided is less than the number of data items to be rendered, compared with the data items to be rendered, the number of calls to the native UI components will be reduced when the data blocks to be rendered are used as rendering units, which reduces the number of interactions with the native UI components, is conducive to improving the interface loading speed, and to a certain extent can solve the problem of jamming during the interface loading process and improve the user experience.
[0044] It is worth noting that the method for dividing the data items to be rendered provided in the embodiment of the present application is not only applicable to the case where the interface data includes multiple data items to be rendered, but also applicable to the case where the interface data includes one data item to be rendered. In the case where the interface data includes one data item to be rendered, the data item to be rendered can be used as a data block to be rendered, which is also applicable to the method provided in the embodiment of the present application.
[0045] In the embodiment of the present application, the interface data is not limited, and all data content and data forms that can be rendered to the application interface are applicable to the embodiment of the present application. In an optional embodiment, considering that lists are generally text-based and generally long, they are prone to jamming during the loading process. Therefore, the method provided in the embodiment of the present application can be used to divide the data items in the text-based list into blocks, and call the native UI component for rendering with the blocks as the rendering unit, which will reduce the number of interactions with the native UI component, help to increase the interface loading speed, and to a certain extent solve the jamming problem during the interface loading process. Based on this, in this optional embodiment, the interface data is a text-based list. Optionally, a row of data in a text-based list is a data item to be rendered; or, a column of data in a text-based list is a data item to be rendered.
[0046] In the embodiment of the present application, multiple data items to be rendered may be divided into blocks, but the specific block division method is not limited. Several block division methods are listed below:
[0047] Blocking method 1: multiple data items to be rendered can be divided into blocks according to the original display order between the multiple data items to be rendered to obtain at least one data block to be rendered. Blocking method 1 can ensure that the display order between the data items to be rendered does not change before and after the block, and complies with the display requirements of the business layer.
[0048] Furthermore, there are multiple ways to divide the multiple data items to be rendered into blocks according to the original display order between the multiple data items to be rendered. The following further illustrates the examples:
[0049] Block division method 1.1: according to the original display order of the plurality of data items to be rendered, each N data items to be rendered are divided into a data block to be rendered, wherein N is a natural number greater than or equal to 2.
[0050] For example, Figure 1b Take the country / region list shown as an example. Figure 1b The country names such as "North Korea", "Equatorial Guinea", "Denmark", "Germany", "Diego Garcia Island", etc. in the table are the data items to be rendered in this embodiment. Figure 1b The order of these country names is the original display order. Figure 1b The original display order shown can divide every three country names into a data block to be rendered. The block results are as follows Figure 1c In this block division method, the country names can be divided into a smaller number of data blocks to be rendered. Each time the native UI component is called, three country names in a data block to be rendered can be rendered at one time, which is conducive to reducing the number of calls to the native UI component, facilitating the improvement of the interface loading speed, and to a certain extent solving the problem of freezing during the interface loading process.
[0051] Block division method 1.2: when the original display order among multiple data items to be rendered is sorted by the first letter of the pinyin, the data items to be rendered with the same first letter of the pinyin can be divided into one data block to be rendered.
[0052] Still Figure 1b Taking the country / region list shown in the figure as an example, "North Korea" and "Equatorial Guinea" under the pinyin initials C can be divided into a data block to be rendered, and "Germany", "Diego Garcia Island", etc. under the pinyin initials D can be divided into a data block to be rendered, and so on. The block division results are as follows: Figure 1d In this block division method, the country names are divided into smaller data blocks to be rendered according to the first letter of the pinyin. Each time the native UI component is called, all country names under the same pinyin first letter can be rendered at one time, which is conducive to reducing the number of calls to the native UI component, facilitating the improvement of the interface loading speed, and to a certain extent solving the problem of freezing during the interface loading process.
[0053] It is worth noting that when dividing multiple data items to be rendered into blocks, the original display order between the multiple data items to be rendered can be maintained, complying with the display requirements of the business layer, but it is not limited to this. For example, when it is not necessary to maintain the original display order between the multiple data items to be rendered after dividing into blocks, the following dividing method 2 can also be adopted to divide the multiple data items to be rendered into blocks, and this dividing method can be more flexible and diverse.
[0054] Block division method 2: according to the attributes of the multiple data items to be rendered, multiple data items to be rendered are divided into blocks to obtain at least one data block to be rendered.
[0055] It is worth noting that different data items to be rendered may have different properties. For text data items, their properties include but are not limited to: size, font, color and / or type, etc. Among them, the size of the text includes the height and width of the text. For image data items, their properties include but are not limited to: size, type, shape and / or color, etc. Among them, the size of the picture may include the height and width of the picture. In addition, the shape of the picture can be understood as the shape of the outer contour of the picture, but is not limited to this; the color of the picture can be understood as the theme color in the picture, but is not limited to this. For control data items, their properties include but are not limited to: height, length, color, position and / or form, etc.
[0056] There are many ways to divide the data into blocks, depending on the properties of the data item to be rendered. The following is a further example:
[0057] Block division method 2.1: according to the sizes of multiple data items to be rendered, data items to be rendered with the same size are divided into one data block to be rendered.
[0058] Still Figure 1b Taking the country / region list shown in the figure as an example, the size of the data item to be rendered can be understood as the number of characters contained in each country name. Under this understanding, the country names of two characters such as "North Korea", "Germany", "Denmark", etc. can be divided into a data block to be rendered, and the country names of five characters such as "Equatorial Guinea" and "Dominica" can be divided into a data block to be rendered, and so on. The block division results are as follows Figure 1e In this block division method, the country names are divided into blocks according to the number of characters contained in each country name, so that the country names can be divided into a smaller number of data blocks to be rendered. Each time the native UI component is called, all country names with the same number of characters can be rendered at one time, which is conducive to reducing the number of calls to the native UI component, facilitating the improvement of the interface loading speed, and to a certain extent solving the problem of freezing during the interface loading process.
[0059] Blocking method 2.2: According to the types of multiple data items to be rendered, the data items to be rendered of the same type are divided into a data block to be rendered. This implementation method is suitable for dividing data items to be rendered of multiple types. The same type of data items to be rendered are divided into a data block to be rendered. Then, the data block to be rendered is used as the rendering unit, and the native UI component is called for rendering. This can reduce the number of calls to the native UI component, facilitate improving the interface loading speed, and to a certain extent solve the problem of freezing during the interface loading process.
[0060] It is worth noting that multiple data items to be rendered can be divided into blocks according to a certain attribute alone, for example, the above-mentioned block division methods 2.1 and 2.2 can be used alone; multiple data items to be rendered can also be divided into blocks in combination with multiple attributes at the same time, for example, the above-mentioned block division methods 2.1 and 2.2 can be used in combination.
[0061] Regardless of which of the above-mentioned block division methods is adopted, by performing a block division operation on multiple data items to be rendered, in addition to obtaining at least one data block to be rendered, the style attribute of at least one data block to be rendered can also be obtained. After obtaining at least one data block to be rendered and at least one style attribute of the data block to be rendered, a native UI component can be called, and the native UI component renders the at least one data block to be rendered onto the application interface according to the style attribute of the at least one data block to be rendered.
[0062] In an optional implementation, default style attributes may be preset, and after obtaining the data block to be rendered, the style attributes of the data block to be rendered may be directly set to the default style attributes. Further optionally, the default style attributes may be preset according to the display requirements of the business layer.
[0063] In another optional embodiment, in response to the interface loading operation, the terminal device 101, in addition to obtaining interface data containing multiple data items to be rendered, can also obtain the original display style between the multiple data items to be rendered, such as the line height, font, color of each data item to be rendered, and the line spacing, line breaks and other information between the data items to be rendered. Based on this, the style attributes of at least one data block to be rendered can be generated according to the original display style between the multiple data items to be rendered, which can make the multiple data items to be rendered maintain the same or similar display style as much as possible before and after the block division, and try to meet the display requirements of the business layer. Among them, the original display style between the multiple data items to be rendered is a display style that meets the display requirements of the business layer, and these display styles can be pre-set by the server device 102 or the user according to the display requirements of the business layer.
[0064] In this embodiment, the style attributes of the data block to be rendered are mainly reflected in the style attributes of the data items to be rendered contained therein. Optionally, the style attributes of at least one data block to be rendered can be generated by comprehensively considering the original display styles between multiple data items to be rendered and combining the distribution of the data items to be rendered in the data block to be rendered. Or, optionally, the style attributes of the data items to be rendered contained in at least one data block to be rendered can be set respectively in the data block to be rendered to which it belongs according to the original style attributes of the data items to be rendered contained in at least one data block to be rendered. In short, the style attributes of each data block to be rendered are set separately according to the original style attributes of the data items to be rendered contained in each data block to be rendered.
[0065] For each data block to be rendered, the style attributes of each data block to be rendered are set in the same or similar manner according to the original style attributes of the data items to be rendered contained therein, and the first data block to be rendered is used as an example for explanation. The first data block to be rendered is any one of the at least one data block to be rendered.
[0066] For the first data block to be rendered, the style attributes of the data items to be rendered included in the first data block to be rendered may be set according to the original style attributes of the data items to be rendered included in the first data block to be rendered.
[0067] Optionally, the style attributes of the data item to be rendered in the first data block to be rendered include, but are not limited to: line height attribute, line break attribute, font attribute, color attribute and / or line spacing attribute. Based on this, setting the style attributes of the data item to be rendered in the first data block to be rendered according to the original style attributes of the data item to be rendered contained in the first data block to be rendered includes at least one of the following operations:
[0068] According to the original row height attribute of the data item to be rendered contained in the first data block to be rendered, setting the row height attribute of the data item to be rendered (here, referring to the data item to be rendered contained in the first data block to be rendered) in the first data block to be rendered;
[0069] According to the original line break attribute of the data item to be rendered contained in the first data block to be rendered, setting the line break attribute of the data item to be rendered (here, the data item to be rendered contained in the first data block to be rendered) in the first data block to be rendered;
[0070] According to the original font attribute of the data item to be rendered contained in the first data block to be rendered, setting the font attribute of the data item to be rendered (here, the data item to be rendered contained in the first data block to be rendered) in the first data block to be rendered;
[0071] According to the original color attribute of the data item to be rendered contained in the first data block to be rendered, setting the color attribute of the data item to be rendered (here, the data item to be rendered contained in the first data block to be rendered) in the first data block to be rendered;
[0072] According to the original color attribute of the data item to be rendered contained in the first data block to be rendered, setting the color attribute of the data item to be rendered (here, the data item to be rendered contained in the first data block to be rendered) in the first data block to be rendered;
[0073] According to the original line spacing attribute between the data items to be rendered included in the first data block to be rendered, the line spacing attribute between the data items to be rendered (here, the data items to be rendered included in the first data block to be rendered) in the first data block to be rendered is set.
[0074] Further optionally, in the above-mentioned various operations, the original style attributes of the data items to be rendered included in the first data block to be rendered can be directly set as the style attributes of the corresponding data items to be rendered in the first data block to be rendered. For example, in the case where the first data block to be rendered includes data items A and B to be rendered, the original line height, font, color and other attributes of data item A to be rendered can be set as the line height, font, color and other attributes of data item A to be rendered in the first data block to be rendered; the original line height, font, color and other attributes of data item B to be rendered can be set as the line height, font, color and other attributes of data item B to be rendered in the first data block to be rendered; the original line break information between data items A and B to be rendered can be set as the line break information of data items A and B to be rendered in the first data block to be rendered.
[0075] In an embodiment of the present application, during the application interface loading process, multiple data items to be rendered are merged into data blocks to be rendered, and native UI components are called for rendering in units of data blocks to be rendered, thereby reducing the number of interface elements that need to call native UI components for rendering during each loading process, reducing the number of interactions with native UI components, and helping to increase the interface loading speed. To a certain extent, it can solve the problem of freezes during interface loading and improve user experience.
[0076] In each embodiment of the present application, the rendering result of the data block to be rendered on the application interface can be referred to as an interface element. It is worth noting that the interface elements on the same application interface can be rendered by the data block to be rendered, or can be rendered by the data item to be rendered. In the embodiment of the present application, the focus is on the interface elements rendered by the data block to be rendered and the application interface containing such interface elements. In other words, the application interface in the embodiment of the present application includes multiple interface elements, and at least one of the multiple interface elements includes multiple data items, and the data items here correspond to the above-mentioned data items to be rendered, and are the rendering results of the above-mentioned data items to be rendered.
[0077] In some application scenarios, the application interface has interactive capabilities, and the interactive capabilities of the application interface are mainly reflected in the interface elements it contains, that is, the interface elements on the application interface need to have interactive capabilities in order to interact with users. In an embodiment of the present application, in order to make the interface elements rendered by the data blocks to be rendered interactive, a UI interactive event can be bound to at least one data block to be rendered, so that the interface elements rendered by at least one data block to be rendered have the ability to interact with users. Depending on the implementation form of the terminal device 101, the UI interactive events it supports will also be different. Optionally, the UI interactive event includes at least one of the following: a click event, a long press event, a double-click event, a touch event, or a sliding event. Optionally, before rendering at least one data block to be rendered onto the application interface, a UI interactive event can be bound to at least one data block to be rendered, but it is not limited to this.
[0078] It is worth noting that in the embodiment of the present application, the UI interaction event bound to the data block to be rendered is different from the UI interaction event in the prior art. After the UI interaction event in the prior art is bound to an object, the response action made according to the trigger operation on the object is also for the object. However, the UI interaction event in the embodiment of the present application is bound to the data block to be rendered, but the response action made according to the trigger event on the interface element rendered by the data block to be rendered is for one or several data items in the interface element, rather than the entire interface element.
[0079] In the embodiment of the present application, after rendering at least one data block to be rendered onto the application interface, if the interface element rendered by the data block to be rendered on the application interface has an interactive capability, the terminal device 101 may further perform the following operations:
[0080] In response to a trigger operation on a target interface element on an application interface, the relative position of the trigger operation in the target interface element is determined; wherein the target interface element is an interface element rendered by any one of at least one data block to be rendered; based on layout information between data items contained in the target interface element, the target data item corresponding to the relative position is determined; and the target data item is processed according to a processing method corresponding to the trigger operation.
[0081] Depending on the application scenario, the UI interaction events bound to the data block to be rendered will be different, and the triggering operations corresponding to the UI interaction events will be different. Accordingly, the processing methods corresponding to the triggering operations will also be different. The following examples illustrate:
[0082] Example 1: The processing method corresponding to the trigger operation is to display the data item at the trigger position at a specified position on the application interface or other application interfaces associated with the application interface. Then, the terminal device 101 can display the target data item at a specified position on the application interface or other associated application interfaces. The specified position can be a corresponding input box or input area on the application interface.
[0083] by Figure 1d Taking the application interface shown as an example, if a user clicks on the country name "Germany" under the pinyin initials D, the terminal device 101 can calculate the relative position of the click operation in the current interface element in response to the user's click operation, and determine that the target data item corresponding to the relative position is "Germany" according to the layout information between the data items contained in the current interface element, and then return to the previous application interface, and display "Germany" in the "Country / Region" input box or input area on the returned application interface, such as Figure 1f shown.
[0084] Example 2: The processing method corresponding to the trigger operation refers to highlighting the data item at the trigger position. Then, the terminal device 101 can highlight the target data item. Among them, the highlighting methods include but are not limited to: highlighting, bold font, italic font, underlining, adding a line box, flashing, and / or scrolling, etc.
[0085] Example 3: The processing method corresponding to the trigger operation refers to jumping to another application interface associated with the target data item. Then, the terminal device 101 can jump to another application interface associated with the target data item. For example, if the target data item is the "product name" on the application interface, then when the user clicks on the "product name", it can jump to the product details page corresponding to the product name. Another example is that if the target data item is the "navigation category control" on the application interface, such as "children's clothing", "home appliances", etc., when the user clicks on the "navigation category control", it can jump to the search result interface corresponding to the corresponding category.
[0086] In an alternative embodiment, it is assumed that the UI interaction events bound to the data block to be rendered include a click event (clickevent), and the response actions corresponding to the click event include: identifying the specific data item (i.e., the target data item) clicked in the interface element (i.e., the target interface element) that is clicked, and performing corresponding processing on the target data item. In this alternative embodiment, the trigger operation on the target interface element is specifically a click operation. Based on this, a method for determining the relative position of the trigger operation in the target interface element includes:
[0087] In response to the trigger operation on the target interface element on the application interface, detect the moving distance panMove of the trigger operation on the application interface; if the moving distance panMove is within the set distance range, for example, -10 < panMove < 10, then determine that the trigger operation is a click operation rather than a sliding operation, and then the trigger position of the trigger operation on the application interface can be determined, and the triggered interface element can be determined, and the triggered interface element is used as the target interface element;
[0088] According to the relative position relationship between the boundary of the target interface element and the reference boundary and the relative position relationship between the trigger position and the reference boundary, calculate the relative position of the trigger position in the target interface element; where the reference boundary is a certain boundary of the application interface to which the target interface element belongs or a certain boundary of the electronic screen displaying the application interface.
[0089] It is worth noting that the reference boundary is specifically which boundary of the application interface or electronic screen, which can be flexibly selected according to the layout style between the data items contained in the target interface element. For example, if the data items contained in the target interface element are arranged from top to bottom, the top boundary of the application interface or electronic screen can be selected as the reference boundary, or the bottom boundary of the application interface or electronic screen can be selected as the reference boundary. For another example, if the data items contained in the target interface element are arranged from left to right, the left boundary of the application interface or electronic screen can be selected as the reference boundary, or the right boundary of the application interface or electronic screen can be selected as the reference boundary.
[0090] In an optional embodiment, it is assumed that the reference boundary is the top boundary of the application interface or the electronic screen. Based on this, the method of calculating the relative position of the trigger position in the target interface element includes: according to the distance between the top boundary of the target interface element and the top boundary of the application interface or the electronic screen and the distance between the trigger position and the top boundary of the application interface or the electronic screen, calculate the distance between the trigger position and the top boundary of the target interface element, and use the distance as the relative position of the trigger operation in the target interface element.
[0091] Continuing with the previous example, Figure 1d Taking the application interface shown in FIG. 1 as an example, the user clicks the country name "Germany" under the pinyin initials D, and the process of the terminal device 101 calculating the distance between the trigger position and the top border of the target interface element is as follows: Figure 1g As shown. Figure 1g In the figure, d1 represents the distance between the top border of the target interface element and the top border of the application interface, d2 represents the distance between the trigger position and the top border of the application interface, and d3 represents the distance between the trigger position and the top border of the target interface element.
[0092] After calculating the distance between the trigger position and the top border of the target interface element, the average height of the data items can be further calculated based on the number of data items contained in the target interface element in the height direction and the overall height of the target interface element; based on the distance between the trigger position and the top border of the target interface element and the average height of the data items, combined with the order of the data items contained in the target interface element in the height direction, the data item at the trigger position is determined as the target data item. Figure 1g , it can be determined that the target data item is the country name "Germany".
[0093] Further, after the target data item is determined, the target data item may be processed accordingly according to the method corresponding to the trigger operation. Figure 1f shown.
[0094] It is worth noting that, in the above-mentioned implementation, the distance between the two objects is used to represent the relative position relationship between the two objects, but it is not limited to the distance. The relative position coordinates of the two objects, or the relative position coordinates of the two objects in a certain direction, can also be used to represent the relative position relationship between the two objects. For example, in the above-mentioned embodiment, the distance between the top boundary of the target interface element and the top boundary of the application interface or electronic screen is used to represent the relative position relationship between the top boundary of the target interface element and the top boundary of the application interface or electronic screen. In addition to this, the relative position coordinates of the top boundary of the target interface element and the top boundary of the application interface or electronic screen can also be used to represent the relative position relationship between the top boundary of the target interface element and the top boundary of the application interface or electronic screen.
[0095] Regarding the case of selecting the bottom border of the application interface or electronic screen as the reference border, or selecting the left border of the application interface or electronic screen as the reference border, or selecting the right border of the application interface or electronic screen as the reference border, the method of calculating the relative position of the trigger position in the target interface element is similar to the above and will not be repeated here.
[0096] In the above embodiment, the interaction method between the user and the application interface is described by taking the interface element containing multiple data items rendered by the data block to be rendered as an example. It should be noted that all interface elements containing multiple data items on the application interface are applicable to the above interaction method. In addition, in the above interaction method, the generation method of "interface elements containing multiple data items" is not limited. The data block to be rendered can be rendered in the manner described in the previous embodiment. Other methods that can render interface elements containing multiple data items are also applicable to the embodiments of the present application.
[0097] Figure 2a A flowchart of an application interface loading method provided for an exemplary embodiment of the present application. The method is described from the perspective of a terminal device, such as Figure 2a As shown, the method includes:
[0098] 21a. In response to the interface loading operation, the interface data required for rendering the application interface is obtained, and the interface data includes multiple data items to be rendered.
[0099] 22a. Divide the multiple data items to be rendered into blocks to obtain at least one data block to be rendered and at least one style attribute of the data block to be rendered.
[0100] 23a. Call the native UI component to render at least one data block to be rendered onto the application interface according to the style attribute.
[0101] In this embodiment, the terminal device runs a cross-platform application and can provide an application interface to the user, and the number of application interfaces can be one or more. For the terminal device, in response to the interface loading operation, the process of providing the corresponding application interface to the user includes but is not limited to: the operation of obtaining the interface data required for rendering the application interface, and the operation of rendering the application interface according to the interface data.
[0102] In some optional embodiments, the interface data already exists in the local storage space of the terminal device, and the terminal device can directly obtain the interface data required for rendering the application interface from the local storage space in response to the interface loading operation. Optionally, the interface data can be pre-issued or pushed to the terminal device by the server device, or pre-stored by the user in the local storage space of the terminal device.
[0103] In other optional embodiments, the interface data needs to be provided in real time by the server device, and the terminal device can send a data request to the server device in response to the interface loading operation; the server device obtains the corresponding interface data according to the data request and returns it to the terminal device; the terminal device receives the interface data returned by the server device.
[0104] After obtaining the interface data required to render the application interface, in order to achieve a visual experience similar to that of the native application, the terminal device can call the native user UI component to render the application interface of the cross-platform application based on the interface data. A data item to be rendered refers to an item of data that needs to be rendered on the application interface, which can be but is not limited to: pictures, text, controls, floating windows, audio and video or scroll bars, etc. Different data items to be rendered can be data of the same type, for example, all text or pictures. Of course, different data items to be rendered can also be data of different types, for example, some data items to be rendered are text, and some data items to be rendered are pictures.
[0105] In this embodiment, in order to improve the loading speed of the application interface and avoid the lag phenomenon as much as possible during the interface loading process, when the interface data required for rendering the application interface includes multiple data items to be rendered, the multiple data items to be rendered can be divided into blocks to obtain at least one data block to be rendered and at least one style attribute of the data block to be rendered; the native UI component is called to render the at least one data block to be rendered onto the application interface according to the style attribute. For the native UI component, the data block to be rendered is used as the rendering unit, and each data block to be rendered is rendered onto the application interface according to the style attribute of each data block to be rendered.
[0106] In the present embodiment, each data block to be rendered includes at least one data item to be rendered. Theoretically, the number of data blocks to be rendered that are divided is less than the number of data items to be rendered, but is not limited to this. In special cases, the number of data blocks to be rendered that are divided can be the same as the number of data items to be rendered, that is, one data item to be rendered is divided into one data block to be rendered. It is worth noting that the probability of the occurrence of special cases is low, and the embodiment of the present application focuses on the case where the number of data blocks to be rendered that are divided is less than the number of data items to be rendered. In the case where the number of data blocks to be rendered that are divided is less than the number of data items to be rendered, compared with the data items to be rendered, the number of calls to the native UI components will be reduced when the data blocks to be rendered are used as rendering units, which reduces the number of interactions with the native UI components, is conducive to improving the interface loading speed, and to a certain extent can solve the problem of jamming during the interface loading process and improve the user experience.
[0107] It is worth noting that the method provided in this embodiment is not only applicable to the case where the interface data includes multiple data items to be rendered, but also applicable to the case where the interface data includes one data item to be rendered. In the case where the interface data includes one data item to be rendered, the data item to be rendered can be used as a data block to be rendered, but the block effect is not obvious enough.
[0108] In the embodiment of the present application, the interface data is not limited, and all data content and data formats that can be rendered on the application interface are applicable to the embodiment of the present application. In an optional embodiment, the interface data is a text list. Optionally, a row of data in the text list is a data item to be rendered; or, a column of data in the text list is a data item to be rendered.
[0109] In an optional embodiment, in step 22a, the plurality of data items to be rendered are divided into blocks, which may include the following methods:
[0110] Divide the multiple data items to be rendered into blocks according to the original display order of the multiple data items to be rendered, to obtain at least one data block to be rendered; or
[0111] According to the attributes of the multiple data items to be rendered, the multiple data items to be rendered are divided into blocks to obtain at least one data block to be rendered.
[0112] Further optionally, the multiple data items to be rendered are divided into blocks according to the original display order between the multiple data items to be rendered to obtain at least one data block to be rendered, including but not limited to the following methods:
[0113] According to the original display order of the multiple data items to be rendered, each N data items to be rendered are divided into a data block to be rendered, where N is a natural number greater than or equal to 2; or
[0114] In the case that the original display order among the multiple data items to be rendered is sorted according to the first letter of the pinyin, the data items to be rendered under the same first letter of the pinyin are divided into a data block to be rendered.
[0115] Further optionally, according to the attributes of the multiple data items to be rendered, the multiple data items to be rendered are divided into blocks to obtain at least one data block to be rendered, including but not limited to the following methods:
[0116] According to the sizes of the multiple data items to be rendered, the data items to be rendered having the same size are divided into a data block to be rendered; and / or
[0117] According to the types of the multiple data items to be rendered, the data items to be rendered of the same type are divided into a data block to be rendered.
[0118] In an optional embodiment, in step 22a, obtaining the style attribute of at least one data block to be rendered may include: generating the style attribute of at least one data block to be rendered according to the original display styles among the plurality of data items to be rendered.
[0119] Further optionally, generating the style attributes of at least one data block to be rendered according to the original display styles among the plurality of data items to be rendered includes: respectively setting the style attributes of the data items to be rendered contained in the at least one data block to be rendered in the data block to which it belongs according to the original style attributes of the data items to be rendered contained in the at least one data block to be rendered. In simple terms, the style attributes of each data block to be rendered are individually set according to the original style attributes of the data items to be rendered contained in each data block to be rendered.
[0120] For each data block to be rendered, the style attributes of each data block to be rendered are set in the same or similar manner according to the original style attributes of the data items to be rendered contained therein, and the first data block to be rendered is used as an example for explanation. The first data block to be rendered is any one of the at least one data block to be rendered.
[0121] For the first data block to be rendered, the style attributes of the data items to be rendered included in the first data block to be rendered may be set according to the original style attributes of the data items to be rendered included in the first data block to be rendered.
[0122] Optionally, the style attributes of the data item to be rendered in the first data block to be rendered include, but are not limited to: line height attribute, line break attribute, font attribute, color attribute and / or line spacing attribute. Based on this, setting the style attributes of the data item to be rendered in the first data block to be rendered according to the original style attributes of the data item to be rendered contained in the first data block to be rendered includes at least one of the following operations:
[0123] According to the original row height attribute of the data item to be rendered contained in the first data block to be rendered, setting the row height attribute of the data item to be rendered (here, referring to the data item to be rendered contained in the first data block to be rendered) in the first data block to be rendered;
[0124] According to the original line break attribute of the data item to be rendered contained in the first data block to be rendered, setting the line break attribute of the data item to be rendered (here, the data item to be rendered contained in the first data block to be rendered) in the first data block to be rendered;
[0125] According to the original font attribute of the data item to be rendered contained in the first data block to be rendered, setting the font attribute of the data item to be rendered (here, the data item to be rendered contained in the first data block to be rendered) in the first data block to be rendered;
[0126] According to the original color attribute of the data item to be rendered contained in the first data block to be rendered, setting the color attribute of the data item to be rendered (here, the data item to be rendered contained in the first data block to be rendered) in the first data block to be rendered;
[0127] According to the original color attribute of the data item to be rendered contained in the first data block to be rendered, setting the color attribute of the data item to be rendered (here, the data item to be rendered contained in the first data block to be rendered) in the first data block to be rendered;
[0128] According to the original line spacing attribute between the data items to be rendered included in the first data block to be rendered, the line spacing attribute between the data items to be rendered (here, the data items to be rendered included in the first data block to be rendered) in the first data block to be rendered is set.
[0129] Further optionally, in the above operations, the original style attributes of the data items to be rendered contained in the first data block to be rendered may be directly set as the style attributes of the corresponding data items to be rendered in the first data block to be rendered.
[0130] In some optional embodiments, in order to make the interface elements rendered by the data blocks to be rendered have interactive capabilities, the method of this embodiment also includes: binding a UI interactive event to at least one data block to be rendered, so that the interface elements rendered by at least one data block to be rendered have the ability to interact with the user. Depending on the implementation form of the terminal device, the UI interactive events it supports will also be different. Optionally, the UI interactive event includes at least one of the following: a click event, a long press event, a double-click event, a touch event, or a sliding event. Optionally, before rendering at least one data block to be rendered onto the application interface, a UI interactive event can be bound to at least one data block to be rendered, but it is not limited to this.
[0131] Furthermore, after rendering at least one data block to be rendered onto the application interface, if the interface element rendered by the data block to be rendered has interactive capabilities, the method of this embodiment further includes the following operations:
[0132] In response to a trigger operation on a target interface element on an application interface, the relative position of the trigger operation in the target interface element is determined; the target interface element is an interface element rendered by any one of at least one data block to be rendered; based on layout information between data items contained in the target interface element, the target data item corresponding to the relative position is determined; and the target data item is processed according to a processing method corresponding to the trigger operation.
[0133] Optionally, the target data item is processed according to a processing method corresponding to the trigger operation, including at least one of the following methods:
[0134] Display the target data item at a specified location of the application interface or other associated application interfaces;
[0135] Highlight the target data item;
[0136] Jump to other application interfaces associated with the target data item.
[0137] Optionally, in response to a trigger operation on a target interface element on an application interface, the relative position of the trigger operation in the target interface element is determined, including: in response to a trigger operation on a target interface element on the application interface, detecting the moving distance of the trigger operation on the application interface; if the moving distance is within a set distance range, determining the trigger position of the trigger operation on the application interface, and taking the triggered interface element as the target interface element; calculating the relative position of the trigger position in the target interface element based on the relative position relationship between the boundary of the target interface element and a reference boundary and the relative position relationship between the trigger position and the reference boundary; wherein the reference boundary is a boundary of the application interface to which the target interface element belongs or a boundary of an electronic screen displaying the application interface.
[0138] It is worth noting that the reference boundary is specifically which boundary of the application interface or electronic screen, which can be flexibly selected according to the layout style between the data items contained in the target interface element. For example, if the data items contained in the target interface element are arranged from top to bottom, the top boundary of the application interface or electronic screen can be selected as the reference boundary, or the bottom boundary of the application interface or electronic screen can be selected as the reference boundary. For another example, if the data items contained in the target interface element are arranged from left to right, the left boundary of the application interface or electronic screen can be selected as the reference boundary, or the right boundary of the application interface or electronic screen can be selected as the reference boundary.
[0139] In an optional embodiment, it is assumed that the reference boundary is the top boundary of the application interface or the electronic screen. Based on this, the method of calculating the relative position of the trigger position in the target interface element includes: according to the distance between the top boundary of the target interface element and the top boundary of the application interface or the electronic screen and the distance between the trigger position and the top boundary of the application interface or the electronic screen, the distance between the trigger position and the top boundary of the target interface element is calculated as the relative position of the trigger operation in the target interface element.
[0140] Optionally, based on the layout information between the data items contained in the target interface element, the target data item corresponding to the relative position is determined, including: calculating the average height of the data items based on the number of data items contained in the target interface element in the height direction and the overall height of the target interface element; and determining the data item at the trigger position as the target data item based on the distance between the trigger position and the top border of the target interface element and the average height of the data items.
[0141] For some descriptions of the method provided in this embodiment, please refer to the corresponding descriptions in the aforementioned system embodiment, which will not be repeated here.
[0142] Figure 2b The following is a flow chart of an application interface interaction method provided by an exemplary embodiment of the present application. The method is described from the perspective of a terminal device, such as Figure 2b As shown, the method includes:
[0143] 21b. Display an application interface including multiple interface elements, wherein at least one of the multiple interface elements includes multiple data items.
[0144] 22b. In response to a trigger operation on a target interface element on the application interface, determine the relative position of the trigger operation in the target interface element; the target interface element is any interface element on the application interface that contains multiple data items.
[0145] 23b. Determine the target data item corresponding to the relative position according to the layout information between the data items included in the target interface element.
[0146] 24b. Process the target data item according to the processing method corresponding to the trigger operation.
[0147] In this embodiment, the application interface has multiple interface elements, and at least one of the multiple interface elements contains multiple data items. The interface element containing multiple data items has interactive capabilities.
[0148] When a user interacts with an interface element containing multiple data items, a trigger operation can be issued to the interface element containing multiple data items, and the trigger operation can be in any manner such as clicking, long pressing, sliding or touching. For ease of description, the interface element where the user initiates the interactive operation is recorded as the target interface element, and the target interface element is any interface element containing multiple data items. The terminal device can respond to the trigger operation on the target interface element on the application interface, determine the relative position of the trigger operation in the target interface element; determine the target data item corresponding to the relative position based on the layout information between the data items contained in the target interface element; and then, process the target data item according to the processing method corresponding to the trigger operation to complete the interactive operation with the target interface element.
[0149] Optionally, depending on the application scenario, the UI interaction event bound to the data block to be rendered may be different, and the trigger operation corresponding to the UI interaction event may be different. Accordingly, the processing method corresponding to the trigger operation may also be different. The following example illustrates:
[0150] Example 1: The processing method corresponding to the trigger operation is to display the data item at the trigger position at a specified position on the application interface or other application interfaces associated with the application interface. Then, the terminal device can display the target data item at a specified position on the application interface or other associated application interfaces. The specified position can be a corresponding input box or input area on the application interface.
[0151] Example 2: The processing method corresponding to the trigger operation is to highlight the data item at the trigger position. Then, the terminal device can highlight the target data item. The highlighting method includes but is not limited to: highlighting, bolding, italicizing, underlining, adding a line frame, flashing and / or scrolling.
[0152] Example 3: The processing method corresponding to the trigger operation is to jump to other application interfaces associated with the target data item. Then, the terminal device can jump to other application interfaces associated with the target data item.
[0153] In an optional embodiment, assuming that the UI interaction event bound to the data block to be rendered includes a click event, the response action corresponding to the click event includes: identifying the specific clicked data item (i.e., the target data item) in the clicked interface element (i.e., the target interface element), and performing corresponding processing on the target data item. In this optional embodiment, the triggering operation on the target interface element is specifically a click operation. Based on this, a method for determining the relative position of the triggering operation in the target interface element includes:
[0154] In response to a trigger operation on a target interface element on the application interface, detect the moving distance panMove of the trigger operation on the application interface; if the moving distance panMove is within a set distance range, for example, -10 < panMove < 10, then determine that the trigger operation is a click operation rather than a swipe operation, and then the trigger position of the trigger operation on the application interface can be determined, and the interface element that is triggered can be determined, and the triggered interface element is used as the target interface element;
[0155] According to the relative position relationship between the boundary of the target interface element and the reference boundary and the relative position relationship between the trigger position and the reference boundary, calculate the relative position of the trigger position in the target interface element; wherein, the reference boundary is a boundary of the application interface to which the target interface element belongs or a boundary of the electronic screen that displays the application interface.
[0156] It should be noted that which boundary of the application interface or the electronic screen the reference boundary specifically is can be flexibly selected according to the layout style among the data items included in the target interface element. For example, if the data items included in the target interface element are arranged from top to bottom, the top boundary of the application interface or the electronic screen can be selected as the reference boundary, or the bottom boundary of the application interface or the electronic screen can also be selected as the reference boundary. Another example is that if the data items included in the target interface element are arranged from left to right, the left boundary of the application interface or the electronic screen can be selected as the reference boundary, or the right boundary of the application interface or the electronic screen can also be selected as the reference boundary.
[0157] In an alternative embodiment, assume that the reference boundary is the top boundary of the application interface or the electronic screen. Based on this, the method for calculating the relative position of the trigger position in the target interface element includes: according to the distance between the top boundary of the target interface element and the top boundary of the application interface or the electronic screen and the distance between the trigger position and the top boundary of the application interface or the electronic screen, calculate the distance between the trigger position and the top boundary of the target interface element, and use this distance as the relative position of the trigger operation in the target interface element.
[0158] Further, after calculating the distance between the trigger position and the top boundary of the target interface element, the average height of the data items can be calculated according to the number of data items included in the target interface element in the height direction and the overall height of the target interface element; according to the distance between the trigger position and the top boundary of the target interface element and the average height of the data items, combined with the order of the data items included in the target interface element in the height direction, determine the data item at the trigger position as the target data item.
[0159] Further, after determining the target data item, the target data item can be processed accordingly according to the manner corresponding to the trigger operation.
[0160] In this embodiment, the "interface element containing multiple data items" can be obtained by rendering the data block to be rendered using the application interface loading method, but is not limited thereto. It can also be obtained by other methods that can render interface elements containing multiple data items.
[0161] By adopting the application interface interaction method provided in this embodiment, when the interface element contains multiple data items, the interaction between the user and the specific data items in the interface element can be realized, thereby solving the interactivity problems faced by the interface elements containing multiple data items and meeting the user's interaction needs.
[0162] It should be noted that in some of the processes described in the above embodiments and the accompanying drawings, multiple operations that appear in a specific order are included, but it should be clearly understood that these operations may not be executed in the order in which they appear in this article or executed in parallel, and the sequence numbers of the operations, such as 21a, 22a, etc., are only used to distinguish between different operations, and the sequence numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this article are used to distinguish different messages, devices, modules, etc., do not represent the order of precedence, and do not limit the "first" and "second" to be different types.
[0163] Figure 3 The following is a schematic diagram of a terminal device provided by an exemplary embodiment of the present application. Figure 3 As shown, the terminal device includes: a memory 31, a processor 32 and a display screen 33.
[0164] The memory 31 is used to store computer programs and can be configured to store various other data to support operations on the terminal device. Examples of such data include instructions for any application or method used to operate on the terminal device, contact data, phone book data, messages, pictures, videos, and native UI components. Optionally, the application here includes a cross-platform application.
[0165] The display screen 33 is used to display the application interface, where the application interface is the application interface in the cross-platform application. Of course, the display screen 33 can also display the application interface in the native application.
[0166] The processor 32 is coupled to the memory 31 and is used to execute the computer program in the memory 31 to:
[0167] In response to the interface loading operation, interface data required for rendering the application interface is obtained, wherein the interface data includes a plurality of data items to be rendered;
[0168] Dividing the plurality of data items to be rendered into blocks to obtain at least one data block to be rendered and a style attribute of the at least one data block to be rendered;
[0169] The native UI component is called to render the at least one to-be-rendered data block onto the application interface according to the style attribute.
[0170] In an optional embodiment, the interface data is a text list. Optionally, a row of data in the text list is a data item to be rendered; or a column of data in the text list is a data item to be rendered.
[0171] In an optional embodiment, when the processor 32 divides the multiple data items to be rendered into blocks, it is specifically used to: divide the multiple data items to be rendered into blocks according to the original display order between the multiple data items to be rendered to obtain at least one data block to be rendered; or divide the multiple data items to be rendered into blocks according to the attributes of the multiple data items to be rendered to obtain at least one data block to be rendered.
[0172] Further optionally, when the processor 32 divides the multiple data items to be rendered into blocks according to the original display order between the multiple data items to be rendered, it is specifically used to: divide every N data items to be rendered into a data block to be rendered according to the original display order between the multiple data items to be rendered, where N is a natural number greater than or equal to 2; or, when the original display order between the multiple data items to be rendered is sorted by the first letters of the pinyin, divide the data items to be rendered with the same first letter of the pinyin into a data block to be rendered.
[0173] Further optionally, when the processor 32 divides the multiple data items to be rendered into blocks according to the attributes of the multiple data items to be rendered, it is specifically used to: divide the data items to be rendered of the same size into one data block to be rendered according to the sizes of the multiple data items to be rendered; and / or, divide the data items to be rendered of the same type into one data block to be rendered according to the types of the multiple data items to be rendered.
[0174] In an optional embodiment, when obtaining the style attribute of at least one data block to be rendered, the processor 32 is specifically configured to: generate the style attribute of at least one data block to be rendered according to the original display styles between the plurality of data items to be rendered.
[0175] Further optionally, when the processor 32 generates the style attributes of at least one data block to be rendered according to the original display styles among the plurality of data items to be rendered, it is specifically configured to: respectively set the style attributes of the data items to be rendered contained in the at least one data block to be rendered in the data block to be rendered to which it belongs, according to the original style attributes of the data items to be rendered contained in the at least one data block to be rendered. In short, the style attributes of each data block to be rendered are individually set according to the original style attributes of the data items to be rendered contained in each data block to be rendered.
[0176] Furthermore, the processor 32 is specifically configured to: for the first data block to be rendered, set the style attribute of the data item to be rendered in the first data block to be rendered according to the original style attribute of the data item to be rendered contained in the first data block to be rendered, including at least one of the following operations:
[0177] According to the original row height attribute of the data item to be rendered contained in the first data block to be rendered, setting the row height attribute of the data item to be rendered (here, referring to the data item to be rendered contained in the first data block to be rendered) in the first data block to be rendered;
[0178] According to the original line break attribute of the data item to be rendered contained in the first data block to be rendered, setting the line break attribute of the data item to be rendered (here, the data item to be rendered contained in the first data block to be rendered) in the first data block to be rendered;
[0179] According to the original font attribute of the data item to be rendered contained in the first data block to be rendered, setting the font attribute of the data item to be rendered (here, the data item to be rendered contained in the first data block to be rendered) in the first data block to be rendered;
[0180] According to the original color attribute of the data item to be rendered contained in the first data block to be rendered, setting the color attribute of the data item to be rendered (here, the data item to be rendered contained in the first data block to be rendered) in the first data block to be rendered;
[0181] According to the original color attribute of the data item to be rendered contained in the first data block to be rendered, setting the color attribute of the data item to be rendered (here, the data item to be rendered contained in the first data block to be rendered) in the first data block to be rendered;
[0182] According to the original line spacing attribute between the data items to be rendered included in the first data block to be rendered, the line spacing attribute between the data items to be rendered (here, the data items to be rendered included in the first data block to be rendered) in the first data block to be rendered is set.
[0183] Further optionally, in the above operations, the original style attributes of the data items to be rendered contained in the first data block to be rendered may be directly set as the style attributes of the corresponding data items to be rendered in the first data block to be rendered.
[0184] The first data block to be rendered is any one of the at least one data block to be rendered.
[0185] In an optional embodiment, the processor 32 is further used to: bind a UI interaction event to at least one data block to be rendered, so that the interface element rendered by the at least one data block to be rendered has the ability to interact with the user. Optionally, the UI interaction event includes at least one of the following: a click event, a long press event, a double-click event, a touch event, or a sliding event. Optionally, before rendering the at least one data block to be rendered onto the application interface, a UI interaction event can be bound to the at least one data block to be rendered, but is not limited thereto.
[0186] In an optional embodiment, the processor 32 is also used to: in response to a trigger operation on a target interface element on the application interface, determine the relative position of the trigger operation in the target interface element; the target interface element is an interface element rendered by any data block of the at least one data block to be rendered; determine the target data item corresponding to the relative position based on layout information between data items contained in the target interface element; and process the target data item according to a processing method corresponding to the trigger operation.
[0187] Further optionally, when the processor 32 processes the target data item in a processing mode corresponding to the trigger operation, it is specifically configured to perform at least one of the following operations:
[0188] Display the target data item at a specified location of the application interface or other associated application interfaces;
[0189] Highlight the target data item;
[0190] Jump to other application interfaces associated with the target data item.
[0191] Further optionally, when determining the relative position of the trigger operation in the target interface element, the processor 32 is specifically used to: in response to the trigger operation on the target interface element on the application interface, detect the moving distance of the trigger operation on the application interface; if the moving distance is within a set distance range, determine the trigger position of the trigger operation on the application interface, and use the triggered interface element as the target interface element; calculate the relative position of the trigger position in the target interface element based on the relative position relationship between the boundary of the target interface element and the reference boundary and the relative position relationship between the trigger position and the reference boundary; wherein the reference boundary is a boundary of the application interface to which the target interface element belongs or a boundary of the electronic screen displaying the application interface.
[0192] It is worth noting that the reference boundary is specifically which boundary of the application interface or electronic screen, which can be flexibly selected according to the layout style between the data items contained in the target interface element. For example, if the data items contained in the target interface element are arranged from top to bottom, the top boundary of the application interface or electronic screen can be selected as the reference boundary, or the bottom boundary of the application interface or electronic screen can be selected as the reference boundary. For another example, if the data items contained in the target interface element are arranged from left to right, the left boundary of the application interface or electronic screen can be selected as the reference boundary, or the right boundary of the application interface or electronic screen can be selected as the reference boundary.
[0193] In an optional embodiment, it is assumed that the reference boundary is the top boundary of the application interface or the electronic screen. Based on this, when calculating the relative position of the trigger position in the target interface element, the processor 32 is specifically used to: calculate the distance between the trigger position and the top boundary of the target interface element as the relative position of the trigger operation in the target interface element according to the distance between the top boundary of the target interface element and the top boundary of the application interface or the electronic screen and the distance between the trigger position and the top boundary of the application interface or the electronic screen.
[0194] Further optionally, when determining the target data item corresponding to the relative position, the processor 32 is specifically used to: calculate the average height of the data items based on the number of data items included in the target interface element in the height direction and the overall height of the target interface element; and determine the data item at the trigger position as the target data item based on the distance between the trigger position and the top border of the target interface element and the average height of the data items.
[0195] Further, if Figure 3 As shown, the terminal device also includes: a communication component 34, a power component 35, an audio component 36 and other components. Figure 3 Only some components are shown schematically, which does not mean that the terminal equipment only includes Figure 3 Components shown.
[0196] Accordingly, an embodiment of the present application also provides a computer-readable storage medium storing a computer program, which, when executed, can implement each step of the application interface loading method that can be executed by the terminal device in the above method embodiment.
[0197] Figure 4 This is a schematic diagram of the structure of another terminal device provided by an exemplary embodiment of the present application. Figure 4 As shown, the terminal device includes: a memory 41, a processor 42 and a display screen 43.
[0198] The memory 41 is used to store computer programs and can be configured to store various other data to support operations on the terminal device. Examples of such data include instructions for any application or method used to operate on the terminal device, contact data, phone book data, messages, pictures, videos, and native UI components. Optionally, the application here includes a cross-platform application.
[0199] The display screen 43 is used to display an application interface including a plurality of interface elements, at least one of the plurality of interface elements including a plurality of data items.
[0200] The processor 42 is coupled to the memory 41 and is configured to execute the computer program in the memory 41 to:
[0201] In response to a trigger operation on a target interface element on the application interface, determining a relative position of the trigger operation in the target interface element; the target interface element is any interface element on the application interface that includes a plurality of data items;
[0202] Determining the target data item corresponding to the relative position according to the layout information between the data items included in the target interface element;
[0203] The target data item is processed according to the processing method corresponding to the trigger operation.
[0204] Further optionally, when the processor 42 processes the target data item in a processing mode corresponding to the trigger operation, it is specifically configured to perform at least one of the following operations:
[0205] Display the target data item at a specified location of the application interface or other associated application interfaces;
[0206] Highlight the target data item;
[0207] Jump to other application interfaces associated with the target data item.
[0208] Further optionally, when determining the relative position of the trigger operation in the target interface element, the processor 42 is specifically used to: in response to the trigger operation on the target interface element on the application interface, detect the moving distance of the trigger operation on the application interface; if the moving distance is within a set distance range, determine the trigger position of the trigger operation on the application interface, and use the triggered interface element as the target interface element; calculate the relative position of the trigger position in the target interface element based on the relative position relationship between the boundary of the target interface element and the reference boundary and the relative position relationship between the trigger position and the reference boundary; wherein the reference boundary is a boundary of the application interface to which the target interface element belongs or a boundary of the electronic screen displaying the application interface.
[0209] It is worth noting that the reference boundary is specifically which boundary of the application interface or electronic screen, which can be flexibly selected according to the layout style between the data items contained in the target interface element. For example, if the data items contained in the target interface element are arranged from top to bottom, the top boundary of the application interface or electronic screen can be selected as the reference boundary, or the bottom boundary of the application interface or electronic screen can be selected as the reference boundary. For another example, if the data items contained in the target interface element are arranged from left to right, the left boundary of the application interface or electronic screen can be selected as the reference boundary, or the right boundary of the application interface or electronic screen can be selected as the reference boundary.
[0210] In an optional embodiment, it is assumed that the reference boundary is the top boundary of the application interface or the electronic screen. Based on this, when calculating the relative position of the trigger position in the target interface element, the processor 42 is specifically used to: calculate the distance between the trigger position and the top boundary of the target interface element as the relative position of the trigger operation in the target interface element according to the distance between the top boundary of the target interface element and the top boundary of the application interface or the electronic screen and the distance between the trigger position and the top boundary of the application interface or the electronic screen.
[0211] Further optionally, when determining the target data item corresponding to the above-mentioned relative position, the processor 42 is specifically used to: calculate the average height of the data items based on the number of data items included in the target interface element in the height direction and the overall height of the target interface element; determine the data item at the trigger position as the target data item based on the distance between the trigger position and the top border of the target interface element and the average height of the data items.
[0212] Further, if Figure 4 As shown, the terminal device also includes: a communication component 44, a power component 45, an audio component 46 and other components. Figure 4 Only some components are shown schematically, which does not mean that the terminal equipment only includes Figure 4 Components shown.
[0213] Accordingly, an embodiment of the present application also provides a computer-readable storage medium storing a computer program, which, when executed, can implement each step of the application interface interaction method that can be executed by a terminal device in the above method embodiment.
[0214] Above Figure 3 and Figure 4The memory in can be implemented by any type of volatile or non-volatile storage device or a combination of them, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.
[0215] Above Figure 3 and Figure 4 The communication component in is configured to facilitate wired or wireless communication between the device where the communication component is located and other devices. The device where the communication component is located can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component may also include a near field communication (NFC) module, a radio frequency identification (RFID) technology, an infrared data association (IrDA) technology, an ultra-wideband (UWB) technology, a Bluetooth (BT) technology, etc.
[0216] Above Figure 3 and Figure 4 The display screen in the embodiment may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.
[0217] Above Figure 3 and Figure 4 The power supply component in the device provides power to various components of the device where the power supply component is located. The power supply component may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device where the power supply component is located.
[0218] Above Figure 3 and Figure 4 The audio component in can be configured to output and / or input audio signals. For example, the audio component includes a microphone (MIC), and when the device where the audio component is located is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in a memory or sent via a communication component. In some embodiments, the audio component also includes a speaker for outputting an audio signal.
[0219] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0220] The present invention is described with reference to the flowchart and / or block diagram of the method, device (system), and computer program product according to the embodiment of the present invention. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the process and / or box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0221] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0222] These computer program instructions may also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0223] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0224] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0225] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0226] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0227] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A method for loading an application interface, characterized in that: include: In response to the interface loading operation, interface data required for rendering the application interface of the cross-platform application program is obtained, wherein the interface data includes a plurality of data items to be rendered, and the data items to be rendered refer to data that needs to be rendered on the application interface; Dividing the multiple data items to be rendered into blocks to obtain at least one data block to be rendered and a style attribute of the at least one data block to be rendered, wherein the data block to be rendered includes at least one data item to be rendered, and the number of the data blocks to be rendered is less than the number of the data items to be rendered; The native UI component is called to render the at least one data block to be rendered onto the application interface according to the style attribute.
2. The method according to claim 1, characterized in that Dividing the plurality of data items to be rendered into blocks to obtain at least one data block to be rendered includes: Divide the multiple data items to be rendered into blocks according to the original display order between the multiple data items to be rendered to obtain at least one data block to be rendered; or According to the attributes of the multiple data items to be rendered, the multiple data items to be rendered are divided into blocks to obtain at least one data block to be rendered.
3. The method according to claim 2, characterized in that According to the original display order of the multiple data items to be rendered, the multiple data items to be rendered are divided into blocks to obtain at least one data block to be rendered, including: According to the original display order of the plurality of data items to be rendered, each N data items to be rendered are divided into a data block to be rendered, where N is a natural number greater than or equal to 2; or In the case that the original display order among the multiple data items to be rendered is sorted according to the first letters of the pinyin, the data items to be rendered under the same first letter of the pinyin are divided into a data block to be rendered.
4. The method according to claim 2, characterized in that: According to the attributes of the multiple data items to be rendered, the multiple data items to be rendered are divided into blocks to obtain at least one data block to be rendered, including: According to the sizes of the multiple data items to be rendered, the data items to be rendered having the same size are divided into a data block to be rendered; and / or According to the types of the multiple data items to be rendered, the data items to be rendered of the same type are divided into a data block to be rendered.
5. The method according to claim 1, characterized in that Obtaining the style attribute of the at least one data block to be rendered includes: The style attribute of the at least one data block to be rendered is generated according to the original display styles among the multiple data items to be rendered.
6. The method according to claim 5, characterized in that Generating the style attribute of the at least one data block to be rendered according to the original display styles among the plurality of data items to be rendered includes: According to the original style attributes of the data items to be rendered respectively included in the at least one data block to be rendered, the style attributes of the data items to be rendered respectively included in the at least one data block to be rendered in the data block to which it belongs are set respectively.
7. The method according to claim 6, characterized in that For a first data block to be rendered, setting the style attributes of the data items to be rendered included in the first data block to be rendered in the first data block to be rendered according to the original style attributes of the data items to be rendered included in the first data block to be rendered, includes at least one of the following operations: According to the original row height attribute of the data item to be rendered contained in the first data block to be rendered, setting the row height attribute of the data item to be rendered in the first data block to be rendered; According to the original line break attribute of the data item to be rendered contained in the first data block to be rendered, setting the line break attribute of the data item to be rendered in the first data block to be rendered; According to the original font attribute of the data item to be rendered contained in the first data block to be rendered, setting the font attribute of the data item to be rendered in the first data block to be rendered; According to the original color attribute of the data item to be rendered contained in the first data block to be rendered, setting the color attribute of the data item to be rendered in the first data block to be rendered; According to the original color attribute of the data item to be rendered contained in the first data block to be rendered, setting the color attribute of the data item to be rendered in the first data block to be rendered; Setting a line spacing attribute between the data items to be rendered in the first data block to be rendered according to an original line spacing attribute between the data items to be rendered contained in the first data block to be rendered; The first data block to be rendered is any data block to be rendered among the at least one data block to be rendered.
8. The method according to claim 1, characterized in that Also includes: A UI interaction event is bound to the at least one data block to be rendered, so that the interface element rendered by the at least one data block to be rendered has the ability to interact with the user.
9. The method according to claim 8, characterized in that The UI interaction event includes at least one of the following: a click event, a long press event, a double-click event, a touch event or a sliding event.
10. The method according to any one of claims 1 to 9, characterized in that: After rendering the at least one to-be-rendered data block onto the application interface, the method further includes: In response to a trigger operation on a target interface element on the application interface, determining a relative position of the trigger operation in the target interface element; the target interface element is an interface element rendered by any data block in the at least one data block to be rendered; Determining the target data item corresponding to the relative position according to the layout information between the data items included in the target interface element; The target data item is processed according to the processing method corresponding to the trigger operation.
11. The method according to claim 10, characterized in that The target data item is processed according to the processing method corresponding to the trigger operation, including at least one of the following methods: Displaying the target data item at a designated location of the application interface or other associated application interfaces; Highlighting the target data item; Jump to other application interfaces associated with the target data item.
12. The method according to claim 10, characterized in that In response to a triggering operation on a target interface element on the application interface, determining a relative position of the triggering operation in the target interface element includes: In response to a trigger operation on a target interface element on the application interface, detecting a moving distance of the trigger operation on the application interface; If the moving distance is within the set distance range, determining the trigger position of the trigger operation on the application interface, and using the triggered interface element as the target interface element; Calculating the relative position of the trigger position in the target interface element according to the relative position relationship between the boundary of the target interface element and the reference boundary and the relative position relationship between the trigger position and the reference boundary; The reference boundary is a boundary of the application interface or a boundary of an electronic screen displaying the application interface.
13. The method according to claim 12, characterized in that The reference boundary is the top boundary of the application interface or the electronic screen, and the relative position of the trigger position in the target interface element is calculated according to the relative position relationship between the boundary of the target interface element and the reference boundary and the relative position relationship between the trigger position and the reference boundary, including: Based on the distance between the top border of the target interface element and the top border of the application interface or electronic screen and the distance between the trigger position and the top border of the application interface or electronic screen, the distance between the trigger position and the top border of the target interface element is calculated as the relative position of the trigger operation in the target interface element.
14. The method according to claim 13, characterized in that Determining the target data item corresponding to the relative position according to the layout information between the data items included in the target interface element includes: Calculate the average height of the data items according to the number of data items included in the height direction of the target interface element and the overall height of the target interface element; According to the distance between the trigger position and the top border of the target interface element and the average height of the data items, the data item at the trigger position is determined as the target data item.
15. The method according to any one of claims 1 to 9, characterized in that: The interface data is a text-type list, and a row of data in the list is a data item to be rendered.
16. An application interface interaction method, characterized in that: include: Displaying an application interface including a plurality of interface elements, each interface element is a data block obtained by dividing data items on the application interface into blocks when the application interface is displayed, each interface element includes at least one data item, and at least one interface element among the plurality of interface elements includes a plurality of data items; In response to a trigger operation on a target interface element on the application interface, determining a relative position of the trigger operation in the target interface element; the target interface element is any interface element on the application interface that includes a plurality of data items; Determining the target data item corresponding to the relative position according to the layout information between the data items included in the target interface element; The target data item is processed according to the processing method corresponding to the trigger operation.
17. The method according to claim 16, characterized in that In response to a triggering operation on a target interface element on the application interface, determining a relative position of the triggering operation in the target interface element includes: In response to a trigger operation on a target interface element on the application interface, detecting a moving distance of the trigger operation on the application interface; If the moving distance is within the set distance range, determining the trigger position of the trigger operation on the application interface, and using the triggered interface element as the target interface element; Calculating the relative position of the trigger position in the target interface element according to the relative position relationship between the boundary of the target interface element and the reference boundary and the relative position relationship between the trigger position and the reference boundary; The reference boundary is a boundary of the application interface or a boundary of an electronic screen displaying the application interface.
18. The method according to claim 17, characterized in that The reference boundary is the top boundary of the application interface or the electronic screen, and the relative position of the trigger position in the target interface element is calculated according to the relative position relationship between the boundary of the target interface element and the reference boundary and the relative position relationship between the trigger position and the reference boundary, including: Based on the distance between the top border of the target interface element and the top border of the application interface or electronic screen and the distance between the trigger position and the top border of the application interface or electronic screen, the distance between the trigger position and the top border of the target interface element is calculated as the relative position of the trigger operation in the target interface element.
19. The method according to claim 18, characterized in that Determining the target data item corresponding to the relative position according to the layout information between the data items included in the target interface element includes: Calculate the average height of the data items according to the number of data items included in the height direction of the target interface element and the overall height of the target interface element; According to the distance between the trigger position and the top border of the target interface element and the average height of the data items, the data item at the trigger position is calculated as the target data item.
20. A terminal device, characterized in that: include: Memory, processor and display screen; The memory is used to store computer programs and native UI components; The display screen is used to display the application interface; The processor, coupled to the memory, is configured to execute the computer program to: In response to the interface loading operation, interface data required for rendering the application interface of the cross-platform application program is obtained, wherein the interface data includes a plurality of data items to be rendered, and the data items to be rendered refer to data that needs to be rendered on the application interface; Dividing the multiple data items to be rendered into blocks to obtain at least one data block to be rendered and a style attribute of the at least one data block to be rendered, wherein the data block to be rendered includes at least one data item to be rendered, and the number of the data blocks to be rendered is less than the number of the data items to be rendered; The native UI component is called to render the at least one data block to be rendered onto the application interface according to the style attribute.
21. The terminal device according to claim 20, characterized in that: The processor is further configured to: In response to a trigger operation on a target interface element on the application interface, determining a relative position of the trigger operation in the target interface element; the target interface element is an interface element rendered by any data block in the at least one data block to be rendered; Determining the target data item corresponding to the relative position according to the layout information between the data items included in the target interface element; The target data item is processed according to the processing method corresponding to the trigger operation.
22. A computer-readable storage medium storing computer instructions, characterized in that: When the computer instructions are executed by one or more processors, the one or more processors are caused to execute the steps in the method according to any one of claims 1 to 15.
23. A terminal device, characterized in that: include: Memory, processor and display screen; The memory is used to store computer programs; The display screen is used to display an application interface including a plurality of interface elements, each interface element is a data block obtained by dividing data items on the application interface when the application interface is displayed, each interface element includes at least one data item, and at least one interface element among the plurality of interface elements includes a plurality of data items; The processor, coupled to the memory, is configured to execute the computer program to: In response to a trigger operation on a target interface element on the application interface, determining a relative position of the trigger operation in the target interface element; the target interface element is any interface element on the application interface that includes a plurality of data items; Determining the target data item corresponding to the relative position according to the layout information between the data items included in the target interface element; The target data item is processed according to the processing method corresponding to the trigger operation.
24. A computer-readable storage medium storing computer instructions, characterized in that: When the computer instructions are executed by one or more processors, the one or more processors are caused to execute the steps in the method according to any one of claims 16 to 19.
