Page display method and device, electronic equipment, medium and program product

By obtaining the device type and display capabilities of the page display device, obtaining the target display elements and establishing a WebAssembly module, the problem of inability to flexibly adapt to different devices and business scenarios in the existing technology is solved, and efficient and flexible page display effects are achieved.

CN119883469APending Publication Date: 2025-04-25CHINA UNITED NETWORK COMM GRP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411944534.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-26
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

The prior art cannot flexibly adapt to page displays in different devices and business scenarios, resulting in differences in display effects on different devices.

Method used

By obtaining the device type and display capabilities of the page display device, obtain the target display elements of the business scenario to be displayed based on this information, and establish a WebAssembly module to load and render these elements.

Benefits of technology

It realizes flexible page display in different devices and business scenarios, improves the consistency and user experience of display effects, and reduces the burden on the back-end server and improves the response speed and performance of the front-end.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119883469A_ABST
    Figure CN119883469A_ABST
Patent Text Reader

Abstract

The invention provides a page display method and device, electronic equipment, a medium and a program product. The method comprises the steps that based on a page display request initiated by a user, the equipment type of page display equipment is acquired, and the page display request comprises a to-be-displayed business scene; the display capability of the page display equipment is obtained according to the equipment type, target display elements of the to-be-displayed business scene are obtained according to the display capability, and the display capability comprises hardware capability and software capability; and according to the target display element, establishing a WebAssembly module of the to-be-displayed business scene, so that the page display device loads the WebAssembly module, and renders and displays the target display element corresponding to the to-be-displayed business scene. The method provided by the invention is flexibly adapted to different devices and service scenes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a page display method, device, electronic device, medium and program product. Background Art

[0002] With the diversification of mobile devices and browsers, front-end development needs to face the adaptation issues of different devices and platforms, which increases the complexity of development and maintenance.

[0003] In traditional page display implementation solutions, the display logic is mainly implemented by tools such as viewports, and then adapted. This display process is fixed and static, and cannot be flexibly adapted to different devices and business scenarios, resulting in differences in display effects on different devices.

[0004] Therefore, the present application proposes a page display method to solve the above problems. Summary of the invention

[0005] The embodiments of the present application provide a page display method, device, electronic device, medium and program product, which are used to solve the problem that the prior art cannot be flexibly adapted to display on different devices and business scenarios.

[0006] In a first aspect, the present application provides a page display method, comprising:

[0007] Based on a page display request initiated by a user, obtaining a device type of a page display device, wherein the page display request includes a business scenario to be displayed;

[0008] Acquire the display capability of the page display device according to the device type, and acquire the target display element of the business scenario to be displayed according to the display capability, wherein the display capability includes hardware capability and software capability;

[0009] A WebAssembly module of the business scenario to be displayed is established according to the target display element, so that the page display device loads the WebAssembly module and renders and displays the target display element corresponding to the business scenario to be displayed.

[0010] In a possible implementation, acquiring the target display element of the to-be-displayed business scenario according to the display capability includes:

[0011] According to the display capability, at least one element type is obtained from multiple element types as the target display element; wherein,

[0012] The element types include text titles, text bodies, pictures, borders, backgrounds and sizes; the hardware capabilities in the display capabilities include hardware computing power and display resolution; and the software capabilities in the display capabilities include software computing power.

[0013] In a possible implementation, establishing the WebAssembly module of the to-be-displayed business scenario according to the target display element includes:

[0014] When establishing a rust module, load the wasm_bindgen module, and use the wasm_bindgen module to mark the properties of the rendering function of the rust module;

[0015] When establishing the html variable of the rendering function, define an html string, insert a div tag into the html string, parse and traverse the data of the business scenario to be displayed, construct the traversed data into html code, insert the html code into the html string, and insert an end tag into the html string;

[0016] When establishing the CSS variable of the rendering function, construct the CSS style code corresponding to the target display element;

[0017] Call the format macro command to output the html variable and the css variable, complete the construction of the rust module, and compile the constructed rust module into the WebAssembly module.

[0018] In a possible implementation, causing the page presentation device to load the WebAssembly module includes:

[0019] When establishing the first asynchronous function, declare a module variable for storing the WebAssembly module to be loaded;

[0020] In the WebAssembly module to be loaded, the WebAssembly module to be loaded is obtained according to the device type to complete the target loading.

[0021] In a possible implementation, the rendering and displaying of the target display element corresponding to the business scenario to be displayed includes:

[0022] When establishing the second asynchronous function, establishing a waiting function to wait for the first asynchronous function to complete the target loading;

[0023] Call the WebAssembly module loaded by the target, and pass in the target display element of the business scenario to be displayed;

[0024] The target display element is rendered and displayed at the display point of the page display device.

[0025] In a possible implementation, obtaining the device type of the page display device based on the page display request initiated by the user includes:

[0026] Using a regular expression, confirm whether a character representing the device type exists in the user agent string in the page display request;

[0027] If there are characters representing the device type, the device type of the page display device is confirmed according to the characters, wherein different characters are used to represent the mobile device type and the desktop device type respectively.

[0028] In a second aspect, the present application provides a page display device, comprising:

[0029] An acquisition module, used to acquire a device type of a page display device based on a page display request initiated by a user, wherein the page display request includes a business scenario to be displayed;

[0030] A processing module, configured to obtain the display capability of the page display device according to the device type, and obtain the target display element of the business scenario to be displayed according to the display capability, wherein the display capability includes hardware capability and software capability;

[0031] A display module is used to establish a WebAssembly module of the business scenario to be displayed according to the target display element, so that the page display device loads the WebAssembly module and renders and displays the target display element corresponding to the business scenario to be displayed.

[0032] In a third aspect, the present application provides an electronic device, including: at least one processor and a memory;

[0033] The memory stores computer-executable instructions;

[0034] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the page display method as described above.

[0035] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the page display method as described above.

[0036] In a fifth aspect, the present application provides a computer program product, which includes instructions, and when the instructions are executed on an electronic device, the electronic device implements the page display method as described above.

[0037] The present application provides a page display method, device, electronic device, medium and program product, which obtains the device type of a page display device based on a page display request initiated by a user, wherein the page display request includes a business scenario to be displayed; obtains the display capability of the page display device according to the device type, and obtains the target display element of the business scenario to be displayed according to the display capability, wherein the display capability includes hardware capability and software capability; establishes a WebAssembly module of the business scenario to be displayed according to the target display element, so that the page display device loads the WebAssembly module and renders and displays the target display element corresponding to the business scenario to be displayed.

[0038] In the above method, according to the page display request initiated by the user, the device type of the page display device to be displayed on the page is confirmed, so as to confirm the display capability of the page display device according to the device type; the display capabilities of the page display devices are different, and different display designs can be performed for different business scenarios to display different target display elements to flexibly adapt to the page display devices; according to the target display elements to be displayed, a WebAssembly module of the business scenario to be displayed is constructed, the WebAssembly module is loaded and the corresponding target display element rendering and display are completed, which is suitable for different performance requirements of different devices. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0040] Figure 1 A schematic diagram of a page display scenario provided in an embodiment of the present application;

[0041] Figure 2 A schematic diagram of a page display method provided in an embodiment of the present application Figure 1 ;

[0042] Figure 3 A schematic diagram of a page display method provided in an embodiment of the present application Figure 2 ;

[0043] Figure 4 A schematic diagram of a page display method provided in an embodiment of the present application Figure 3 ;

[0044] Figure 5A diagram of a page display device provided by an embodiment of the present invention;

[0045] Figure 6 A hardware schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0046] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0047] In traditional page display implementation solutions, the display logic is mainly implemented by tools such as viewports, and then adapted. This display process is fixed and static, and cannot be flexibly adapted to different devices and business scenarios, resulting in differences in display effects on different devices.

[0048] Although different page display methods can be used in different scenarios, the applicability of the methods needs to be considered during the selection process. Whether the traditional front-end implementation methods have differences in effects and performance on different devices, and whether special settings are required according to the device type, lead to a lack of multi-terminal adaptation effect, complex development and maintenance, high maintenance costs, and poor versatility.

[0049] The existing data parsing and rendering operations need to be performed on the back-end server, resulting in slow front-end response and affecting user experience.

[0050] Therefore, the present application proposes a page display method to adapt different page displays while considering the display capabilities and business scenarios of different device types; and data parsing and rendering can be completed on the front end to improve the response speed and performance of the front end.

[0051] The implementation process of a page display method proposed in this application is described in detail below with reference to the accompanying drawings and specific embodiments.

[0052] Figure 1 A schematic diagram of a page display scenario provided in an embodiment of the present application. Figure 1 As shown, the system includes: a page display device and a server; wherein the page display device includes a mobile phone, a tablet, a computer and other devices, and the computer is also called a desktop device;

[0053] The server can be used to confirm the device type of the page display device according to the page display request initiated by the user, and statistically calculate the display capability of the page display device, which includes hardware capability and software capability. For example, the CPU computing power in the hardware capability will affect the display calculation speed, etc. When the computing power is low, it is not convenient to display too many target display elements.

[0054] Select a business scenario to be displayed from multiple business scenarios; according to the display capability of the page display device, select a corresponding appropriate target display element according to the selected business scenario to be displayed; and establish a WebAssembly module of the business scenario to be displayed according to the target display element; the WebAssembly module is a module composed of efficient and portable low-level bytecodes in binary format for running in modern Web browsers;

[0055] The page display device can be used to load its corresponding WebAssembly module, and perform corresponding rendering and display, and display the content suitable for its own display, for example, displaying the text title, but not displaying the text body and other content. Ultimately, appropriate page display is achieved in different scenarios and different devices.

[0056] Figure 2 A schematic diagram of a page display method provided in an embodiment of the present application Figure 1 .like Figure 2 As shown, the method includes:

[0057] S201. Based on a page display request initiated by a user, obtain a device type of a page display device, wherein the page display request includes a business scenario to be displayed.

[0058] The user may initiate a page display request on the page display device, and the server may obtain the device type of the page display device according to the relevant information of the page display device carried in the page display request. The relevant information of the page display device may also be a relevant device identifier;

[0059] Different device types may have different display capabilities, so we need to distinguish the device types first to facilitate subsequent processing for different devices. Different business scenarios may also require different content to be displayed, so different device types may display different business scenarios with different degrees of completeness. For example, a business scenario may be designed to display the title and text, while some devices only need to display the title.

[0060] The specific process of confirming the device type displayed on the page:

[0061] For example, by using a regular expression, it is confirmed whether a character representing the device type exists in the user agent string in the page display request;

[0062] If there are characters representing the device type, the device type of the page display device is confirmed according to the characters, wherein different characters are used to represent the mobile device type and the desktop device type respectively.

[0063] Regular expression is a tool for matching character patterns in strings. It is widely used in text search, text replacement, data validation and other fields. Regular expressions can be used to parse the information of the user agent string in the page display request to confirm whether there are characters indicating the device type in the user agent string. For example, characters indicating the mobile device type and desktop device type. Characters indicating the mobile device type include mobile, android, iphone and ipad. If you want to distinguish between mobile devices and tablet devices, you can use mobile, android and iphone as characters indicating mobile devices and ipad as characters indicating tablet devices. Characters indicating desktop device types include tablet. The corresponding device type can be confirmed based on the characters indicating the device type.

[0064] Confirm whether the user agent string in the page display request contains characters indicating the device type. An example is as follows:

[0065] Use regular expressions to check whether there are characters representing mobile devices in the user agent string. If so, confirm that the device type is a mobile device.

[0066] If there are no characters representing mobile devices in the user agent string, then confirm whether there are characters representing tablet devices in the user agent string. If so, confirm that the device type is a tablet device;

[0067] If the user agent string does not contain characters indicating a mobile device and does not contain characters indicating a tablet device, the device type is determined to be a desktop device.

[0068] S202: Acquire the display capability of the page display device according to the device type, and acquire the target display element of the business scenario to be displayed according to the display capability, wherein the display capability includes hardware capability and software capability.

[0069] The page shows that the device has basic information about the storage device in its storage module, including the device type. The device type includes information such as the hardware model of the device.

[0070] According to the hardware model and other information of the device type, the display capability of the page display device can be determined; for example, different hardware models correspond to different computing capabilities and different screen resolutions, where the hardware that affects the computing capability includes the central processing unit (CPU), the graphics processing unit (GPU), etc.

[0071] The hardware capabilities of the page display device can be confirmed based on the CPU model and GPU model. The target display elements of the business scenario to be displayed can be confirmed based on the hardware capabilities. When the architecture page is displayed, some software frameworks are also used. The software capabilities of the software framework will also affect the display effect. Therefore, the target display elements of the business scenario to be displayed can be confirmed based on the hardware capabilities and software capabilities.

[0072] The specific process of obtaining the target display element:

[0073] For example, according to the display capability, at least one element type is obtained from multiple element types as the target display element; wherein,

[0074] The element types include text titles, text bodies, pictures, borders, backgrounds and sizes; the hardware capabilities in the display capabilities include hardware computing power and display resolution; and the software capabilities in the display capabilities include software computing power.

[0075] There is a corresponding relationship between the display capability and the target display element that can achieve the display. According to the corresponding corresponding relationship, a suitable element type is obtained from multiple element types as the target display element; when the business scenario is news, only the text title can be displayed; other element types can also be displayed if the business scenario is a map, shopping cart, etc.; corresponding element type display correspondence can also be set according to other scenarios, such as performance-critical, security-sensitive, cross-end sharing, offline support, and real-time computing scenarios; the business scenario selected for display is the business scenario to be displayed.

[0076] S203: Establish a WebAssembly module of the business scenario to be displayed according to the target display element, so that the page display device loads the WebAssembly module and renders and displays the target display element corresponding to the business scenario to be displayed.

[0077] When establishing a WebAssembly module, you can first establish a rust module and then compile the rust module into a WebAssembly module; when establishing a rust module, you need to establish functions, variables and other codes, which will also include codes describing how to display target display elements; different target display elements correspond to different codes, and the code of the selected target display element can be set in the appropriate code position of the rust module; after building the WebAssembly module, you can load the WebAssembly module through the page display device, confirm the target display element to be displayed and render it.

[0078] In an embodiment of the present application, based on a page display request initiated by a user, the device type of the page display device to be displayed on the page is confirmed to confirm the display capability of the page display device based on the device type; the page display devices have different display capabilities, and different display designs can be performed for different business scenarios to display different target display elements to flexibly adapt the page display device; a WebAssembly module for the business scenario to be displayed is constructed based on the target display elements to be displayed, the WebAssembly module is loaded and the corresponding target display element rendering and display are completed, which is suitable for different performance requirements of different devices.

[0079] Figure 3 A schematic diagram of a page display method provided in an embodiment of the present application Figure 2 .like Figure 3 As shown, the method includes:

[0080] S301. When establishing a rust module, load the wasm_bindgen module, and mark the properties of the rendering function of the rust module through the wasm_bindgen module.

[0081] The rust module is a code module organized based on the rust language. In the process of creating the rust module for the business scenario to be demonstrated: load the wasm_bindgen module. wasm_bindgen is a tool for interaction between WebAssembly and JavaScript. It is also a key component between the rust module and the WebAssembl module. It allows developers to write code in the rust module and compile it into a WebAssembl module, and then call these WebAssembly modules in the browser through JavaScript;

[0082] Marking the render function of a rust module with the wasm_bindgen attribute allows the rust module to be compiled into a WebAssembly module.

[0083] S302. When establishing the html variable of the rendering function, define an html string, insert a div tag into the html string, parse and traverse the data of the business scenario to be displayed, construct the traversed data into html code, insert the html code into the html string, and insert an end tag into the html string.

[0084] In the process of building the rendering function of the rust module, you can establish the code process related to the html variable, including: defining the html string; inserting the div tag into the html string, that is, the start tag; parsing and traversing the data of the business scenario to be displayed, and building the traversed data into html code; and finally ending the tag in the html string.

[0085] S303: When establishing the CSS variable of the rendering function, construct the CSS style code corresponding to the target display element.

[0086] In the process of building the rendering function of the rust module, the process of establishing the code related to the CSS variables includes: the CSS style code corresponding to the selected target display element; for example, if the target display element is a text title, the code for setting the text title can include various descriptions related to the text such as text size, pixels, color, etc.; CSS variables allow developers to store and reuse values ​​in style sheets.

[0087] S304, calling the format macro command, outputting the html variable and the css variable, completing the construction of the rust module, and compiling the constructed rust module into the WebAssembly module.

[0088] The format macro command can be used in programming for repetitive task operations; the format macro command is called at the end of the rust module to output html variables and css variables to complete the construction of the rust module; the format macro command can be used to execute the code corresponding to the variable, and finally the built rust module is compiled into a WebAssembly module through the corresponding compilation tool.

[0089] In an embodiment of the present application, a rust module is constructed through a target display element. The css style code parts of the rust modules corresponding to different device types and business scenarios are different. Different rust modules are converted into WebAssembly modules for subsequent loading and use, and adaptive display is performed on different device ends.

[0090] Figure 4 A schematic diagram of a page display method provided in an embodiment of the present application Figure 3 .like Figure 4As shown, the method includes:

[0091] S401. When establishing a first asynchronous function, declare a module variable for storing the WebAssembly module to be loaded.

[0092] A first asynchronous function is declared, wherein the first asynchronous function includes the code of the declared module variable, which is used to save the WebAssembly module to be loaded, which can be all the established WebAssembly modules of different devices.

[0093] S402: From the WebAssembly module to be loaded, obtain the WebAssembly module to be loaded according to the device type to complete the target loading.

[0094] The first asynchronous function is included in the WebAssembly module to be loaded, and the code of the target loaded WebAssembly module is obtained according to the device type. The target loading can be performed by executing the first asynchronous function; the loading of the WebAssembly module can be performed in the page display device.

[0095] After loading the WebAssembly module, you can render and display it on the page display device:

[0096] For example, when establishing the second asynchronous function, a waiting function is established to wait for the first asynchronous function to complete target loading;

[0097] Call the WebAssembly module loaded by the target, and pass in the target display element of the business scenario to be displayed;

[0098] The target display element is rendered and displayed at the display point of the page display device.

[0099] Declare a second asynchronous function, which includes the code of the waiting function for waiting for the first asynchronous function to complete the target loading; and also includes the code for calling the WebAssembly module loaded by the target and passing in the target display element of the business scenario to be displayed. The method of calling the WebAssembly module loaded by the target is to call the render_news method on the WebAssembly module and pass in the relevant data of the target display element;

[0100] Find the display point of the page on the page display device. For example, when displaying news, find the element with the ID news-container and set its innerHTML to the string of generated HTML. In this way, the news data will be rendered to the element to be displayed to the user.

[0101] In the embodiment of the present application, by loading the WebAssembly module on the page display device and rendering and displaying the corresponding content, the burden on the back-end server is reduced and the response speed and performance of the front-end are improved.

[0102] Design some security-related modules, such as encryption and decryption, and key management, into WebAssembly modules, and use their sandbox isolation capabilities to improve security. Combined with the WASI specification, further strengthen the security access control between the WebAssembly module and the underlying system.

[0103] For some highly versatile modules, such as data format conversion and tool functions, they are designed in WebAssembly format to achieve the effect of writing once and running in multiple places. Based on modular design, front-end applications can dynamically load the required WebAssembly modules according to demand, improving the flexibility and scalability of the application.

[0104] The solution of this application has advantages in performance, security, and cross-platform. Through modular design, front-end applications can dynamically load the required WebAssembly modules according to different terminal devices, business scenarios, and functional requirements to achieve a highly customized user experience. It is not only suitable for multi-terminal adaptation, but can also be applied to a series of front-end development scenarios such as performance optimization, security assurance, and cross-terminal sharing.

[0105] Figure 5 A page display device diagram provided by an embodiment of the present invention, such as Figure 5 As shown, the device includes: an acquisition module 501, a processing module 502, and a display module 503;

[0106] The acquisition module 501 is used to acquire the device type of the page display device based on the page display request initiated by the user, wherein the page display request includes the business scenario to be displayed.

[0107] The acquisition module 501 is further used to confirm whether there is a character representing the device type in the user agent character string in the page display request through a regular expression;

[0108] If there are characters representing the device type, the device type of the page display device is confirmed according to the characters, wherein different characters are used to represent the mobile device type and the desktop device type respectively.

[0109] The processing module 502 is used to obtain the display capability of the page display device according to the device type, and obtain the target display element of the business scenario to be displayed according to the display capability, wherein the display capability includes hardware capability and software capability.

[0110] The processing module 502 is further configured to obtain at least one element type from a plurality of element types as the target display element according to the display capability; wherein:

[0111] The element types include text titles, text bodies, pictures, borders, backgrounds and sizes; the hardware capabilities in the display capabilities include hardware computing power and display resolution; and the software capabilities in the display capabilities include software computing power.

[0112] The display module 503 is used to establish a WebAssembly module of the business scenario to be displayed according to the target display element, so that the page display device loads the WebAssembly module and renders and displays the target display element corresponding to the business scenario to be displayed.

[0113] The display module 503 is also used to load the wasm_bindgen module when establishing the rust module, and mark the attributes of the rendering function of the rust module through the wasm_bindgen module;

[0114] When establishing the html variable of the rendering function, define an html string, insert a div tag into the html string, parse and traverse the data of the business scenario to be displayed, construct the traversed data into html code, insert the html code into the html string, and insert an end tag into the html string;

[0115] When establishing the CSS variable of the rendering function, construct the CSS style code corresponding to the target display element;

[0116] Call the format macro command to output the html variable and the css variable, complete the construction of the rust module, and compile the constructed rust module into the WebAssembly module.

[0117] The present application also provides a page display device, including: at least one processor and a memory;

[0118] The memory stores computer-executable instructions;

[0119] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs a page display method.

[0120] Figure 6 Schematic diagram of the hardware of the electronic device provided by the embodiment of the present invention. Figure 6As shown, the electronic device 60 provided in this embodiment includes: at least one processor 601 and a memory 602. The device 60 also includes a communication component 603. The processor 601, the memory 602 and the communication component 603 are connected via a bus 604.

[0121] In the specific implementation process, at least one processor 601 executes the computer execution instructions stored in the memory 602, so that at least one processor 601 executes the above page display method.

[0122] The specific implementation process of the processor 601 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.

[0123] In the above Figure 6 In the illustrated embodiment, it should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.

[0124] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (Non-volatile Memory, NVM), such as at least one disk memory.

[0125] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.

[0126] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the method described above is implemented.

[0127] The computer-readable storage medium mentioned above can be implemented by any type of volatile or non-volatile storage device or a combination thereof, 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 memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special purpose computer.

[0128] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (Application Specific Integrated Circuits, referred to as: ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.

[0129] The division of the units is only a logical function division, and there may be other divisions in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, which may be electrical, mechanical or other forms.

[0130] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0131] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.

[0132] Finally, it should be noted that those skilled in the art will readily conceive of other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variation, use or adaptation of the present invention, which follows the general principles of the present invention and includes common knowledge or conventional techniques in the art not disclosed by the present invention, is not limited to the precise structure described above and shown in the drawings, and may be modified and changed in various ways without departing from the scope thereof.

Claims

1. A page display method, characterized in that: include: Based on a page display request initiated by a user, obtaining a device type of a page display device, wherein the page display request includes a business scenario to be displayed; Acquire the display capability of the page display device according to the device type, and acquire the target display element of the business scenario to be displayed according to the display capability, wherein the display capability includes hardware capability and software capability; A WebAssembly module of the business scenario to be displayed is established according to the target display element, so that the page display device loads the WebAssembly module and renders and displays the target display element corresponding to the business scenario to be displayed.

2. The method according to claim 1, characterized in that The acquiring the target display element of the to-be-displayed business scenario according to the display capability includes: According to the display capability, at least one element type is obtained from multiple element types as the target display element; wherein, The element types include text titles, text bodies, pictures, borders, backgrounds and sizes; the hardware capabilities in the display capabilities include hardware computing power and display resolution; and the software capabilities in the display capabilities include software computing power.

3. The method according to claim 1, characterized in that: The step of establishing the WebAssembly module of the business scenario to be displayed according to the target display element includes: When establishing a rust module, load the wasm_bindgen module, and use the wasm_bindgen module to mark the properties of the rendering function of the rust module; When establishing the html variable of the rendering function, define an html string, insert a div tag into the html string, parse and traverse the data of the business scenario to be displayed, construct the traversed data into html code, insert the html code into the html string, and insert an end tag into the html string; When establishing the CSS variable of the rendering function, construct the CSS style code corresponding to the target display element; Call the format macro command to output the html variable and the css variable, complete the construction of the rust module, and compile the constructed rust module into the WebAssembly module.

4. The method according to claim 1, characterized in that The method of causing the page display device to load the WebAssembly module includes: When establishing the first asynchronous function, declare a module variable for storing the WebAssembly module to be loaded; In the WebAssembly module to be loaded, the WebAssembly module to be loaded is obtained according to the device type to complete the target loading.

5. The method according to claim 4, characterized in that The rendering and displaying of the target display element corresponding to the business scenario to be displayed includes: When establishing the second asynchronous function, establishing a waiting function to wait for the first asynchronous function to complete the target loading; Call the WebAssembly module loaded by the target, and pass in the target display element of the business scenario to be displayed; The target display element is rendered and displayed at the display point of the page display device.

6. The method according to claim 1, characterized in that The acquiring the device type of the page display device based on the page display request initiated by the user includes: Using a regular expression, confirm whether a character representing the device type exists in the user agent string in the page display request; If there are characters representing the device type, the device type of the page display device is confirmed according to the characters, wherein different characters are used to represent the mobile device type and the desktop device type respectively.

7. A page display device, characterized in that: include: An acquisition module, used to acquire a device type of a page display device based on a page display request initiated by a user, wherein the page display request includes a business scenario to be displayed; A processing module, configured to obtain the display capability of the page display device according to the device type, and obtain the target display element of the business scenario to be displayed according to the display capability, wherein the display capability includes hardware capability and software capability; A display module is used to establish a WebAssembly module of the business scenario to be displayed according to the target display element, so that the page display device loads the WebAssembly module and renders and displays the target display element corresponding to the business scenario to be displayed.

8. An electronic device, characterized in that: include: at least one processor and memory; The memory stores computer-executable instructions; The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the page display method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the page display method as described in any one of claims 1 to 6 are implemented.

10. A computer program product, characterized in that The computer program product includes instructions, which, when executed on an electronic device, enable the electronic device to implement the page display method according to any one of claims 1 to 6.