Multi-terminal adaptation method and device, medium and product

Through automated data processing and configuration parameter calculation, the complexity of adaptive display of charts on multiple terminal devices is solved, and automatic adaptation and dynamic update of charts on different devices is realized, which improves development efficiency and user experience.

CN119065664APending Publication Date: 2024-12-03SHANGHAI GANGLIAN E COMMERCE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411130823.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-16
Publication Date
2024-12-03

AI Technical Summary

Technical Problem

When implementing adaptive display of charts on multi-terminal devices, the layout and style need to be manually adjusted, which increases the workload and complexity of developers. The graph configuration parameters are limited by data structure characteristics, resulting in development difficulty and uncertainty. Increased sex.

Method used

By automating the data processing and configuration parameter calculation process, identify the target device type and screen size, obtain chart data, automatically select chart types and configuration parameters according to user needs and data characteristics, and use the ECharts library to generate charts to ensure good on different devices. User experience and visual effects.

Benefits of technology

It greatly reduces the need to manually write configuration parameters, improves development efficiency and flexibility, reduces maintenance costs, and realizes automatic adaptation and dynamic update of charts on multi-end devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119065664A_ABST
    Figure CN119065664A_ABST
Patent Text Reader

Abstract

The embodiment of the invention relates to the technical field of data visualization, and discloses a multi-terminal adaptation method and device, a medium and a product. Identifying the type and the screen size of the target equipment; docking with a data provider system through an AP I interface to obtain chart data; the chart data is cleaned, and the cleaned chart data is converted into an ECharts chart format; judging whether various chart types are displayed or not according to user requirements and the chart data; when a plurality of chart types are displayed, calculating chart type parameters according to the chart data, calculating chart configuration parameters according to the chart type parameters, and generating a chart according to the chart configuration parameters; when the single chart type is displayed, chart configuration parameters are calculated according to the chart data, and a chart is generated according to the chart configuration parameters. The technical problem that adaptation of multiple types of chart terminals is complex can be at least solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data visualization technology, and in particular to a multi-terminal adaptation method, device, medium and product. Background Art

[0002] With the widespread application of data visualization in all walks of life, chart components have become one of the important tools for data display. However, with the popularity and diversification of mobile devices, developers are facing a new challenge: how to achieve adaptive display of charts on different terminal devices? Although existing chart libraries such as ECharts can be displayed on different devices, they still require manual adjustments in layout and style, which increases the workload of developers and reduces development efficiency.

[0003] In the prior art, when creating a chart, developers must first understand the chart data structure of the data and write the corresponding configuration parameters accordingly. This process involves communication with the data provider to obtain detailed information about the data structure. Subsequently, the developer needs to manually write the configuration parameters of the chart, including but not limited to the chart type, axis settings, and data series. This approach has the following limitations: developers must frequently communicate with data providers to ensure an accurate understanding of the data structure, which increases the communication cost of the project; developers need to spend a lot of time manually writing chart configuration parameters, which increases development costs and workload; chart configuration parameters are limited by the characteristics of the data structure. Once the data structure changes, the chart configuration must be readjusted, which increases the complexity and uncertainty of development.

[0004] Although existing technical solutions can achieve basic chart display, they have significant deficiencies in dealing with data changes and multi-terminal adaptation. Developers need to frequently adjust and optimize the display effect of charts, especially when the data structure changes frequently or multiple chart types need to be displayed. This manual adjustment not only increases the difficulty of development, but may also lead to inconsistent chart display and affect user experience. Summary of the invention

[0005] One purpose of the present application is to provide a multi-terminal adaptation method, device, medium and product, at least to solve the complex technical problem of adapting multiple types of chart terminals.

[0006] To achieve the above objectives, some embodiments of the present application provide the following aspects:

[0007] In the first aspect, some embodiments of the present application also provide a multi-terminal adaptation method, which identifies the type and screen size of the target device; obtains chart data; wherein the chart data is obtained according to a data provider system; determines whether to display multiple chart types based on user needs and the chart data; when displaying multiple chart types, calculates chart type parameters based on the chart data, calculates chart configuration parameters based on the chart type parameters, and generates a chart based on the chart configuration parameters; when displaying a single chart type, calculates chart configuration parameters based on the chart data, and generates a chart based on the chart configuration parameters.

[0008] In a second aspect, some embodiments of the present application further provide an electronic device, comprising: one or more processors; and a memory storing computer program instructions, wherein the computer program instructions, when executed, cause the processor to perform the steps of the method described above.

[0009] In a third aspect, some embodiments of the present application further provide a computer-readable medium having computer program instructions stored thereon, wherein the computer program instructions can be executed by a processor to implement the method as described above.

[0010] In a fourth aspect, some embodiments of the present application further provide a computer program product, comprising a computer program / instruction, which implements the steps of the method described above when executed by a processor.

[0011] Compared with the related art, the solution provided in the embodiment of the present application greatly reduces the need for manual writing of configuration parameters through automated data processing and configuration parameter calculation process. This automation not only covers the standardization of data structure, but also includes automatic selection of chart types and corresponding configurations based on business needs. Such an automated process reduces the repetitive work caused by frequent data changes, making development more flexible and more capable of responding to changes. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0013] Figure 1 A flowchart of a multi-terminal adaptation method provided according to an embodiment of the present application;

[0014] Figure 2 A schematic diagram of a flow chart of a Y-axis scale numerical precision algorithm provided according to an embodiment of the present application;

[0015] Figure 3A schematic diagram of a flow chart of an algorithm for displaying extreme values ​​on a Y-axis scale according to an embodiment of the present application;

[0016] Figure 4 The present invention is a structural diagram of an electronic device provided according to an embodiment of the present application. DETAILED DESCRIPTION

[0017] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are 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 creative work are within the scope of protection of this application.

[0018] First embodiment

[0019] The first embodiment of the present application relates to a multi-terminal adaptation method. Figure 1 As shown, the method may include the following steps:

[0020] Identify the type and screen size of the target device. Automatically identify the type of connected device (such as mobile phone, tablet, desktop) and screen size by reading the User-Agent string in the HTTP request header or using the window.screen object of JavaScript; select the most suitable chart rendering mode based on the device type and screen resolution.

[0021] Connect with the data provider system through the API interface to obtain chart data. Automatically obtain data from the data provider. If data acquisition fails, try to obtain it again.

[0022] Clean the chart data and convert the cleaned chart data into the ECharts chart format. Normalize and standardize the data, clean the received data, remove unnecessary data or data in incorrect format; convert the data into a format supported by ECharts charts to ensure data consistency and accuracy.

[0023] Determine whether to display multiple chart types based on user needs and the chart data. Automatically analyze and determine whether to display multiple chart types (such as bar charts, line charts, pie charts, etc.) based on user needs and data characteristics; select appropriate chart types for different data sets or views.

[0024] When displaying multiple chart types, calculate chart type parameters according to the chart data, calculate chart configuration parameters according to the chart type parameters, and generate charts according to the chart configuration parameters. If multiple chart types need to be displayed, automatically calculate the parameters of each chart type, and automatically calculate the specific parameters of the chart, such as chart size, margins, font size, etc., according to the chart type and the screen size of the target device. This step ensures that the chart has a good user experience and visual effect on different devices;

[0025] When displaying a single chart type, the chart configuration parameters are calculated based on the chart data, and the chart is generated based on the chart configuration parameters. The chart configuration parameters are automatically calculated through a series of algorithms. Using preset algorithm models, such as linear programming, genetic algorithms, etc., the chart configuration is automatically optimized according to the screen size and data volume. These algorithms help dynamically adjust the various configuration parameters of the chart to meet different display requirements.

[0026] Finally, the ECharts library is used to generate the final chart, reflecting the calculated configuration parameters and standardized data on the user interface. It supports dynamic generation and real-time updating of charts to display the latest data view

[0027] It is not difficult to find that compared with the related technology, the embodiment of the present application provides an automated and adaptive technical solution for chart visualization, which automatically processes and standardizes data structures, automatically calculates chart configuration parameters, and determines chart types based on business needs, thereby achieving the purpose of automatically adapting and generating correct charts on multiple devices.

[0028] Automatically receive and process data from data providers, standardize data structures through built-in algorithms, ensure data consistency and applicability, and provide a basis for subsequent configuration parameter calculations and chart generation; business requirement input for chart types, unlike traditional methods, integrates business requirement input points in the automated process, and manually specifies chart types based on specific business scenarios, ensuring the business relevance and practicality of generated charts; automatically calculate chart configuration parameters, based on standardized data and business input chart types, automatically calculate chart configuration parameters such as axis settings, data series styles, etc., without manual intervention, reducing configuration errors and development time; automatic implementation of multi-terminal adaptation, taking into account different devices and screen sizes, automatically adapts the generated chart configuration to ensure the best visual effects and performance on any device; automatically generates charts without subsequent adjustments, and can correctly generate charts on the first try without subsequent adjustments or verification steps, improving efficiency and reducing maintenance costs.

[0029] Second embodiment

[0030] The second embodiment of the present application relates to a multi-terminal adaptation method. The second implementation is an improvement based on the first embodiment, and the specific improvements are:

[0031] Confirm the type and screen size of the current device, and use JavaScript's window.navigator.userAgent and window.screen objects to detect the device type and screen size. By reading the User-Agent string in the HTTP request, automatically identify the type of target device (such as mobile phone, tablet, desktop) and screen size. Based on this information, dynamically determine the display size of the chart to ensure the best display of the chart on different devices.

[0032] Extract necessary chart information from the data source, obtain data from the server through the set API interface, including the chart title, legend, chart type, X-axis and Y-axis data, and the link to the watermark image, parse the data and prepare it for subsequent processing.

[0033] The X-axis data of various charts are processed and normalized uniformly, and the X-axis data of all charts are standardized to ensure that each chart can share a set of X-axis labels, and the missing data is intelligently filled in. The data is converted into a format supported by ECharts charts to ensure the consistency and accuracy of the data.

[0034] According to the settings of the X-axis, the corresponding Y-axis data without data will be set to blank. For X-axis labels with missing data, the corresponding Y-axis data will be set to blank to maintain data consistency and neatness of the chart.

[0035] Calculate the maximum text length of the normalized X-axis data and the longest label text on the processed X-axis. Use this information to help determine the horizontal layout of the chart.

[0036] Format the legend text, calculate its length, format the legend text, truncate and add ellipsis to overlong text, and adjust the legend's margins and display style according to the screen size.

[0037] Traverse all chart data, find the maximum data value on the left and right Y axes, identify all data extremes on the Y axis, and optimize the margins of the chart based on these values ​​to show a clear Y axis scale.

[0038] Analyze the maximum and minimum values ​​of the X-axis and Y-axis data of each chart, and decide how to display the Y-axis scale based on the range of the data, such as positive values, negative values, or both, to match the actual distribution of the data.

[0039] Enter the Y-axis position for different charts, calculate and align the Y-axis scale, automatically calculate the appropriate Y-axis scale, and visually align the left and right Y axes to ensure the symmetry and balance of the chart.

[0040] Download and resize the watermark image according to the provided watermark image URL. Download the watermark image from the specified URL and resize it to fit the size and layout of the chart.

[0041] The left and right margins of the entire chart are calculated based on the maximum scale of the left and right Y axes, and the left and right margins of the chart are set according to the maximum scale value of the Y axis to ensure that the display of data is not affected by edge compression.

[0042] Adjust the interval for dense X-axis scales, and automatically adjust the interval between X-axis scales according to the width of the chart container to ensure the readability of the scales and the beauty of the chart.

[0043] Automatically adjust the rotation angle of the X-axis scale, taking into account the chart width and data density, and adjust the rotation angle of the X-axis label to optimize visual effects and space usage.

[0044] The chart height is calculated based on the container width and the total length of the legend, and the chart height is automatically adjusted to ensure that there is enough display space between the legend and the chart content.

[0045] Set other basic information of the chart, including chart title, toolbar options, loading animation, etc., to enhance the user interaction experience.

[0046] Handle the situation where the data source has no data. If data acquisition fails or the data is empty, the chart displays the "No data" status to clearly inform the user of the data loading problem.

[0047] Through the above specific steps, this application is based on automated data processing and responsive configuration algorithms, aiming to provide a chart visualization technology solution that can adapt to different data structures and business needs. Through this method, developers can achieve accurate and consistent chart display on multiple devices more quickly and efficiently, meeting the needs of fast construction and low maintenance costs.

[0048] Third embodiment

[0049] The third embodiment of the present application relates to a multi-terminal adaptation method. The third implementation mode is an improvement based on the first embodiment, and the specific improvements are:

[0050] like Figure 2 As shown, in order to achieve the best display effect of the Y-axis scale value, a precision algorithm is provided to implement the process. This algorithm is used to adjust the precision of the given value to ensure that the output value is only retained to one decimal place. The algorithm includes:

[0051] Input a value x and determine whether x is 0; when x is equal to 0, output 0 and end the process.

[0052] When x is not equal to 0, calculate power = ceil(-log10(abs(x))), scale and round, scaled = float(abs(x)*10^(power-1)); calculate the new value x_new = (sgn(x)*(scaled+1) / 10^(power-1)); adjust the Y-axis scale value according to x_new.

[0053] like Figure 3 As shown, in order to further improve the readability and aesthetics of the data chart, an algorithm is provided below that can calculate the best maximum or minimum absolute value suitable for Y-axis display. By adjusting the value to the nearest multiple of 3 and appropriately reducing the precision, the algorithm ensures that the Y-axis scale is both neat and easy to interpret, thereby optimizing the overall display effect of the chart. The algorithm includes:

[0054] Input parameters: minimum value min, maximum value max, whether to find the maximum value isMax;

[0055] Calculate the absolute value: absM in = |min|, absMax = |max|;

[0056] Select absolute value: value = isMax? max(absMin, absMax): min(absMin, absMax);

[0057] When value<1 and value!=0, reduce the precision, value=decreasePrecision(value); output the final value and return value;

[0058] When value<1 is not satisfied and value!=0, when value>=1, calculate the base magnitude=10^floor(log10(value)), adjust to the nearest multiple of 3, value=ceil(value / magnitude / 3)*magnitude*3, output the final value and return value; when value!>=1, output the final value and return value.

[0059] According to the output value, adjust the optimal maximum or minimum absolute value suitable for Y-axis display to ensure the neatness and display effect of the Y-axis scale.

[0060] It should be noted that the third embodiment of the present application may also be an improvement based on the second embodiment.

[0061] This embodiment uses a precision adjustment algorithm to ensure that the Y-axis scale value is only retained to one decimal place, making the data display more accurate and easy to understand; by adjusting the value to the nearest multiple of 3 and appropriately reducing the precision, the neatness and readability of the Y-axis scale are ensured, improving the overall aesthetics and user experience of the chart; it is suitable for different types of charts and different data ranges, and can dynamically adjust the Y-axis scale, so that the display effect of the chart on various terminal devices is optimal. Through the above improvements, this embodiment effectively improves the precision control and display optimization capabilities of the multi-terminal adaptation method, ensuring the best data display effect on different terminal devices.

[0062] The step division of the above methods is only for the purpose of clear description. When implemented, they can be combined into one step or some steps can be split and decomposed into multiple steps. As long as they include the same logical relationship, they are all within the scope of protection of this patent; adding insignificant modifications to the algorithm or process or introducing insignificant designs without changing the core design of the algorithm and process are all within the scope of protection of this patent.

[0063] In addition, some embodiments of the present application also provide an electronic device. The electronic device may be a digital computer in various forms, such as a laptop computer, a desktop computer, a workbench, a personal digital assistant, a server, a blade server, a mainframe computer, etc. The electronic device may also be a mobile device in various forms, such as a personal digital processing, a cellular phone, a smart phone, a wearable device, and other similar computing devices.

[0064] The electronic device includes: one or more processors; and a memory storing computer program instructions, wherein when the computer program instructions are executed, the processor executes the steps of the method provided in any one or more of the above embodiments. Figure 4 An exemplary structural diagram of the electronic device is disclosed. Figure 4As shown, the electronic device includes: one or more processors 1101, memory 1102, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses, and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the electronic device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some other embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple electronic devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Among them, the components shown in this article, their connections and relationships, and their functions are only used as examples, and are not intended to limit the implementation of the present application described and / or required herein.

[0065] The electronic device may further include: an input device 1103 and an output device 1104. The processor 1101, the memory 1102, the input device 1103 and the output device 1104 may be connected via a bus or other means. Figure 4 The example of connecting through bus is taken in the following.

[0066] The input device 1103 can receive input digital or character information, and generate key signal input related to the user settings and function control of the electronic device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick and other input devices. The output device 1104 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The display device may include, but is not limited to, a liquid crystal display (LCD), a light emitting diode (LED) display and a plasma display. In some embodiments, the display device may be a touch screen.

[0067] To provide interaction with a user, the electronic device may be a computer. The computer has: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball), through which the user can provide input to the computer. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0068] In the embodiments of the present application, a computer program / instruction is stored on a computer-readable medium, and when the computer program / instruction is executed by a processor, the steps of the method provided by any one or more of the above embodiments are implemented. The computer-readable medium may be included in the electronic device described in the above embodiments; or it may exist independently without being assembled into the device. The above computer-readable medium carries one or more computer-readable instructions.

[0069] The memory 1102 can be used as a non-transient computer-readable storage medium, which can be used to store non-transient software programs, non-transient computer executable programs and modules. The processor 1101 executes various functional applications and data processing of the server by running the non-transient software programs, instructions and modules stored in the memory 1102, so as to implement the program instructions / modules corresponding to the method provided by any one or more embodiments in the embodiments of the present application.

[0070] The memory 1102 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 1102 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory 1102 may optionally include a memory remotely arranged relative to the processor 1101, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0071] It should be noted that the computer-readable medium described in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device.

[0072] Computer readable media include permanent and non-permanent, removable and non-removable media, and can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, modules of programs 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, read-only compact disk (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission medium that can be used to store information that can be accessed by a computing device.

[0073] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet).

[0074] In the above-described embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. For example, it can be implemented by using an application specific integrated circuit (ASIC), a general-purpose computer or any other similar hardware device. In certain embodiments, the software program of the present application can be executed by a processor to implement the above steps or functions. Similarly, the software program of the present application (including relevant data structures) can be stored in a computer-readable recording medium, for example, a RAM memory, a magnetic or optical drive or a floppy disk and similar devices. In addition, some steps or functions of the present application can be implemented by hardware, for example, as a circuit that cooperates with a processor to perform each step or function.

[0075] The computer program product provided in the embodiment of the present application includes one or more computer programs / instructions, and when the computer program / instructions are executed by the processor, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive so lid state di sk (SSD)), etc.

[0076] The flow chart or block diagram in the accompanying drawings shows the possible architecture, function and operation of the equipment, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated system for hardware that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0077] The scope of the present application is defined by the appended claims rather than the above description, and it is intended that all changes that fall within the meaning and scope of the equivalent elements of the claims are included in the present application. Any figure mark in the claims should not be regarded as limiting the claims involved. In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the device claim may also be implemented by one unit or device through software or hardware. The words "first", "second", etc. are only used to distinguish the description, and do not indicate any particular order, nor can they be understood as indicating or implying relative importance.

[0078] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily mention changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims, and the above embodiments should be regarded as exemplary and non-restrictive.

Claims

1. A multi-terminal adaptation method, characterized in that: The method comprises: Identify the target device type and screen size; Obtaining chart data; wherein the chart data is obtained according to a data provider system; Determining whether to display multiple chart types based on user needs and the chart data; When displaying multiple chart types, calculating chart type parameters according to the chart data, calculating chart configuration parameters according to the chart type parameters, and generating a chart according to the chart configuration parameters; When a single chart type is displayed, chart configuration parameters are calculated based on the chart data, and a chart is generated based on the chart configuration parameters.

2. The method according to claim 1, characterized in that The identification of the target device type and screen size includes: Automatically identify the type and screen size of the target device by reading the User-Agent string in the HTTP request or using the JavaScript window.screen object; Based on the identified target device type and screen size, a chart rendering mode is selected.

3. The method according to claim 2, characterized in that The method further comprises: The chart data is cleaned, and the cleaned chart data is converted into an ECharts chart format.

4. The method according to claim 3, characterized in that The chart data includes title, legend, type, X-axis data and Y-axis data; Cleaning the chart data includes standardizing the X-axis data in the chart data and filling in the missing data; and according to the X-axis data, setting the Y-axis data corresponding to the missing X-axis label to blank.

5. The method according to claim 4, characterized in that The calculation graph configuration parameters include: Adjust the horizontal layout of the chart according to the maximum text length of the X-axis data after normalization; Formatting the text of the legend, and adjusting the margin and display style of the legend according to the text length of the legend and the screen size; Adjusting the margin of the chart according to the extreme value of the Y-axis data; The display mode of the Y-axis scale is determined according to the range of the X-axis data and the Y-axis data.

6. The method according to claim 4 or 5, characterized in that: The calculation graph configuration parameters include: According to the chart type parameters, adjust the Y-axis scale of the chart to visually align the left and right Y-axes; The chart data also includes a watermark image, and the watermark image is adjusted to fit the size and layout of the chart; According to the maximum scale value of the Y-axis data, set the left and right margins of the chart; Adjust the interval between X-axis ticks according to the container width of the chart; Adjust the rotation angle of the X-axis labels according to the width and data density of the chart; Adjust the height of the chart according to the chart container width and the length of the legend.

7. The method according to claim 6, characterized in that The calculating graph configuration parameters includes: calculating the graph configuration parameters by linear programming or genetic algorithm.

8. An electronic device, characterized in that: The electronic device comprises: one or more processors; and A memory storing computer program instructions, which, when executed, cause the processor to perform the steps of the method as claimed in any one of claims 1 to 7.

9. A computer readable medium having a computer program / instructions stored thereon, characterized in that: When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.