CN115272524B - Multi-curve parallel drawing method, device, equipment and storage medium - Google Patents

Multi-curve parallel drawing method, device, equipment and storage medium Download PDF

Info

Publication number
CN115272524B
CN115272524B CN202211161597.9A CN202211161597A CN115272524B CN 115272524 B CN115272524 B CN 115272524B CN 202211161597 A CN202211161597 A CN 202211161597A CN 115272524 B CN115272524 B CN 115272524B
Authority
CN
China
Prior art keywords
curve data
parallel
curve
curves
threads
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202211161597.9A
Other languages
Chinese (zh)
Other versions
CN115272524A (en
Inventor
郝伟
沈传宝
刘加瑞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Anhui Huayun'an Technology Co ltd
Original Assignee
Anhui Huayun'an Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Anhui Huayun'an Technology Co ltd filed Critical Anhui Huayun'an Technology Co ltd
Priority to CN202211161597.9A priority Critical patent/CN115272524B/en
Publication of CN115272524A publication Critical patent/CN115272524A/en
Application granted granted Critical
Publication of CN115272524B publication Critical patent/CN115272524B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/20Drawing from basic elements, e.g. lines or circles
    • G06T11/203Drawing of straight lines or curves
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/20Drawing from basic elements, e.g. lines or circles
    • G06T11/206Drawing of charts or graphs

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Generation (AREA)

Abstract

The embodiment of the invention provides a multi-curve parallel drawing method, a multi-curve parallel drawing device, multi-curve parallel drawing equipment and a storage medium. The method comprises the steps of obtaining curve data of a plurality of curves which need to be displayed in a graph, and respectively storing the curve data into a plurality of corresponding files; loading the plurality of files in parallel based on multiple threads; dividing the loaded files into a plurality of groups, and drawing curve data included in the corresponding file groups in parallel based on a plurality of drawing threads; and combining all drawing results obtained by parallel drawing to generate a chart comprising the multiple curves. In this way, the efficiency of generating multiple curves may be improved.

Description

Multi-curve parallel drawing method, device, equipment and storage medium
Technical Field
The invention relates to the field of chart drawing, in particular to the field of multi-curve parallel drawing.
Background
The curve plotting of the graph is the basic way to display statistical data. In most scenes, various curve drawing methods can be realized by various existing drawing libraries.
However, in some special application scenarios, for example, in real-time rendering of tens of thousands of curves, none of the currently known rendering controls can satisfy the situation.
Disclosure of Invention
The invention provides a multi-curve parallel drawing method, a multi-curve parallel drawing device, multi-curve parallel drawing equipment and a storage medium.
According to a first aspect of the present invention, there is provided a multi-curve parallel drawing method, the method comprising:
curve data of a plurality of curves which need to be displayed in a chart are obtained, and the curve data are respectively stored into a plurality of corresponding files;
loading a plurality of files in parallel based on multiple threads;
dividing the loaded files into a plurality of groups, and drawing curve data included in the corresponding file groups in parallel based on a plurality of drawing threads;
and combining the drawing results obtained by parallel drawing to generate a chart comprising a plurality of curves.
In some implementations of the first aspect, each file stores therein a number of the corresponding curve data;
dividing the loaded files into a plurality of groups, including:
and dividing the curve data in each file into a plurality of groups according to the corresponding serial numbers and the number of the drawing threads.
In some implementations of the first aspect, dividing the curve data in each file into multiple groups according to corresponding numbers and the number of drawing threads includes:
and if the number of the drawing threads is k, taking curve data with the number of j x k + s as a curve data group corresponding to the drawing thread s, wherein j is an integer greater than or equal to 0, and the number of the divided groups is equal to the number of the drawing threads.
In some implementations of the first aspect, the method further comprises:
and storing the numerical values of different coordinate axes in the curve data into corresponding arrays.
In some implementations of the first aspect, the parallel drawing of curve data included in a corresponding file group based on a plurality of drawing threads includes:
each drawing thread loads corresponding initial picture parameters;
and changing the numerical value of the corresponding coordinate in the initial picture parameter based on the coordinate corresponding to the curve data stored in the file group corresponding to each drawing thread.
In some implementations of the first aspect, the rendering results are picture data represented in a matrix; merging drawing results obtained by parallel drawing to generate a chart comprising a plurality of curves, wherein the chart comprises the following steps:
summing the matrixes corresponding to the drawing results;
and generating a chart comprising a plurality of curves according to the summation result of each element in the matrix, wherein if the summation result of the element is greater than a threshold value, a preset threshold value is assigned to the element.
According to a second aspect of the present invention, there is provided a multi-curve parallel drawing apparatus, the apparatus comprising:
the acquisition module is used for acquiring curve data of a plurality of curves which need to be displayed in the graph and respectively storing the curve data into a plurality of corresponding files;
a loading module for loading a plurality of files in parallel based on multiple threads;
the drawing module is used for dividing the loaded files into a plurality of groups and drawing curve data included in the corresponding file groups in parallel based on a plurality of drawing threads;
and the chart generation module is used for merging drawing results obtained by parallel drawing to generate a chart comprising a plurality of curves.
In some implementations of the second aspect, each file stores a number of corresponding curve data;
and the drawing module can also be used for dividing the curve data in each file into a plurality of groups according to the corresponding serial numbers and the number of the drawing threads.
In some implementations of the second aspect, the drawing module is further configured to, when there are k drawing threads, use curve data numbered j × k + s as a curve data group corresponding to the drawing thread s, where j is an integer greater than or equal to 0, and the number of divided groups is equal to the number of drawing threads.
In some implementations of the second aspect, the obtaining module is further configured to store values of different coordinate axes in the curve data into corresponding arrays.
In some implementations of the second aspect, the rendering module is further configured to load a corresponding initial picture parameter based on each rendering thread; and changing the numerical value of the corresponding coordinate in the initial picture parameter based on the coordinate corresponding to the curve data stored in the file group corresponding to each drawing thread.
In some implementations of the second aspect, the rendering results are picture data represented in a matrix; the chart generation module is also used for summing the matrixes corresponding to the drawing results;
and generating a chart comprising a plurality of curves according to the summation result of each element in the matrix, wherein if the summation result of the element is greater than a threshold value, a preset threshold value is assigned to the element.
According to a third aspect of the invention, an electronic device is provided. The electronic device includes: a memory having a computer program stored thereon and a processor that, when executing the program, implements the multi-curve parallel rendering method as described above in the first aspect, and in some implementations of the first aspect.
According to a fourth aspect of the present invention, there is provided a computer-readable storage medium, on which a computer program is stored, which program, when executed by a processor, implements the first aspect as described above, and some implementations of the first aspect, the multi-curve parallel rendering method.
The invention provides a multi-curve parallel drawing method, a device, equipment and a storage medium, wherein the method comprises the steps of obtaining curve data of a plurality of curves which need to be displayed in a graph, and respectively storing the curve data into a plurality of corresponding files; loading a plurality of files in parallel based on multiple threads; dividing the loaded files into a plurality of groups, and drawing curve data included in the corresponding file groups in parallel based on a plurality of drawing threads; and combining the drawing results obtained by parallel drawing to generate a chart comprising a plurality of curves. In the drawing process, the curve data is loaded and the curve data of a plurality of curves is drawn in a parallel mode based on a plurality of threads, so that a chart comprising the plurality of curves is generated, and therefore the plurality of curves can be generated efficiently.
It should be understood that the statements herein reciting aspects are not intended to limit the critical or essential features of any embodiment of the invention, nor are they intended to limit the scope of the invention. Other features of the present invention will become apparent from the following description.
Drawings
The above and other features, advantages and aspects of various embodiments of the present invention will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the principles of the invention:
fig. 1 is a schematic flow chart of a multi-curve parallel drawing method according to an embodiment of the present invention;
fig. 2 is a block diagram of a multi-curve parallel drawing apparatus according to an embodiment of the present invention;
fig. 3 is a block diagram of an exemplary electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be obtained by a person skilled in the art without any inventive step based on the embodiments of the present invention, are within the scope of the present invention.
In addition, the term "and/or" herein is only one kind of association relationship describing an associated object, and means that there may be three kinds of relationships, for example, a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
The curve plotting of the graph is the basic way to display statistical data. In most scenes, various curve drawing methods can be realized by various existing drawing libraries. However, in some special application scenarios, such as real-time rendering of tens of thousands of curves, none of the currently known rendering controls is satisfactory.
The main problems are that:
1) The occupied memory is large, and the used curves are stored in the memory, so that the used curves usually occupy a large memory especially when being loaded at a webpage end.
2) The drawing time is very long, and even if the EChats with good performance is used, the display time of 1 ten thousand curves is dozens of seconds after the configuration is carried out.
Therefore, when a large number of curves are drawn, the curve cannot be generated efficiently based on the conventional drawing method for drawing the control.
In order to solve the problem that the efficient curve generation cannot be realized in the existing drawing method based on the drawing control, the invention provides a multi-curve parallel drawing method, a device, equipment and a storage medium, wherein the method comprises the following steps: acquiring curve data of a plurality of curves to be displayed in a graph, and respectively storing the curve data into a plurality of corresponding files; loading a plurality of files in parallel based on multiple threads; dividing the loaded files into a plurality of groups, and drawing curve data included in the corresponding file groups in parallel based on a plurality of drawing threads; and combining the drawing results obtained by parallel drawing to generate a chart comprising a plurality of curves. In the above drawing process, the curve data is loaded and the curve data of the plurality of curves is drawn based on the plurality of threads in a parallel manner, and the graph including the plurality of curves is generated, so that the plurality of curves can be efficiently generated.
The technical solutions provided by the embodiments of the present invention are described below with reference to the accompanying drawings.
Fig. 1 is a schematic flow diagram of a multi-curve parallel drawing method according to an embodiment of the present invention, and as shown in fig. 1, the multi-curve parallel drawing method may include:
s101: curve data of a plurality of curves which need to be displayed in a chart are obtained, and the curve data are respectively stored into a plurality of corresponding files.
Specifically, the curve data may be stored using XML, JSON, or CSV, and when storing, a memory cache may be incorporated to increase the loading speed, and the curve data of each curve may include a series of coordinate data, such as coordinate data in the format of [ (x 1, y 1), (x 2, y 2),., (xn, yn) ].
Then, for the loading speed, the stored curve data may be subjected to a multi-thread parallel processing to secure the subsequent processing speed, i.e., to execute S102-S104.
S102: multiple files are loaded in parallel based on multiple threads.
In one embodiment, the file storing the curve data in S101 may be loaded into the sharable memory block in parallel using multiple threads.
In addition, when the plurality of files storing the curve data are loaded, in order to ensure the subsequent access speed, the present solution may further store the numerical values of different coordinate axes in the curve data into corresponding arrays, taking the two-dimensional coordinate system as an example, specifically, values of X-axis coordinates and Y-axis coordinates of two arrays of storage curves may be used for all curves, respectively, that is, one array stores values of X-axis coordinates of all curves, and the other array stores values of Y-axis coordinates of all curves, so as to increase the speed during access, change a cumbersome process in which the processor needs to find an object storing coordinates in a corresponding array when accessing each coordinate before, and then obtain the corresponding coordinates based on the object.
It should be further noted that the stored curve data may be stored using a unified list, each curve has a sequential number, and if the curves have m total numbers, the number is 1-m, so that the data can be quickly accessed through the numbers.
S103: and dividing the loaded files into a plurality of groups, and drawing curve data included in the corresponding file group in parallel based on a plurality of drawing threads.
In an embodiment, the curve data in each file may be divided into multiple groups according to the corresponding numbers and the number of the drawing threads, where it should be noted that the number of the divided groups may correspond to the number of the drawing threads one to one, that is, one file serves as one file group and corresponds to one drawing thread; one drawing thread may correspond to a plurality of file groups, and this is not limited herein.
The dividing the curve data in each file into multiple groups according to the corresponding numbers and the number of the drawing threads may specifically include:
if the number of the drawing threads is k, taking curve data with the number of j × k + s as a curve data group corresponding to the drawing thread s, wherein j is an integer greater than or equal to 0, the number of the divided groups is equal to the number of the drawing threads, for example, the threads are [ t1, t2,.. Gtk ], tk ], and t1 can access curve data with the number of [1, k +1, 2k +1,. Gtk ].
The curve data in each file may also be divided into groups larger or smaller than the number of the drawing threads according to the corresponding numbers and the number of the drawing threads.
In addition, in an embodiment, in the above S103, based on a plurality of drawing threads, the parallel drawing of the curve data included in the corresponding file group may specifically include:
each drawing thread loads corresponding initial picture parameters;
and changing the numerical value of the corresponding coordinate in the initial picture parameter based on the coordinate corresponding to the curve data stored in the file group corresponding to each drawing thread.
Further explaining the drawing process in S103, the drawing process may be performed by parallel block curve drawing, and the data drawing task is to draw a plurality of curves on the same long picture. The pictures are represented by a two-dimensional matrix, the size is width height, specific data are defined according to requirements, each point on the matrix is represented by an ARGB (auto-regressive moving average) text, and the default value is (-1, -1, -1, -1) to indicate that the picture is not drawn yet, namely the picture is an initial picture parameter. And then, during drawing, changing initial picture parameters according to coordinate data including coordinate values of an X axis and a Y axis in the curve data of each curve in the file group corresponding to each drawing thread, generating coordinate points in the initial picture, and then connecting every two continuous points to obtain a drawing result.
S104: and combining the drawing results obtained by parallel drawing to generate a chart comprising a plurality of curves.
In one embodiment, the drawing result is specifically picture data represented by a matrix; the process of generating a graph including a plurality of curves in S104 may specifically include:
summing the matrixes corresponding to the drawing results;
and generating a chart comprising a plurality of curves according to the summation result of each element in the matrix, wherein if the summation result of the element is greater than a threshold value, a preset threshold value is assigned to the element.
That is, since the rendering result is picture data expressed by a matrix, the sum calculation can be directly performed on the matrices in all the rendering results. After the calculation is completed, the result after summation is still the default value, and no processing is needed. Since the maximum value is (255,255,255,255), the upper limit value 255, i.e., the preset threshold value, may be used for the value exceeding the range.
It should be noted that the finally generated graph including the plurality of curves may be a picture in png format, or may be in jpg format, which is not limited herein.
In the multi-curve parallel drawing method provided by the invention, the curve data are loaded and drawn on the curve data of a plurality of curves in a parallel mode based on a plurality of threads in the drawing process to generate a chart comprising the plurality of curves, and the corresponding X-axis data and Y-axis data in the plurality of curves are respectively stored based on two arrays in the curve data storage process so as to facilitate the reading of subsequent data, so that the efficiency of generating a large number of curves can be improved.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are exemplary embodiments and that the acts and modules referred to are not necessarily required to practice the invention.
The above is a description of embodiments of the method, and the embodiments of the apparatus are described below to further illustrate the aspects of the present invention.
Corresponding to the flow diagram of the multi-curve parallel drawing method shown in fig. 1, fig. 2 shows a block diagram of a multi-curve parallel drawing apparatus 200. The drawing apparatus 200, as shown in fig. 2, may include:
the obtaining module 201 may be configured to obtain curve data of a plurality of curves that need to be displayed in a graph, and store the curve data in a plurality of corresponding files respectively;
a loading module 202, which may be configured to load multiple files in parallel based on multiple threads;
the drawing module 203 may be configured to divide the loaded multiple files into multiple groups, and perform parallel drawing on curve data included in the corresponding file group based on multiple drawing threads;
the graph generating module 204 may be configured to combine the drawing results obtained by the parallel drawing to generate a graph including a plurality of curves.
In one embodiment, each file stores a number corresponding to the curve data;
the drawing module 203 may be further configured to divide the curve data in each file into multiple groups according to the corresponding numbers and the number of drawing threads.
The drawing module 203 may be further configured to, when there are k drawing threads, use curve data numbered j × k + s as a curve data group corresponding to the drawing thread s, where j is an integer greater than or equal to 0, and the number of divided groups is equal to the number of drawing threads.
In an embodiment, the obtaining module 201 may be further configured to store values of different coordinate axes in the curve data into corresponding arrays.
In one embodiment, the rendering module 203 may be further configured to load corresponding initial picture parameters based on each rendering thread; and changing the numerical value of the corresponding coordinate in the initial picture parameter based on the coordinate corresponding to the curve data stored in the file group corresponding to each drawing thread.
In one embodiment, the rendering result is picture data represented by a matrix; the chart generation module 204 may be further configured to sum the matrices corresponding to the drawing results; and generating a chart comprising a plurality of curves according to the summation result of each element in the matrix, wherein if the summation result of the element is greater than a threshold value, a preset threshold value is assigned to the element.
The multi-curve parallel drawing device provided by the invention loads curve data and draws the curve data of a plurality of curves in a parallel mode based on a plurality of threads in the drawing process to generate a chart comprising the plurality of curves, and respectively stores corresponding X-axis data and Y-axis data in the plurality of curves based on two arrays in the curve data storage process so as to facilitate the reading of subsequent data, so that the efficiency of generating a large number of curves can be improved.
It can be understood that each module in the drawing apparatus shown in fig. 2 has a function of implementing each step in fig. 1, and can achieve the corresponding technical effect, and for brevity, no further description is provided herein.
It can be clearly understood by those skilled in the art that, for convenience and simplicity of description, the specific working process of the described module may refer to the corresponding process in the foregoing method embodiment, and details are not described herein again.
The invention also provides an electronic device, a readable storage medium and a computer program product according to the embodiments of the invention.
FIG. 3 shows a schematic block diagram of an electronic device 300 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
The device 300 comprises a computing unit 301 which may perform various suitable actions and processes according to a computer program stored in a Read Only Memory (ROM) 302 or a computer program loaded from a storage unit 308 into a Random Access Memory (RAM) 303. In the RAM303, various programs and data required for the operation of the device 300 can also be stored. The calculation unit 301, the ROM302, and the RAM303 are connected to each other via a bus 304. An input/output (I/O) interface 305 is also connected to bus 304.
Various components in device 300 are connected to I/O interface 305, including: an input unit 306 such as a keyboard, a mouse, or the like; an output unit 307 such as various types of displays, speakers, and the like; a storage unit 308 such as a magnetic disk, optical disk, or the like; and a communication unit 309 such as a network card, modem, wireless communication transceiver, etc. The communication unit 309 allows the device 300 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
The computing unit 301 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of the computing unit 301 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The calculation unit 301 executes the respective methods and processes described above, such as the multi-curve parallel rendering method in fig. 1. For example, in some embodiments, the multi-curve parallel rendering method of fig. 1 may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 308. In some embodiments, part or all of the computer program may be loaded and/or installed onto device 300 via ROM302 and/or communication unit 309. When the computer program is loaded into the RAM303 and executed by the computing unit 301, one or more steps of the multi-curve parallel rendering method described above may be performed. Alternatively, in other embodiments, the computing unit 301 may be configured to perform the multi-curve parallel rendering method of fig. 1 by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present invention may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, 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 compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user may provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can 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, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server with a combined blockchain.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved.
The above-described embodiments should not be construed as limiting the scope of the invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (9)

1. A multi-curve parallel drawing method is characterized by comprising the following steps:
curve data of a plurality of curves which need to be displayed in a chart are obtained, and the curve data are respectively stored into a plurality of corresponding files;
loading the plurality of files in parallel based on multiple threads;
dividing the loaded files into a plurality of groups, and drawing curve data included in the corresponding file groups in parallel based on a plurality of drawing threads;
merging drawing results obtained by parallel drawing to generate a chart comprising the multiple curves;
the drawing result is picture data represented by a matrix; the merging of the drawing results obtained by the parallel drawing to generate the graph comprising the curves comprises the following steps:
summing the matrixes corresponding to the drawing results;
and generating a chart comprising a plurality of curves according to the summation result of each element in the matrix, wherein if the summation result of the element is greater than a threshold value, a preset threshold value is assigned to the element.
2. The method according to claim 1, characterized in that each file stores therein a number corresponding to curve data;
the dividing the loaded files into multiple groups comprises:
and dividing the curve data in each file into a plurality of groups according to the corresponding serial numbers and the number of the drawing threads.
3. The method of claim 2, wherein dividing the curve data in each file into a plurality of groups according to the corresponding numbers and the number of drawing threads comprises:
and if the number of the drawing threads is k, taking curve data with the number of j x k + s as a curve data group corresponding to the drawing thread s, wherein j is an integer greater than or equal to 0, and the number of the divided groups is equal to the number of the drawing threads.
4. The method of claim 1, further comprising:
and storing the numerical values of different coordinate axes in the curve data into corresponding arrays.
5. The method according to claim 4, wherein the parallel drawing of curve data included in a corresponding file group based on a plurality of drawing threads comprises:
each drawing thread loads corresponding initial picture parameters;
and changing the numerical value of the corresponding coordinate in the initial picture parameter based on the coordinate corresponding to the curve data stored in the file group corresponding to each drawing thread.
6. A multi-curve parallel drawing apparatus, comprising:
the acquisition module is used for acquiring curve data of a plurality of curves which need to be displayed in a graph and respectively storing the curve data into a plurality of corresponding files;
a loading module for loading the plurality of files in parallel based on multiple threads;
the drawing module is used for dividing the loaded files into a plurality of groups and drawing curve data included in the corresponding file groups in parallel based on a plurality of drawing threads;
the chart generation module is used for merging drawing results obtained by parallel drawing to generate a chart comprising the curves;
the drawing result is picture data represented by a matrix; the chart generation module is specifically configured to:
summing the matrixes corresponding to the drawing results;
and generating a chart comprising a plurality of curves according to the summation result of each element in the matrix, wherein if the summation result of the element is greater than a threshold value, a preset threshold value is assigned to the element.
7. The apparatus of claim 6, wherein each file stores therein a number corresponding to the curve data;
and the drawing module is also used for dividing the curve data in each file into a plurality of groups according to the corresponding serial numbers and the number of the drawing threads.
8. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-5.
9. A non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the method according to any one of claims 1-5.
CN202211161597.9A 2022-09-23 2022-09-23 Multi-curve parallel drawing method, device, equipment and storage medium Active CN115272524B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211161597.9A CN115272524B (en) 2022-09-23 2022-09-23 Multi-curve parallel drawing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211161597.9A CN115272524B (en) 2022-09-23 2022-09-23 Multi-curve parallel drawing method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN115272524A CN115272524A (en) 2022-11-01
CN115272524B true CN115272524B (en) 2023-01-03

Family

ID=83757363

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211161597.9A Active CN115272524B (en) 2022-09-23 2022-09-23 Multi-curve parallel drawing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115272524B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108198231A (en) * 2017-12-11 2018-06-22 厦门亿力吉奥信息科技有限公司 Electric power GIS vector graphics real-time drawing method, storage medium
CN112614207A (en) * 2020-12-17 2021-04-06 航天宏图信息技术股份有限公司 Contour line drawing method, device and equipment
CN113360280A (en) * 2021-06-02 2021-09-07 西安中锐创联科技有限公司 Simulation curve display method based on multi-thread operation and dynamic global variable processing

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102446089A (en) * 2010-10-04 2012-05-09 王子影 Real-time data acquisition and waveform browse control technology using a plurality of earthquake precursor instruments
CN101982820B (en) * 2010-11-22 2011-12-07 北京航空航天大学 Curve display and inquiry method for large data quantity
CN104281438A (en) * 2013-07-01 2015-01-14 中国科学院沈阳自动化研究所 IC equipment multi-data source curve plotting system and design method thereof
CN104849755A (en) * 2015-05-04 2015-08-19 中国石油天然气集团公司 Parallel earthquake data rendering method
CN107818588B (en) * 2016-09-12 2021-12-28 深圳市鸿合创新信息技术有限责任公司 Device and method for calling Qt drawing based on JNI multithreading in Android system
KR102657587B1 (en) * 2016-11-21 2024-04-15 삼성전자주식회사 Method and apparatus for rendering a curve
CN108961356A (en) * 2018-07-09 2018-12-07 深圳市小牛在线互联网信息咨询有限公司 Curve drawing drawing method, device, computer equipment and storage medium
WO2021232294A1 (en) * 2020-05-20 2021-11-25 京东方科技集团股份有限公司 Handwriting drawing method and apparatus, electronic device, medium, and program product
CN111932656B (en) * 2020-07-29 2024-09-10 交控科技股份有限公司 Running chart information indexing method, device and equipment
CN113536050B (en) * 2021-07-06 2023-12-01 贵州电网有限责任公司 Distribution network monitoring system curve data query processing method
CN114782582A (en) * 2022-03-15 2022-07-22 上海仁静信息技术有限公司 Method for drawing curve in graph and related equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108198231A (en) * 2017-12-11 2018-06-22 厦门亿力吉奥信息科技有限公司 Electric power GIS vector graphics real-time drawing method, storage medium
CN112614207A (en) * 2020-12-17 2021-04-06 航天宏图信息技术股份有限公司 Contour line drawing method, device and equipment
CN113360280A (en) * 2021-06-02 2021-09-07 西安中锐创联科技有限公司 Simulation curve display method based on multi-thread operation and dynamic global variable processing

Also Published As

Publication number Publication date
CN115272524A (en) 2022-11-01

Similar Documents

Publication Publication Date Title
CN113808231B (en) Information processing method and device, image rendering method and device, and electronic device
CN112488060B (en) Target detection method, device, equipment and medium
CN114792355B (en) Virtual image generation method and device, electronic equipment and storage medium
CN114092675A (en) Image display method, image display device, electronic apparatus, and storage medium
CN112634406A (en) Method, device, electronic equipment, storage medium and program product for generating picture
CN114092708A (en) Characteristic image processing method and device and storage medium
CN113360266A (en) Task processing method and device
CN113344213A (en) Knowledge distillation method, knowledge distillation device, electronic equipment and computer readable storage medium
CN115272524B (en) Multi-curve parallel drawing method, device, equipment and storage medium
CN114882313B (en) Method, device, electronic equipment and storage medium for generating image annotation information
CN115861510A (en) Object rendering method, device, electronic equipment, storage medium and program product
CN115904240A (en) Data processing method and device, electronic equipment and storage medium
CN111222302A (en) Webpage rendering control method, control device and computer readable medium
CN114386577A (en) Method, apparatus, and storage medium for executing deep learning model
CN115438007A (en) File merging method and device, electronic equipment and medium
CN114596196A (en) Method and device for filtering point cloud data, equipment and storage medium
CN113377295A (en) Data storage and reading method, device and equipment for multi-producer single-consumer
CN113556575A (en) Method, apparatus, device, medium and product for compressing data
CN113362438A (en) Panorama rendering method, device, electronic apparatus, medium, and program
CN113657408A (en) Method and device for determining image characteristics, electronic equipment and storage medium
JP7391127B2 (en) Point cloud data processing method, apparatus, electronic device, storage medium, and program
CN115037937B (en) Image compression method, apparatus, device and medium
CN115118989B (en) Image compression method and device
CN113342413B (en) Method, apparatus, device, medium, and article for processing components
CN112653885B (en) Video repetition degree acquisition method, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant