A chart drawing method, device and computer readable storage medium

CN113516729BActive Publication Date: 2026-09-11TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011318303.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-20
Publication Date
2026-09-11
Estimated Expiration
2040-11-20

AI Technical Summary

Technical Problem

对于这两类绘制图表的方法都存在一定的问题,前者由于每种后台语言都需要单独接入对应的图形库,因此成本较高,通用性较差,后者由于需要依赖浏览器界面的渲染,需要浏览器界面的支持才能打开绘制的图表,因此对浏览器界面依赖较强、支持的场景单一

Benefits of technology

[0027] In this embodiment, the server obtains a chart drawing request submitted by the business platform, parses the data to be processed carried in the chart drawing request to obtain a parsing result, and determines a target drawing component from a variety of front-end drawing components encapsulated based on a headless browser framework according to the parsing result. The server then generates chart data corresponding to the data to be processed using the target drawing component and the parsing result, and sends the chart data to the business platform so that the business platform can display the chart data in a non-webpage manner through a terminal device. Through the method of this embodiment, on the one hand, determining the target drawing component from a variety of front-end drawing components encapsulated based on a headless browser framework can improve the versatility and scenario applicability of chart drawing; on the other hand, displaying chart data in a non-webpage manner can eliminate strong dependence on the browser interface.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113516729B_ABST
    Figure CN113516729B_ABST
Patent Text Reader

Abstract

The application discloses a chart drawing method and device and a computer readable storage medium. The method comprises the following steps: obtaining a chart drawing request submitted by a business platform, obtaining an analysis result by analyzing to-be-processed data carried in the chart drawing request, and determining a target drawing component from a plurality of front-end drawing components encapsulated based on a non-interface browser framework according to the analysis result; generating chart data corresponding to the to-be-processed data by using the target drawing component and the analysis result, and sending the chart data to the business platform, so that the business platform displays the chart data in a non-webpage mode through a terminal device. By using the method, the generality and scene applicability of chart drawing can be improved, and the strong dependence on a browser interface can be eliminated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a chart drawing method, apparatus and computer-readable storage medium. Background Technology

[0002] In today's big data era, charts are an indispensable statistical tool across various industries. Charts can intuitively display statistical information attributes (time-based, quantitative, etc.), serving as an excellent means of visually and intuitively "visualizing" object attribute data. Well-designed charts can more intuitively reflect the relationships between data points, providing clarity and ease of understanding compared to descriptions using data and text. Converting data from worksheets into charts helps us better understand the proportional relationships and trends between data points, enabling us to make reasonable inferences and predictions about the research object. Therefore, chart creation has become a hot research topic.

[0003] Currently, chart drawing methods can be divided into two main categories. One category utilizes different backend languages ​​(such as Java, Go, and Python) combined with different plotting libraries (such as Java graphics libraries, Go graphics libraries, and Python graphics libraries). The other category uses frontend drawing components for drawing and displays the charts on a frontend page. Both of these methods have certain problems. The former is costly and lacks versatility because each backend language requires a separate connection to the corresponding graphics library. The latter relies on browser rendering, requiring browser support to open the drawn charts, thus exhibiting strong dependence on the browser interface and limiting the supported scenarios. Summary of the Invention

[0004] This application provides a chart drawing method, apparatus, and computer-readable storage medium, which can improve the versatility and applicability of chart drawing, and can reduce the strong dependence on browser interface.

[0005] One embodiment of this application discloses a chart drawing method, the method comprising:

[0006] Obtain a chart drawing request submitted by the business platform, wherein the chart drawing request carries data to be processed;

[0007] The parsing result is obtained by parsing the data to be processed, and the target drawing component is determined from a variety of front-end drawing components encapsulated based on the parsing result.

[0008] The target drawing component and the parsing result are used to generate chart data corresponding to the data to be processed, and the chart data is sent to the business platform so that the business platform can display the chart data in a non-webpage manner through the terminal device.

[0009] One embodiment of this application discloses a chart drawing method, the method comprising:

[0010] A chart drawing request is submitted to the server. The chart drawing request carries data to be processed. The chart drawing request is used to instruct the server to determine the target drawing component from a variety of front-end drawing components encapsulated based on a headless browser framework according to the parsing result of the data to be processed, and to generate chart data corresponding to the data to be processed using the target drawing component and the parsing result.

[0011] Receive the chart data sent by the server;

[0012] The chart data is sent to a terminal device so that the terminal device displays the chart data in a non-webpage manner, which includes one or more of email pages, notification messages, and report documents.

[0013] One embodiment of this application discloses a chart drawing device, which includes:

[0014] The acquisition unit is used to acquire a chart drawing request submitted by the business platform, wherein the chart drawing request carries data to be processed;

[0015] The processing unit is used to obtain the parsing result by parsing the data to be processed;

[0016] The determining unit is used to determine the target drawing component from a variety of front-end drawing components encapsulated based on a headless browser framework according to the parsing result;

[0017] The processing unit is also used to generate chart data corresponding to the data to be processed using the target drawing component and the parsing result;

[0018] The sending unit is used to send the chart data to the business platform so that the business platform can display the chart data in a non-webpage manner through a terminal device.

[0019] One embodiment of this application discloses a chart drawing device, which includes:

[0020] A sending unit is used to submit a chart drawing request to the server. The chart drawing request carries data to be processed. The chart drawing request is used to instruct the server to determine a target drawing component from a variety of front-end drawing components encapsulated based on a headless browser framework according to the parsing result of the data to be processed, and to generate chart data corresponding to the data to be processed using the target drawing component and the parsing result.

[0021] A receiving unit is configured to receive the chart data sent by the server;

[0022] The sending unit is further configured to send the chart data to the terminal device so that the terminal device displays the chart data in a non-webpage manner, wherein the non-webpage manner includes one or more of email pages, notification messages, and report documents.

[0023] One embodiment of this application discloses a server, which includes a memory and a processor: the memory is used to store computer programs; the processor runs the computer programs to implement the above-described chart drawing method.

[0024] One embodiment of this application discloses a business platform, which includes a memory and a processor: the memory is used to store computer programs; the processor runs the computer programs to implement the above-described chart drawing method.

[0025] One embodiment of this application discloses a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the above-described chart drawing method.

[0026] One embodiment of this application discloses a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the aforementioned chart drawing method.

[0027] In this embodiment, the server obtains a chart drawing request submitted by the business platform, parses the data to be processed carried in the chart drawing request to obtain a parsing result, and determines a target drawing component from a variety of front-end drawing components encapsulated based on a headless browser framework according to the parsing result. The server then generates chart data corresponding to the data to be processed using the target drawing component and the parsing result, and sends the chart data to the business platform so that the business platform can display the chart data in a non-webpage manner through a terminal device. Through the method of this embodiment, on the one hand, determining the target drawing component from a variety of front-end drawing components encapsulated based on a headless browser framework can improve the versatility and scenario applicability of chart drawing; on the other hand, displaying chart data in a non-webpage manner can eliminate strong dependence on the browser interface. Attached Figure Description

[0028] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0029] Figure 1 This is a schematic diagram of the architecture of a chart drawing system disclosed in an embodiment of this application;

[0030] Figure 2a This is a schematic diagram of a chart drawing system disclosed in an embodiment of this application;

[0031] Figure 2b This is a schematic diagram illustrating a scenario as disclosed in an embodiment of this application;

[0032] Figure 2c This is another schematic diagram illustrating a scenario disclosed in the embodiments of this application;

[0033] Figure 3 This is a flowchart illustrating a chart drawing method disclosed in an embodiment of this application;

[0034] Figure 4a This is a functional schematic diagram of a chart component encapsulation disclosed in an embodiment of this application;

[0035] Figure 4b This is a schematic diagram of a layered architecture for encapsulating a chart component, as disclosed in an embodiment of this application.

[0036] Figure 5 This is a flowchart illustrating another chart drawing method disclosed in an embodiment of this application;

[0037] Figure 6 This is a flowchart illustrating another chart drawing method disclosed in the embodiments of this application;

[0038] Figure 7 This is a schematic diagram of the architecture of a layered chart drawing system disclosed in an embodiment of this application;

[0039] Figure 8a This is a functional diagram of the service layer of a chart drawing system disclosed in an embodiment of this application;

[0040] Figure 8b This is a schematic diagram of a chart data processing method disclosed in an embodiment of this application;

[0041] Figure 9 This is a flowchart illustrating another chart drawing method disclosed in the embodiments of this application;

[0042] Figure 10 This is a schematic diagram of the structure of a chart drawing device disclosed in an embodiment of this application;

[0043] Figure 11 This is a schematic diagram of another chart drawing device disclosed in the embodiments of this application;

[0044] Figure 12 This is a schematic diagram of the structure of a computer device disclosed in an embodiment of this application. Detailed Implementation

[0045] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0046] Please see Figure 1 , Figure 1 This is a schematic diagram of the architecture of a chart drawing system disclosed in an embodiment of this application, such as... Figure 1 As shown in the diagram, the architecture 100 of the chart drawing system may include a server 101, a business platform 102, and a terminal device 103. The server 101, business platform 102, and terminal device 103 can communicate with each other. The server 101 primarily processes chart drawing requests sent by the business platform 102. Specifically, it determines a target drawing component from various front-end drawing components encapsulated based on a headless browser framework, generates corresponding chart data using the target drawing component and the chart drawing request, and sends the chart data to the business platform 102. The business platform 102 primarily sends chart drawing requests to the server 101 and receives the chart data generated by the server 101. Furthermore, the business platform 102 also sends the chart data to the terminal device 103, enabling the terminal device 103 to display the chart data in a non-webpage manner. The number of business platforms 102 and terminal devices 103 may be multiple; no specific limit is placed on the number here.

[0047] In one possible implementation, the business platform 102 sends a chart drawing request to the server 101, the request carrying data to be processed (mainly for chart drawing). The server 101 parses the data to be processed to obtain a parsing result. Parsing the data to be processed is to determine whether there is a data format in the pre-configured data format of the server 101 that is the same as the data to be processed. Based on the parsing result, the server 101 determines the target drawing component from a variety of front-end drawing components encapsulated based on a headless browser framework (if it is determined that there is a data format in the pre-configured data format that is the same as the data to be processed). The server then uses the target drawing component and the parsing result to generate the chart data corresponding to the data to be processed. Further, the server 101 sends the chart data to the business platform 102, and the business platform 102 then sends the chart data to the terminal device 103, which displays the chart data in a non-webpage manner. Through this method, on the one hand, this application determines the target drawing component from a variety of front-end drawing components encapsulated based on a headless browser framework, which can improve the versatility and scenario applicability of the chart drawing method; on the other hand, this application displays the chart data in a non-webpage manner, which can eliminate the strong dependence on the browser interface.

[0048] In one possible implementation, it can be used Figure 2a The specific work of server 101, business platform 102, and terminal device 103 can be divided into two parts: one is the backend work, and the other is the scene display of charts (frontend display), such as... Figure 2a The diagram illustrates a scenario of a chart drawing system disclosed in this application. The process of generating chart data for server 101 and business platform 102 can include a data preparation section and a general charting and tabulation function section. After receiving the chart data, the terminal device 103 can display application scenarios including email notifications, SMS notifications, report displays, and timed displays with charts. In all the above application scenarios, the chart data can be opened without the assistance of a webpage (a webpage supported by the browser interface). For example, email notifications display the chart data as an image in the body of the email; SMS notifications directly display the chart data as an image on a social media page using a social application; and report displays directly insert the chart data into a work summary document. For example, displaying chart data directly as an image on a social media page using a social application... Figure 2b The image shown is a schematic diagram of a chart display scenario disclosed in an embodiment of this application. It illustrates a chat interface of a specific social application. The business platform can display the chart data using system prompts, so the user sees an image, such as... Figure 2b As shown in 20. For example... Figure 2cThe image shown is a schematic diagram of another chart display scenario disclosed in an embodiment of this application. This scenario displays chart data using an email page. Figure 2c As shown, work performance is displayed directly on the email page. Employees can view it immediately upon receiving the email without any additional steps. The timed chart feature can be applied to email and SMS notifications; this functionality is primarily implemented by the business platform 102 using timers and similar mechanisms.

[0049] Further explanation of server 101, business platform 102, and terminal device 103: In this application embodiment, server 101 can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. This application embodiment does not impose any limitations on these aspects. In the technical solutions provided in this application embodiment, a server is used as an example to describe the technical solutions provided in this application embodiment.

[0050] The business platform 102 in this embodiment can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. Furthermore, the business platform 102 can also be a server corresponding to different terminal devices.

[0051] The terminal device 103 in this application embodiment includes, but is not limited to, user equipment, handheld devices with wireless communication capabilities, vehicle-mounted devices, wearable devices, or computing devices. For example, the terminal device 103 may be a mobile phone, a tablet computer, or a computer with wireless transceiver capabilities. The terminal device 103 may also be a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, a wireless terminal device in industrial control, a wireless terminal device in autonomous driving, a wireless terminal device in telemedicine, a wireless terminal device in a smart grid, a wireless terminal device in a smart city, a wireless terminal device in a smart home, and so on. In this application embodiment, the device used to implement the functions of the terminal device may be a terminal; it may also be a device capable of supporting the terminal device in implementing the functions, such as a chip system, which may be installed in the terminal device. In the technical solutions provided in this application embodiment, a terminal device is used as an example to describe the technical solutions provided in this application embodiment.

[0052] Please see Figure 3 , Figure 3 This is a flowchart illustrating a chart drawing method disclosed in an embodiment of this application. The flowchart primarily describes a server as the executing entity. The server can be... Figure 1The server 101 shown may mainly include the following steps:

[0053] S301. The server obtains a chart drawing request submitted by the business platform, which carries data to be processed.

[0054] Among them, the chart drawing request submitted by the business platform is obtained by the server. The business platform actively sends the chart drawing request in order to get the server to return the drawn chart data.

[0055] In one possible implementation, after the server receives a chart drawing request, it preprocesses the data to be processed carried in the request. This preprocessing includes obtaining a traffic threshold and the permission configuration information of the business platforms. The traffic threshold is a constraint on data volume set in the server's own configuration. It can be a global setting, meaning the data volume limit is the same for all business platforms, or it can be set based on specific business platforms, meaning the data volume limit differs for different platforms. The permission configuration information of the business platforms refers to identifiers recorded on the server. Based on the traffic threshold and the permission configuration information of the business platforms, the server performs rate limiting and authentication on the data to be processed. The rate limiting process works as follows: if the amount of data to be processed sent by a business platform exceeds the traffic threshold, the server can set an interval to receive the data in a time-sharing manner. Since the server may be processing chart drawing requests from many business platforms simultaneously, rate limiting is also intended to improve processing efficiency. The specific authentication process is as follows: The server compares the identifier carried by the data to be processed with the permission configuration information of the business platform obtained, and checks whether the identifier carried by the data to be processed is consistent with the identifier of the business platform. If they are consistent, it proves that the data is safe. If they are inconsistent, it indicates that the data may be malicious data and may attack the server, and the server will refuse to perform further processing.

[0056] In one possible implementation, before the server receives the chart drawing request submitted by the business platform, it also needs to encapsulate various front-end drawing components. Specifically, this includes: the server obtaining a set of drawing components, which includes various front-end drawing components. These drawing components mainly refer to high-efficiency front-end drawing components, including Highcharts, ECharts, and D3 components, etc., which are not listed in this application. Further, the server imports the source code of various front-end drawing components into the component configuration file based on a headless browser framework to encapsulate the various front-end drawing components and complete the encapsulation. In this embodiment, the headless browser framework mainly utilizes the Puppeteer framework. Puppeteer is an open-source framework from Google that controls the browser through the devtools protocol, enabling automated interface with or without a user interface and advanced web crawling. Using Puppeteer as the runtime environment provides headless browser rendering and screenshot functions, making the entire drawing process more efficient. For easier use and better extensibility, a feature based on Puppeteer is encapsulated to support multiple layouts, such as HTML (HyperText Markup Language) layout. It also provides component configuration functionality (encapsulation of various front-end drawing components), such as... Figure 4a As shown. The layout settings mainly involve rendering the chart's color, size, and background in the backend. The encapsulation of various front-end drawing components is primarily to improve the chart's versatility, as detailed below. Figure 4b As shown, component configuration can be described in the form of a layered architecture. In this embodiment, it can be divided into an interface layer, a business logic layer, and a configuration layer. In some feasible embodiments, it can also be divided into two layers: an interface layer and a configuration layer. In this embodiment, multiple front-end drawing components are configured in the configuration layer to provide the business logic layer with a variety of optional drawing components, thus enriching the types of drawing. This is achieved by importing the source code (JavaScript source code) related to the front-end drawing components into the configuration file. Figure 4bThe example code illustrates the source code for plotting component 1, plotting component 2, and plotting component 3. These plotting components can be Highcharts, ECharts, D3, etc. Calling these components is achieved through three steps in the business logic layer: 1. Setting data: passing the parsed results to the target plotting component via the target plotting interface; 2. Rendering: rendering the parsed results using the adapted target plotting component to quickly provide plotting functionality; 3. Saving: taking a screenshot of the generated chart data and saving it. The interface layer only needs to provide the corresponding plotting component interface according to the plotting rules configuration information, such as a line chart interface or a bar chart interface. Encapsulating the functionality of multiple plotting components creates a clear hierarchy, facilitates convenient and quick integration, and provides various plotting functions for the business platform.

[0057] Highcharts is a charting library written entirely in JavaScript, making it easy to add interactive charts to front-end websites or applications. It's free for personal learning, personal websites, and non-commercial use. Highcharts supports chart styles including line charts, area charts, bar charts, pie charts, scatter plots, and composite charts. ECharts (Enterprise Charts) is a pure JavaScript charting library that runs smoothly on computers and mobile devices, compatible with most browsers. It relies on a lightweight Canvas library and provides intuitive, vivid, interactive, and highly customizable data visualization charts. D3 (DataDrive Document) is a JavaScript library similar to jQuery, offering many useful methods for data visualization.

[0058] S302. The server obtains the parsing result by parsing the data to be processed, and determines the target drawing component from a variety of front-end drawing components encapsulated based on a headless browser framework according to the parsing result.

[0059] In one possible implementation, after the server performs rate limiting and authentication on the data to be processed, it parses the data to obtain a parsing result. This parsing primarily involves resolving the format of the data to be processed to obtain the target data format. The resulting target data format is suitable for the server, thus providing further protection. Further, the server obtains multiple predefined data formats, which are data formats supported by various front-end drawing components. It then determines whether the target data format is included among these multiple data formats. If it is, the server determines the target drawing component from the multiple front-end drawing components based on the parsing result. The target drawing component is the drawing component corresponding to the target data format. These multiple front-end drawing components are encapsulated based on a headless browser framework, specifically the Puppeteer framework described in step S301.

[0060] In one possible implementation, if the target data format is not found among multiple data formats, the server terminates the execution process and returns the requested chart data to the business platform, indicating that the chart drawing request could not be generated. Furthermore, developers can optimize the server based on this unfulfilled task to enable chart drawing with more functionalities.

[0061] S303. The server uses the target drawing component and the parsing results to generate chart data corresponding to the data to be processed, and sends the chart data to the business platform so that the business platform can display the chart data in a non-webpage manner through the terminal device.

[0062] In one possible implementation, before the server generates the chart data corresponding to the data to be processed using the target drawing component and the parsing results, it also needs to obtain the drawing rule configuration information corresponding to the data to be processed. The drawing rule configuration information is the chart style and chart layout expected by the business platform. In this application, the drawing rule configuration information obtained by the server can be divided into two main categories: one category is obtained from the configuration information pre-submitted by the business platform. In some cases, the pre-submitted configuration information is sent to the server when the business platform and the server first establish a connection. The business platform sends such configuration information for convenience or to unify the style of the charts. For example, in the attendance statistics of some enterprises, it is beneficial to manage if the style of the statistical charts is the same every time. At the same time, in this case, since the server does not need to obtain the chart drawing rule configuration information from the business platform every time, it can save time to a certain extent and improve the rate of chart data generation. The other category is obtained from the chart drawing request, that is, the chart drawing request carries the drawing rule configuration information. That is, every time the business platform sends a chart drawing request, it customizes a set of drawing rule configuration information in the chart drawing request. This situation is mostly due to the different needs of the customers corresponding to the business platform, which tends to be more personalized, such as individuals wanting to customize certain chart data. Regardless of the type, the server first needs to check the chart drawing request for any drawing rule configuration information. If it does, the server uses the rules from that configuration; otherwise, it uses the rules from the drawing rule configuration information pre-submitted by the business platform. Furthermore, if none of the pre-submitted configuration information from the business platform contains any drawing rule configuration information, the server uses the default drawing rule configuration information for drawing. This default drawing rule configuration information is usually a set of general rules derived from historical statistical information.

[0063] In one possible implementation, after the server obtains the plotting rule configuration information corresponding to the data to be processed, it determines the target plotting interface from multiple plotting interfaces based on this configuration information. There may be more than one target plotting interface. Sometimes, the business platform may want different chart styles for a set of data. Each plotting interface corresponds to a chart style, and these chart styles are diverse, such as line charts, bar charts, donut charts, pie charts, etc., which will not be listed here. Further, the server calls the target plotting component through the target plotting interface to plot the parsed results to generate the chart data corresponding to the data to be processed. More specifically, the server passes the parsed results to the target plotting component through the target plotting interface, and then uses the target plotting component to render the chart corresponding to the parsed results. The specific chart rendering includes rendering the chart style and layout (including chart color, background color, font size and color, etc.). The specific chart style of the rendered chart is the chart style corresponding to the target plotting interface. Finally, the server performs screenshot processing on the chart to obtain the chart data corresponding to the data to be processed, and stores the chart data. Correspondingly, the number of images generated depends on the number of charts required for the chart drawing request. In this implementation, the commonly used and efficient Cloud Object Service (COS) storage service can be used to store the chart data. Screenshotting the charts facilitates the business platform's transmission of the chart data to terminal devices, enabling them to display the data in a non-webpage format. COS storage provides chart storage support for different application scenarios (email, messages, reports, etc.), adapting to various chart display scenarios and offering strong scalability. The screenshot data includes not only the captured chart but also related data information such as the screenshot time and the total data volume of the chart.

[0064] In one possible implementation, when the server is generating chart data from the data to be processed, it determines whether the business platform requires the server to return a progress message of the chart data generation. If so, the server returns the progress message to the business platform in real time. If there is no hard requirement to return the progress message, the server returns the result to the business platform after processing all the data to be processed.

[0065] In one possible implementation, the server can also store the generated chart data at the server's underlying storage layer. This storage can provide a valid basis for later data verification. Furthermore, in some cases, errors may occur during chart data generation; storing data from each execution step allows for quick identification of the cause of the error.

[0066] In one possible implementation, the server can simultaneously process chart drawing requests from different business platforms. In this application, based on tests on 15 actual samples (a 30-day data period, with data collected every 0.5 days), the average time to draw 5 bar charts and line charts sequentially is 2.7 seconds; increasing the server's concurrent processing capacity reduces the average time by approximately 1 second. Therefore, the method provided in this application is suitable for concurrent processing, meaning it can handle chart drawing requests from multiple business platforms simultaneously with high efficiency.

[0067] In this embodiment, the server obtains a chart drawing request submitted by the business platform, parses the data to be processed carried in the chart drawing request to obtain a parsing result, and determines a target drawing component from a variety of front-end drawing components encapsulated based on a headless browser framework according to the parsing result. The server then generates chart data corresponding to the data to be processed using the target drawing component and the parsing result, and sends the chart data to the business platform so that the business platform can display the chart data in a non-webpage manner through a terminal device. Through the method of this embodiment, on the one hand, determining the target drawing component from a variety of front-end drawing components encapsulated based on a headless browser framework can improve the versatility and scenario applicability of chart drawing; on the other hand, displaying chart data in a non-webpage manner can eliminate strong dependence on the browser interface.

[0068] Please see Figure 5 , Figure 5 This is a flowchart illustrating another chart drawing method disclosed in an embodiment of this application. The flowchart primarily uses a business platform as the executing entity. The business platform can be... Figure 1 The business platform 102 shown may mainly include the following steps:

[0069] S501. The business platform submits a chart drawing request to the server. The chart drawing request is used to instruct the server to draw the chart based on the data.

[0070] In one possible implementation, the business platform submits chart drawing requests to the server periodically, or in real-time (i.e., submitting a chart drawing request only when needed). These chart drawing requests can be user-defined, meaning users submit data and requirements to the corresponding server of the business platform according to their needs. For example, a company might need a statistical table of employee attendance data, or an individual might want a statistical table of their various health indicators; both could send a chart drawing request to the business platform.

[0071] The chart drawing request instructs the server to generate chart data based on the data to be processed. Specifically, the chart drawing request carries data to be processed and instructs the server to determine the target drawing component from various front-end drawing components encapsulated in a headless browser framework based on the parsing results of the data to be processed. The server then uses the target drawing component and the parsing results to generate the chart data corresponding to the data to be processed. The specific generation process is already described in [the original text]. Figure 3 This is explained in detail in the text.

[0072] S502, The business platform receives chart data sent by the server.

[0073] In one possible implementation, after the server generates chart data, it sends the chart data to the business platform, which then receives and stores the chart data on its server. The business platform can send the chart data to the terminal devices in real time, or it can send it to the terminal devices when a trigger condition is met. The trigger condition could be triggering a timer function, which could be used for scenarios such as weekly or monthly reports. That is, at the set time, the business platform sends the report to the terminal devices via email or message, so that users on different terminal devices can understand their recent work progress.

[0074] S503: The business platform sends chart data to the terminal device so that the terminal device can display the chart data in a non-webpage manner.

[0075] In one possible implementation, the business platform can send chart data to the terminal device so that the terminal device can display the chart data in a non-webpage manner. The terminal device can be a terminal device directly connected to the business platform, or a terminal device connected to the business platform indirectly.

[0076] In another possible implementation, the server can directly send the chart data to the terminal device, allowing the terminal device to display the chart data in a non-webpage format. In this case, the business platform sends a chart drawing request along with the corresponding terminal device's IP address, enabling the server to send the chart data based on the terminal device's IP address.

[0077] Non-web page methods include one or more of email pages, notification messages, and report documents. This means that users can directly see the chart data when they open the email page, without needing to click a link to be redirected to a browser page to view the chart data.

[0078] In this application, the embodiments are described from the perspective of a business platform. The business platform submits a chart drawing request to the server, receives chart data generated by the server based on the chart drawing request, and then sends the chart data to the terminal device so that the terminal device can display the chart data in a non-webpage manner. This method demonstrates the universality of the chart drawing method provided by the embodiments of this application. Regardless of the type of business platform, as long as the server authentication is passed, the chart data generated by the server can be obtained efficiently.

[0079] Please see Figure 6 , Figure 6 This is a flowchart illustrating another chart drawing method disclosed in the embodiments of this application. The flowchart primarily describes the interaction between a server, a business platform, and a terminal device, involving the following execution entities: a server, a business platform, and a terminal device (e.g.,...). Figure 1 The interactive flowchart shown (including server 101, business platform 102, and terminal device 103) may include the following steps:

[0080] S601, The terminal device sends a chart drawing request to the business platform.

[0081] S602, The business platform sends a chart drawing request to the server.

[0082] S603. The server receives a chart drawing request, processes the request, and generates chart data.

[0083] S604, The server sends chart data to the business platform.

[0084] S605, The business platform sends chart data to the terminal device.

[0085] In one possible implementation, for an enterprise, the terminal device sending the chart drawing request can be the terminal device corresponding to the enterprise manager; for an individual, the terminal device sending the chart drawing request can be any personal terminal device. The chart drawing request can be adjusted according to the user's needs. Specifically, after receiving the chart drawing request, the business platform forwards it to the server. The server receives the chart drawing request, processes it, and generates the chart data corresponding to the data to be processed carried in the chart drawing request. The specific processing steps are as follows... Figure 3 As shown, these details will not be elaborated upon here. Further, the server sends chart data to the business platform, and then the server sends chart data to the terminal device according to the requirements of the terminal device.

[0086] In this embodiment of the application, the chart drawing method provided by the embodiment of the application is described through the interaction of the server, the business platform and the terminal device. This allows for a more intuitive view of the processing steps of the server, the business platform and the terminal device, and also demonstrates the versatility and applicability of the method.

[0087] Please see Figure 7 , Figure 7 This is a schematic diagram of the architecture of a layered chart drawing system disclosed in an embodiment of this application, mainly illustrating the layered architecture on the server side, such as... Figure 7 As shown, in this implementation, the chart drawing system can be divided into an application layer, a service layer, and a storage layer. The logic is from top to bottom, that is, from the application layer to the service layer, and then from the service layer to the storage layer:

[0088] The application layer is mainly oriented towards the business platform and includes a business call module and a data input module. Business call refers to the business platform calling the methods provided by this server, including timed calls, real-time calls, etc. Data input refers to the data transmitted from the business platform. In the embodiment of this application, it can be a chart drawing request and pre-submitted configuration information, etc.

[0089] The service layer is primarily the core layer where the server processes business requests made by the business platform. Furthermore, to provide better scalability and adhering to the single responsibility principle, the service layer can be split into, for example... Figure 7 The diagram shows two parts. The upper part can include function triggering, asynchronous data sampling, preprocessing, data organization, and data reporting. The lower part can include data receiving, data parsing, data plotting, screenshot processing, and image storage. Correspondingly, the specific functional division implemented by the upper and lower parts can be as follows: Figure 8a As shown, Figure 7 The upper part of the service layer implements the chart data processing function (which can be configured to meet different business needs). It can provide data collection, data processing and other functions to make it more flexible and convenient to provide external services. Figure 7 The lower part of the service layer implements the screenshot rendering function, which has good scalability to support drawing functions. Function triggering refers to receiving a chart drawing request sent by the business platform; asynchronous data sampling refers to receiving data from the data sent by the business platform (when the data volume is large); preprocessing and data cleaning are preliminary processing of the data, including rate limiting and security processing, as described in step S302. After the data is cleaned, it is reported to the next layer, i.e. Figure 7 The specific processing is done in the lower part of the corresponding service layer. Figure 3 This has already been explained in detail in [the document / relevant text]. Among other things, Figure 8aThe implementation logic of the corresponding chart data processing function can be used Figure 8b This is explained in more detail: the server receives data from the business platform through communication protocol interfaces (such as RPC, HTTP, etc.), performs configuration, authentication, and rate limiting on the received data. Simultaneously, the server also processes the front-end drawing components (Highcharts data, ECharts, etc.) called through the interfaces, including formatting and encapsulation. Furthermore, Figure 7 The service layer shown also includes a notification platform service module and a COS storage module. The notification platform service module is used to send notification information to the business platform, and the COS storage module is used for storing charts. It can provide chart storage support for different application scenarios (email, messages, reports, etc.), adapt to various chart display scenarios, and has strong extensibility.

[0090] In one possible implementation, the functionality implemented by the service layer can be used... Figure 9 The flowchart shown will be used to illustrate this. Figure 9 The flowchart shown is also the core process of this application, and its sequence includes: function triggering, business data collection, data processing, data parsing, determining whether a drawing component is supported, encapsulating the drawing component function, acquiring and storing the chart, and determining whether a notification is needed. Specifically, determining whether a drawing component is supported means checking if the data to be processed supports the drawing component provided by the server. If supported, the encapsulated front-end drawing component function is directly called to draw the chart. After obtaining the chart, a screenshot is taken to obtain the chart data. If the data to be processed does not support the drawing component provided by the server, the server directly terminates the processing flow. Further, determining whether a notification is needed means checking if the business platform needs the server to return the chart drawing progress. If so, the server sends a progress message to the business platform every time it processes data until completion. If the business platform does not request the server to return the chart drawing progress, the server completes all data processing before terminating the process.

[0091] The storage layer is mainly used to store data. In this embodiment, the stored database is a relational database in MDB (message driven bean) format, mainly to facilitate the use of the data.

[0092] The architecture also includes a gateway module and a monitoring module. The gateway module is mainly used to establish a communication connection with the business platform, while the monitoring module is mainly used to monitor the various stages of the server and generate corresponding log information for each stage.

[0093] Please see Figure 10 , Figure 10This is a schematic diagram of the structure of a chart drawing device disclosed in an embodiment of this application. The chart drawing device 1000 may include: an acquisition unit 1001, a processing unit 1002, a determination unit 1003, and a sending unit 1004, wherein:

[0094] The acquisition unit 1001 is used to acquire a chart drawing request submitted by the business platform, wherein the chart drawing request carries data to be processed;

[0095] Processing unit 1002 is used to obtain a parsing result by parsing the data to be processed;

[0096] The determining unit 1003 is used to determine the target drawing component from a variety of front-end drawing components encapsulated based on a headless browser framework according to the parsing result;

[0097] The processing unit 1002 is further configured to generate chart data corresponding to the data to be processed using the target drawing component and the parsing result;

[0098] The sending unit 1004 is used to send the chart data to the business platform so that the business platform can display the chart data in a non-webpage manner through a terminal device.

[0099] In one possible implementation, the processing unit 1002 uses the target drawing component and the parsing result to generate chart data corresponding to the data to be processed, for the purpose of:

[0100] Obtain the drawing rule configuration information corresponding to the data to be processed;

[0101] The target drawing interface is determined from multiple drawing interfaces based on the drawing rule configuration information, and each drawing interface corresponds to a chart style;

[0102] The target drawing interface is used to call the target drawing component to draw the parsed results, thereby generating chart data corresponding to the data to be processed.

[0103] In one possible implementation, the processing unit 1002 calls the target drawing component through the target drawing interface to draw the parsing result, thereby generating chart data corresponding to the data to be processed, for the purpose of:

[0104] The parsing result is passed to the target drawing component through the target drawing interface;

[0105] The target drawing component is used to render a chart corresponding to the parsing result, and the chart style is the same as the chart style corresponding to the target drawing interface.

[0106] By taking a screenshot of the chart, the chart data corresponding to the data to be processed can be obtained.

[0107] In one possible implementation, the acquisition unit 1001 acquires the drawing rule configuration information corresponding to the data to be processed, for the purpose of:

[0108] Obtain the drawing rule configuration information corresponding to the data to be processed from the configuration information pre-submitted by the business platform; or,

[0109] The chart drawing request also carries the drawing rule configuration information corresponding to the data to be processed.

[0110] In one possible implementation, the acquisition unit 1001 is further configured to acquire the traffic threshold and the permission configuration information of the business platform;

[0111] The processing unit 1002 is further configured to:

[0112] Based on the traffic threshold and the permission configuration information of the business platform, the data to be processed is subjected to rate limiting and authentication.

[0113] After the rate limiting and authentication processes are passed, the step of obtaining the parsing result by parsing the data to be processed is executed.

[0114] In one possible implementation, the acquisition unit 1001 is further configured to acquire a set of drawing components, the set of drawing components including a variety of front-end drawing components;

[0115] The processing unit 1002 is further configured to import the source code of the various front-end drawing components into the component configuration file based on the headless browser framework, so as to encapsulate the various front-end drawing components.

[0116] In one possible implementation, the acquisition unit 1001 is further configured to acquire a variety of predefined data formats and the target data format included in the parsing result, wherein the variety of data formats are data formats supported by the variety of front-end drawing components;

[0117] The processing unit 1002 is further configured to:

[0118] Determine whether the target data format is included among the multiple data formats;

[0119] If so, then the step of determining the target drawing component from the various front-end drawing components encapsulated based on the parsing result is performed.

[0120] In this embodiment, the acquisition unit 1001 acquires a chart drawing request submitted by the business platform; the processing unit 1002 obtains a parsing result by parsing the data to be processed carried in the chart drawing request; and the determination unit 1003 determines a target drawing component from a variety of front-end drawing components encapsulated based on a headless browser framework according to the parsing result. The processing unit 1002 uses the target drawing component and the parsing result to generate chart data corresponding to the data to be processed. Finally, the sending unit 1004 sends the chart data to the business platform, enabling the business platform to display the chart data in a non-webpage manner through a terminal device. Through the method of this embodiment, on the one hand, determining the target drawing component from a variety of front-end drawing components encapsulated based on a headless browser framework can improve the versatility and scenario applicability of chart drawing; on the other hand, displaying chart data in a non-webpage manner can eliminate strong dependence on the browser interface.

[0121] Please see Figure 11 , Figure 11 This is a schematic diagram of the structure of a chart drawing device disclosed in an embodiment of this application. The chart drawing device 1100 may include: a sending unit 1101 and a receiving unit 1102, wherein:

[0122] Sending unit 1101 is used to submit a chart drawing request to the server. The chart drawing request carries data to be processed. The chart drawing request is used to instruct the server to determine the target drawing component from a variety of front-end drawing components encapsulated based on a headless browser framework according to the parsing result of the data to be processed, and to generate chart data corresponding to the data to be processed using the target drawing component and the parsing result.

[0123] The receiving unit 1102 is used to receive the chart data sent by the server;

[0124] The sending unit 1101 is further configured to send the chart data to the terminal device so that the terminal device displays the chart data in a non-webpage manner, wherein the non-webpage manner includes one or more of email pages, notification messages, and report documents.

[0125] In this embodiment, the sending unit 1101 submits a chart drawing request to the server, and the receiving unit 1102 receives the chart data generated according to the chart drawing request sent by the server, and sends the chart data to the terminal device through the sending unit 1101, so that the terminal device can display the chart data in a non-webpage manner. This method demonstrates the universality of the chart drawing method provided in this embodiment. Regardless of the business platform, as long as the server is authenticated, the chart data generated by the server can be obtained efficiently.

[0126] Please see Figure 12, Figure 12 This is a schematic diagram of the structure of a computer device disclosed in an embodiment of this application. The computer device 1200 can implement steps executed by a server or by a business platform. The computer device 1200 includes at least a processor 1201, a memory 1202, and a communication device 1203. The processor 1201, memory 1202, and communication device 1203 can be connected via a bus or other means. The communication device 1203 is used for sending and receiving data. The memory 1202 may include a computer-readable storage medium and is used to store computer programs, including computer instructions. The processor 1201 is used to execute the computer instructions stored in the memory 1202. The processor 1201 (or CPU (Central Processing Unit)) is the computing and control core of the computer device 1200, suitable for implementing one or more computer instructions, specifically suitable for loading and executing one or more computer instructions to achieve corresponding method flows or corresponding functions.

[0127] This application also discloses a computer-readable storage medium (Memory), which is a memory device in computer device 1200 used to store programs and data. It is understood that the memory 1202 here may include the built-in storage medium in computer device 1200, or it may include extended storage media supported by computer device 1200. The computer-readable storage medium provides storage space that stores the operating system of computer device 1200. Furthermore, the storage space also stores one or more computer instructions suitable for loading and execution by processor 1201. These computer instructions may be one or more computer programs (including program code). It should be noted that the memory 1202 here may be high-speed RAM, or non-volatile memory, such as at least one disk storage device; optionally, it may also be at least one computer-readable storage medium located remotely from the aforementioned processor 1201.

[0128] In one implementation, the computer device 1200 can be Figure 1 The diagram drawing system shown includes a server 101; a memory 1202 stores first computer instructions; the processor 1201 loads and executes the first computer instructions stored in the memory 1202 to achieve... Figure 3 , Figure 6 The corresponding steps in the method embodiment shown; in specific implementation, the first computer instruction in memory 1202 is loaded by processor 1201 and executed as follows:

[0129] Obtain a chart drawing request submitted by the business platform, wherein the chart drawing request carries data to be processed;

[0130] The parsing result is obtained by parsing the data to be processed, and the target drawing component is determined from a variety of front-end drawing components encapsulated based on the parsing result.

[0131] The target drawing component and the parsing result are used to generate chart data corresponding to the data to be processed.

[0132] The chart data is sent to the business platform so that the business platform can display the chart data in a non-webpage manner through a terminal device.

[0133] In one possible implementation, the processor 1201 uses the target drawing component and the parsing result to generate chart data corresponding to the data to be processed, for:

[0134] Obtain the drawing rule configuration information corresponding to the data to be processed;

[0135] The target drawing interface is determined from multiple drawing interfaces based on the drawing rule configuration information, and each drawing interface corresponds to a chart style;

[0136] The target drawing interface is used to call the target drawing component to draw the parsed results, thereby generating chart data corresponding to the data to be processed.

[0137] In one possible implementation, the processor 1201 calls the target drawing component through the target drawing interface to draw the parsed results, thereby generating chart data corresponding to the data to be processed, for:

[0138] The parsing result is passed to the target drawing component through the target drawing interface;

[0139] The target drawing component is used to render a chart corresponding to the parsing result, and the chart style is the same as the chart style corresponding to the target drawing interface.

[0140] By taking a screenshot of the chart, the chart data corresponding to the data to be processed can be obtained.

[0141] In one possible implementation, the processor 1201 acquires the drawing rule configuration information corresponding to the data to be processed, for the purpose of:

[0142] Obtain the drawing rule configuration information corresponding to the data to be processed from the configuration information pre-submitted by the business platform; or,

[0143] The chart drawing request also carries the drawing rule configuration information corresponding to the data to be processed.

[0144] In one possible implementation, the processor 1201 is further configured to:

[0145] Obtain the traffic threshold and the permission configuration information of the business platform;

[0146] Based on the traffic threshold and the permission configuration information of the business platform, the data to be processed is subjected to rate limiting and authentication.

[0147] After the rate limiting and authentication processes are passed, the step of obtaining the parsing result by parsing the data to be processed is executed.

[0148] In one possible implementation, the processor 1201 is further configured to:

[0149] Obtain a set of drawing components, which includes various front-end drawing components;

[0150] The source code of the various front-end drawing components is imported into the component configuration file based on the headless browser framework to encapsulate the various front-end drawing components.

[0151] In one possible implementation, the processor 1201 is further configured to:

[0152] Acquire multiple predefined data formats and the target data formats included in the parsing results, wherein the multiple data formats are data formats supported by the multiple front-end drawing components;

[0153] Determine whether the target data format is included among the multiple data formats;

[0154] If so, then the step of determining the target drawing component from the various front-end drawing components encapsulated based on the parsing result is performed.

[0155] In this embodiment, processor 1201 obtains a chart drawing request submitted by a business platform, parses the data to be processed carried in the chart drawing request to obtain a parsing result, and determines a target drawing component from a variety of front-end drawing components encapsulated based on a headless browser framework according to the parsing result; generates chart data corresponding to the data to be processed using the target drawing component and the parsing result; and finally, sends the chart data to the business platform so that the business platform can display the chart data in a non-webpage manner through a terminal device. Through the method of this embodiment, on the one hand, determining the target drawing component from a variety of front-end drawing components encapsulated based on a headless browser framework can improve the versatility and scenario applicability of chart drawing; on the other hand, displaying chart data in a non-webpage manner can eliminate strong dependence on a browser interface.

[0156] In one implementation, the computer device 1200 can be Figure 1 The diagram drawing system shown includes a business platform 102; a memory 1202 stores first computer instructions; the processor 1201 loads and executes the first computer instructions stored in the memory 1202 to achieve... Figure 5 , Figure 6 The corresponding steps in the method embodiment shown; in specific implementation, the first computer instruction in memory 1202 is loaded by processor 1201 and executed as follows:

[0157] A chart drawing request is submitted to the server. The chart drawing request carries data to be processed. The chart drawing request is used to instruct the server to determine the target drawing component from a variety of front-end drawing components encapsulated based on a headless browser framework according to the parsing result of the data to be processed, and to generate chart data corresponding to the data to be processed using the target drawing component and the parsing result.

[0158] Receive the chart data sent by the server;

[0159] The chart data is sent to a terminal device so that the terminal device displays the chart data in a non-webpage manner, which includes one or more of email pages, notification messages, and report documents.

[0160] In this embodiment of the application, the processor of the business platform submits a chart drawing request to the server, receives chart data generated according to the chart drawing request from the server, and sends the chart data to the terminal device so that the terminal device can display the chart data in a non-webpage manner. This method demonstrates the versatility of the chart drawing method provided in this embodiment of the application.

[0161] According to one aspect of this application, a computer program product or computer program is also disclosed, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the aforementioned... Figure 3 , Figure 5 as well as Figure 6 The methods in the embodiments corresponding to the flowchart will not be described again here.

[0162] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0163] In the several embodiments provided in this application, it should be understood that the disclosed apparatus can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative, and the division of modules described above is only a logical functional division. In actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed.

[0164] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for drawing charts, characterized in that, The method includes: Obtain a chart drawing request submitted by the business platform, wherein the chart drawing request carries data to be processed; The parsing result is obtained by parsing the data to be processed, and the parsing result includes the target data format; Obtain multiple predefined data formats, which are data formats supported by multiple front-end drawing components, which are encapsulated based on a headless browser framework; If the target data format is included among the multiple data formats, then the target drawing component corresponding to the target data format is determined from the multiple front-end drawing components. The target drawing component and the parsing result are used to generate chart data corresponding to the data to be processed, and the chart data is sent to the business platform so that the business platform can display the chart data in a non-webpage manner through the terminal device.

2. The method according to claim 1, characterized in that, The step of generating chart data corresponding to the data to be processed using the target drawing component and the parsing result includes: Obtain the drawing rule configuration information corresponding to the data to be processed; The target drawing interface is determined from multiple drawing interfaces based on the drawing rule configuration information, and each drawing interface corresponds to a chart style; The target drawing interface is used to call the target drawing component to draw the parsed results, thereby generating chart data corresponding to the data to be processed.

3. The method according to claim 2, characterized in that, The step of calling the target drawing component through the target drawing interface to draw the parsed results, thereby generating chart data corresponding to the data to be processed, includes: The parsing result is passed to the target drawing component through the target drawing interface; The target drawing component is used to render a chart corresponding to the parsing result, and the chart style is the same as the chart style corresponding to the target drawing interface. By taking a screenshot of the chart, the chart data corresponding to the data to be processed can be obtained.

4. The method according to claim 2 or 3, characterized in that, The step of obtaining the drawing rule configuration information corresponding to the data to be processed includes: Obtain the drawing rule configuration information corresponding to the data to be processed from the configuration information pre-submitted by the business platform; or, The chart drawing request also carries the drawing rule configuration information corresponding to the data to be processed.

5. The method according to claim 1, characterized in that, Before obtaining the parsing result by parsing the data to be processed, the method further includes: Obtain the traffic threshold and the permission configuration information of the business platform; Based on the traffic threshold and the permission configuration information of the business platform, the data to be processed is subjected to rate limiting and authentication. After the rate limiting and authentication processes are passed, the step of obtaining the parsing result by parsing the data to be processed is executed.

6. The method according to claim 1, characterized in that, Before obtaining the chart drawing request submitted by the business platform, the method further includes: Obtain a set of drawing components, which includes various front-end drawing components; The source code of the various front-end drawing components is imported into the component configuration file based on the headless browser framework to encapsulate the various front-end drawing components.

7. A method for drawing charts, characterized in that, The method includes: A chart drawing request is submitted to the server. The chart drawing request carries data to be processed. The chart drawing request is used to instruct the server to obtain a parsing result by parsing the data to be processed. The parsing result includes a target data format and obtains a variety of predefined data formats. The variety of data formats are data formats supported by a variety of front-end drawing components. The variety of front-end drawing components are encapsulated based on a headless browser framework. If the target data format is included among the variety of data formats, a target drawing component corresponding to the target data format is determined from the variety of front-end drawing components. The target drawing component and the parsing result are used to generate chart data corresponding to the data to be processed. Receive the chart data sent by the server; The chart data is sent to a terminal device so that the terminal device displays the chart data in a non-webpage manner, which includes one or more of email pages, notification messages, and report documents.

8. A chart drawing device, characterized in that, The device includes: The acquisition unit is used to acquire a chart drawing request submitted by the business platform, wherein the chart drawing request carries data to be processed. A processing unit is configured to obtain a parsing result by parsing the data to be processed, the parsing result including a target data format; The acquisition unit is also used to acquire a variety of predefined data formats, which are data formats supported by a variety of front-end drawing components, and the variety of front-end drawing components are encapsulated based on a headless browser framework; The determining unit is configured to determine, from the multiple front-end drawing components, a target drawing component corresponding to the target data format if the target data format is included among the multiple data formats; The processing unit is further configured to generate chart data corresponding to the data to be processed using the target drawing component and the parsing result; The sending unit is used to send the chart data to the business platform so that the business platform can display the chart data in a non-webpage manner through a terminal device.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, the computer program including program instructions that, when executed by a processor, cause the processor to perform the chart drawing method as described in any one of claims 1 to 6, or the chart drawing method as described in claim 7.

10. A computer program product, characterized in that, The computer program product includes a computer program or computer instructions, which, when executed by a processor, implement the chart drawing method as described in any one of claims 1 to 6, or the chart drawing method as described in claim 7.

Citation Information

Patent Citations

  • Mail content generation method and device, memory medium and electronic equipment

    CN109309612A

  • Data chart drawing method, device and equipment and computer readable storage medium

    CN111159987A