A graphics generation method and system based on binary data transmission
In the application scenarios of analysis and detection equipment, the server-side based on compiled languages and the client of interpreted languages are adopted, and binary data transmission and sparse sampling technology are used to solve the problem of poor performance in the client processing of high-frequency data, achieving more efficient graphics generation and processing, and improving user experience.
Patent Information
- Application Number
- CN202111652718.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-31
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2041-12-31
AI Technical Summary
In the application scenarios of analysis and detection equipment such as quantum measurement and control equipment, the client has poor performance in processing high-frequency data and drawing, resulting in problems such as data accumulation and delay in drawing, affecting the user experience.
The server based on the compiled language transmits the drawing data in binary form to the client based on the interpreted language. The client generates a specific array and interprets the binary data to generate the graph. The server reduces the amount of data through sparse sampling and adjusts the sampling rate according to the graphic display range.
Improves the performance of client processing data and drawing, solves the problem of lag-down delay in drawing, improves user experience, and optimizes the use of memory and processor resources.
Smart Images

Figure CN114332279B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of transmission, storage and application of device control information and output information, and in particular to a method and system for generating graphics based on binary data transmission. Background Art
[0002] In practical applications, various analytical detection equipment such as quantum measurement and control equipment, single-spin spectrometers, and electron paramagnetic resonance spectrometers need to transmit the measurement data obtained from the detection and its corresponding conditions or time information to the client in real time. The client generates dynamic graphics to intuitively display the real-time detection signals, so that users can quickly obtain the detection process information and analyze and obtain reference information as needed.
[0003] Based on the above needs, the usual implementation scheme is: a large amount of data collected and generated by the lower computer is processed by the server implemented in C++ to form data in JSON string format, and then transmitted to the client; the client encapsulates the obtained data into JSON Array format, and then calls the ECharts drawing API instruction to update the chart data, and finally realizes dynamic drawing. The above conventional technical scheme has the following shortcomings:
[0004] In the above application scenarios, the frequency of data uploaded from the lower computer and the server to the client is as high as 50 Hz, and the data volume can reach 24 MB per second. The client's performance in processing data and drawing is poor, resulting in problems such as data accumulation and drawing delays. The client in the above application scenarios is generally implemented based on JavaScript technology, and JavaScript itself is single-threaded. High-frequency data calculation and drawing processing cause the mouse and keyboard events to fail to respond when acting on the client, resulting in a poor user experience. Summary of the invention
[0005] The present invention provides a method and system for generating graphics based on binary data transmission, which can at least partially solve the technical problems raised by the background technology to a certain extent.
[0006] The present invention provides a graphics generation method based on binary data transmission, comprising: a server implemented based on a compiled language transmits drawing data to a client implemented based on an interpreted language, the client generates a specific array according to the drawing data, and reads the specific array to generate graphics; the specific array includes a block 1 composed of binary data, and a block 2 that interprets the binary data in the block 1.
[0007] As a further improvement, optimization or refinement of the above technical solution, it also includes: the server obtains the drawing data by sparse sampling from the original data, and the sparse sampling method is:
[0008] Extract data at fixed step intervals, or
[0009] Extract data within a fixed step according to the rules, or
[0010] Fixed point data are extracted according to the dimensionality reduction algorithm.
[0011] As a further improvement, optimization or refinement of the above technical solution, when the display range of the generated graphics is adjusted, the server adjusts the sampling rate of the sparse sampling accordingly.
[0012] As a further improvement, optimization or refinement of the above technical solution, the generated graph includes an extended coordinate axis for indicating a display range, the block 2 includes a specific string corresponding to the coordinate information on the extended coordinate axis, and the block 1 includes a specific byte stream corresponding to the specific string;
[0013] The sparse sampling method extracts data at fixed step intervals; when the display range of the generated graphics is adjusted, the zoom range is determined, and the adjusted fixed step of the sparse sampling is determined based on the zoom range and the specific byte stream.
[0014] As a further improvement, optimization or refinement of the above technical solution, the method for determining the scaling amplitude is:
[0015] Obtaining the coordinate difference of the specific character string corresponding to both ends of the extended coordinate axis before the display range of the generated graphic is adjusted,
[0016] After the display range of the generated graphic is adjusted, the coordinate difference between the two ends of the extended coordinate axis corresponding to the specific character string is obtained.
[0017] The ratio between the coordinate difference value 1 and the coordinate difference value 2 is calculated to be the scaling amplitude.
[0018] As a further improvement, optimization or refinement of the above technical solution, the method for determining the adjusted fixed step of the sparse sampling according to the scaling amplitude and the specific byte stream is:
[0019] Obtaining the byte difference between adjacent specific byte streams before the display range of the generated graphics is adjusted,
[0020] The byte difference value 1 is scaled according to the scaling amplitude to obtain the byte difference value 2 by calculation,
[0021] The byte difference of two is the fixed step of the sparse sampling after the display range of the generated graphics is adjusted.
[0022] As a further improvement, optimization or refinement of the above technical solution, the original data includes quantized value data and corresponding information data corresponding to the quantized value data; and the sparse sampling method is:
[0023] Data is extracted at fixed step intervals, or maximum and minimum data determined within a step based on the quantized value data are extracted at fixed steps, or fixed point data is extracted according to a dimensionality reduction algorithm.
[0024] As a further improvement, optimization or refinement of the above technical solution, the corresponding information data includes corresponding time data, and the dimensionality reduction algorithm is a LTTB time series dimensionality reduction algorithm.
[0025] As a further improvement, optimization or refinement of the above technical solution, the server stores the drawing data in a memory, and the client reads the data in the memory according to fixed bytes based on a communication protocol to generate the specific array.
[0026] The present invention also provides a graphics generation system based on binary data transmission, comprising: a server implemented based on a compiled language and used to provide drawing data and a client implemented based on an interpreted language, the client comprising an array generation module that generates a specific array based on the drawing data, and a graphics generation module that reads the specific array to generate graphics; the specific array comprises block one composed of binary data, and block two that interprets the binary data in block one.
[0027] As a further improvement, optimization or refinement of the above technical solution, it also includes a lower computer for obtaining signals and generating signal data, and the server includes a signal parsing module for parsing the signal data into original data.
[0028] As a further improvement, optimization or refinement of the above technical solution, the server also includes a data sampling module for obtaining the drawing data by sparse sampling from the original data.
[0029] As a further improvement, optimization or refinement of the above technical solution, the client further includes a sampling control module, and the sampling control module is used to determine the sampling rate of the sparse sampling after adjustment according to the adjustment range of the generated graphic display range.
[0030] As a further improvement, optimization or refinement of the above technical solution, the generated graph includes an extended coordinate axis for indicating the display range, the block 2 includes a specific string corresponding to the coordinate information on the extended coordinate axis, and the block 1 includes a specific byte stream corresponding to the specific string; the sparse sampling method is to extract data at a fixed step interval;
[0031] The sampling control module is used to determine the zoom amplitude when the display range of the generated graphics is adjusted, and determine the adjusted fixed step of the sparse sampling according to the zoom amplitude and the specific byte stream.
[0032] The present invention also provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement a graphics generation method based on binary data transmission as described above and its subsequent improvements.
[0033] The present invention also provides a non-temporary computer-readable storage medium having a computer program stored thereon, the program being executed by a processor to implement a graphics generation method based on binary data transmission as described above and subsequent improvements thereof.
[0034] Compared with the prior art, the beneficial effects of the present invention are:
[0035] The data communication between the server and the client, and between the client and the graphics card is all binary. When the server and the client based on the traditional text format transmit data to the graphics card, the script has to perform multiple format conversions, which results in a large processing workload and low efficiency. The present invention provides a graphics generation method and system based on binary data transmission, which can directly operate bytes and send data to the graphics card intact in binary form, thereby greatly improving the performance of the script. In addition, by enabling the client to perform binary communication with the native interface of the operating system and directly operating the memory, the ability to process binary data during the graphics generation process is also greatly enhanced. This is conducive to improving the client's performance in processing data and drawing, solving the problem of drawing freezes and delays, and thus improving the user experience.
[0036] Based on the above solution, through further improvement, the server can achieve sparse sampling of the original data, and when the user zooms in or out of the generated graphics on the client, the server can adjust the sampling rate accordingly, and dynamically adjust the amount of data transmitted from the server to the client as needed, thereby avoiding unnecessary waste of memory and processor resources and avoiding data accumulation. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The following are drawings provided based on the content of the invention and / or the specific implementation methods of the invention, which are used to help ordinary technicians in this technical field better understand the content of the invention and / or the specific implementation methods of the invention; the drawings of the present invention are intended to be used to explain the present invention and cannot be understood as limiting the present invention.
[0038] Figure 1It is a flowchart of a method for generating graphics based on binary data transmission according to the present invention;
[0039] Figure 2 It is a structural schematic diagram of a graphics generation system based on binary data transmission described in the present invention. DETAILED DESCRIPTION
[0040] In order to facilitate ordinary technicians in this technical field to clearly understand the technical features of the present invention, the technical problems it solves and the technical effects it achieves, the technical solution and / or its implementation process of the present invention are explained below through specific embodiments in combination with the accompanying drawings; the specific implementation methods of the present invention are intended to be used to explain the present invention and cannot be understood as limiting the present invention.
[0041] refer to Figure 1 The present embodiment provides a method for generating graphics based on binary data transmission, including:
[0042] S1: The lower computer obtains the signal to generate signal data.
[0043] The lower computer specifically refers to various types of analysis and detection equipment such as quantum measurement and control equipment, single-spin spectrometers, electron paramagnetic resonance spectrometers, etc. It can also be an intermediate device that can provide signals collected by the above-mentioned analysis and detection equipment, or it can be a device component in the above-mentioned analysis and detection equipment or intermediate equipment that can provide collected signals, or it can even be a signal generating device that directly generates signals, and its intermediate equipment or device components, such as an arbitrary waveform generator, an arbitrary sequence generator, and a phase-locked amplifier.
[0044] S2: The server implemented based on a compiled language parses the signal data into original data; and the original data includes quantized value data and corresponding information data corresponding to the quantized value data.
[0045] It is not difficult for ordinary technicians in this technical field to understand that under normal circumstances, the server side is the background, which is mainly a hardware-oriented system implementation component with object-oriented characteristics. The server side "based on compiled language implementation" means that it is implemented based on programming in compiled languages such as C language, C++, Golang, Pascal, assembly, etc., and "based on compiled language implementation server side" should also include the situation where the server side is implemented based on semi-compiled and semi-interpreted language programming such as Java and C#.
[0046] The corresponding information data specifically refers to one or more of the data including conditional parameter information corresponding to the quantized value data, such as corresponding time data, corresponding frequency data, and corresponding magnetic field data.
[0047] S3: The server obtains drawing data by sparse sampling from the original data.
[0048] The sparse sampling method is:
[0049] Extract data at fixed step intervals, or
[0050] Extract data within a fixed step according to the rules, or
[0051] Fixed point data are extracted according to the dimensionality reduction algorithm.
[0052] "Extracting data at fixed step intervals" means extracting a group of data at certain step intervals, and "Extracting data within fixed steps according to rules" means dividing the units according to fixed steps, and selecting data within each unit according to predetermined methods and rules.
[0053] Specifically, when the original data includes quantized value data, the preferred sparse sampling method is:
[0054] Extract data at fixed step intervals, or
[0055] Extracting the maximum and minimum value data determined based on the quantized value data within the step at a fixed step, or
[0056] Fixed point data are extracted according to the dimensionality reduction algorithm.
[0057] More specifically, when the corresponding information data includes corresponding time data, preferably, the dimensionality reduction algorithm is a LTTB time series dimensionality reduction algorithm.
[0058] S4: The server transmits the drawing data to a client implemented based on an interpreted language.
[0059] It is not difficult for ordinary technicians in this technical field to understand that, under normal circumstances, the client is the front end, which is mainly an application-oriented system implementation component with object-based characteristics. The client "based on interpreted language implementation" means that it is implemented based on programming in interpreted languages such as Python, JavaScript, PHP, Shell, MATLAB, etc., and "client based on interpreted language implementation" should also include the case where semi-compiled and semi-interpreted languages such as Java and C# are used as interpreted languages to implement the client.
[0060] S5: The client generates a specific array according to the drawing data, wherein the specific array includes a block 1 composed of binary data and a block 2 for interpreting the binary data in the block 1.
[0061] The server stores the drawing data in a memory, and the client reads the data in the memory according to fixed bytes based on the communication protocol to generate the specific array. "Interpreting the binary data in block 1" means converting the binary data into corresponding actual values or other actual expressions according to the communication protocol and other established rules.
[0062] In conventional technical solutions, the data format generated by the client based on the drawing data only includes the content in block two. In the subsequent graphics generation step, some graphic elements directly use the content in block two, such as the display values, coordinate values, etc. in the spectrum. Some graphic elements also need to convert the content of block two into binary data in block one before they can be used, such as curves, scattered points, etc. in the spectrum.
[0063] The present embodiment directly provides the block one consisting of binary data and the block two for interpreting the binary data in the block one, thereby reducing the amount of data processing for subsequent graphics generation and improving the efficiency of subsequent graphics generation, thereby improving the user experience of the client.
[0064] S6: The client reads the specific array to generate a graph.
[0065] Specifically, when the client is implemented based on JavaScript, the client generates graphics by calling ECharts according to the specific array. Specifically, graphics drawing is a management mechanism of the MVC framework, which controls data changes through events, and then calls Painter to control the life cycle of the canvas element, thereby completing view rendering and generating graphics.
[0066] In most cases, the client is implemented based on JavaScript, so this embodiment provides the most universal implementation plan, which can be directly applied to solve practical problems; as an ordinary technician in this technical field, based on the content disclosed in this embodiment, it is not difficult to know that other programming languages and their corresponding functional modules or components can be used to achieve the above functions and technical effects.
[0067] S7: When the display range of the generated graphics is adjusted, the server adjusts the sampling rate of the sparse sampling accordingly.
[0068] "The display range of the generated graphics is adjusted" specifically means that the user zooms in or out of the generated graphics on the client to observe the generated graphics partially or as a whole; it can also be that the client automatically zooms in or out of the generated graphics to better display the generated graphics to the user; it is not difficult for ordinary technicians in this technical field to understand: when the user zooms out the graphics on the client, the sampling rate of the server should be increased, that is, more data should be extracted from the original data within the unit parameter; when the user zooms in the graphics on the client, the sampling rate of the server can be reduced, that is, less data should be extracted from the original data within the unit parameter.
[0069] The unit parameter depends on the specific composition of the original data. For example, the original data may be the magnetic field intensity corresponding to time, or the magnetic field intensity corresponding to microwave frequency, or the fluorescence intensity corresponding to the magnetic field intensity. Then the unit parameter corresponds to unit time, or unit frequency, or unit field strength.
[0070] In some specific application scenarios, step S7 can be implemented more efficiently based on the specific array:
[0071] For example, in a specific scenario: the generated graph includes an extended coordinate axis for indicating a display range, the block 2 includes a specific string corresponding to the coordinate information on the extended coordinate axis, and the block 1 includes a specific byte stream corresponding to the specific string; and the sparse sampling method extracts data at a fixed step interval;
[0072] When the display range of the generated graphics is adjusted, the zoom amplitude may be determined first, and then the adjusted fixed step of the sparse sampling may be determined according to the zoom amplitude and the specific byte stream.
[0073] The extended coordinate axis can be specifically a time axis, and the display range of the generated graph can be determined according to the coordinate range displayed on the time axis, and at this time, the specific character string is the text character corresponding to the time information, and the specific byte stream is the binary byte representing the generation or display order. The extended coordinate axis can also be specifically a magnetic field intensity axis in a field sweep diagram, or a frequency axis in a frequency sweep diagram, etc.
[0074] Specifically, the method for determining the scaling amplitude may be:
[0075] S711: obtaining a coordinate difference of the specific character string corresponding to both ends of the extended coordinate axis before the display range of the generated graphic is adjusted;
[0076] S712: obtaining a coordinate difference value 2 of the specific character string corresponding to both ends of the extended coordinate axis after the display range of the generated graphic is adjusted;
[0077] S713: Calculate the ratio between the coordinate difference value 1 and the coordinate difference value 2, which is the scaling amplitude.
[0078] It is not difficult for a person skilled in the art to understand that the "two ends of the extended coordinate axis" mentioned above refers to the two ends of the extended coordinate axis in the real-time display range of the generated graphics. Take the user adjusting the display range of the generated graphics as an example: the real-time display range of the generated graphics is the display range of the generated graphics before adjustment, and the coordinate spacing between the two ends of the extended coordinate axis within the range is the coordinate difference value 1; the range selected by the user is the display range of the generated graphics after adjustment, and the coordinate spacing between the two ends of the extended coordinate axis within the range is the coordinate difference value 2.
[0079] Of course, in a more complicated way, you can first obtain the specific character strings corresponding to the two ends of the extended coordinate axis, and then find the corresponding specific byte stream based on the obtained specific character strings, calculate the coordinate byte difference based on the found specific byte stream, and determine the scaling amplitude based on the coordinate byte difference before and after the display range of the generated graphic is adjusted.
[0080] It is not difficult for a person skilled in the art to understand that the specific byte streams in the original data are usually arranged in sequence, for example:
[0081] The byte stream in the original data that can correspond to the specific string is:
[0082] 0000000000000001, 0000000000000010, 00000000000000011…;
[0083] After sampling the data at a fixed step interval of 100, the drawing data and the specific byte stream in the specific array are:
[0084] 0000000000000001, 0000000001100101, 0000000011001001….
[0085] Therefore, the method for determining the adjusted fixed step of the sparse sampling according to the scaling amplitude and the specific byte stream may be:
[0086] S721: obtaining a byte difference of one between adjacent specific byte streams before the display range of the generated graphic is adjusted;
[0087] S722: Scale the byte difference value 1 according to the scaling amplitude to obtain a byte difference value 2 by calculation;
[0088] S723: The byte difference value 2 is the fixed step of the sparse sampling after the display range of the generated graphics is adjusted.
[0089] The graphics generation method based on binary data transmission provided in this embodiment can be considered as a working method or process based on hardware or firmware, can be considered as executable instruction content for realizing logical functions, can be considered as data for the operation of the instruction execution system in any temporary readable storage medium, can also be considered as the working process of any instruction execution system, and can also be considered as data stored in a non-temporary readable storage medium. The instruction execution system can be a computer-based system or other system that can read and execute instructions.
[0090] The present embodiment provides a method for generating graphics based on binary data transmission, each step of which can be implemented by hardware, software, firmware or a combination thereof. For example, each step can be stored in a memory as an independent software or a part of the software running, and executed by firmware running a suitable instruction execution system; it can also be partially or fully implemented by a combination of one or more of the following well-known technologies: logic circuit, application-specific integrated circuit, programmable gate array (PGA), field programmable gate array (FPGA), etc.
[0091] refer to Figure 2 The present embodiment provides a graphics generation system based on binary data transmission, including:
[0092] A lower computer used to obtain signals and generate signal data,
[0093] A server based on a compiled language and used to provide drawing data.
[0094] And clients implemented in interpreted languages.
[0095] The server includes:
[0096] A signal parsing module for parsing the signal data into original data,
[0097] and a data sampling module for obtaining the drawing data by sparse sampling from the original data.
[0098] The client comprises:
[0099] an array generation module for generating a specific array according to the drawing data,
[0100] a graphics generation module that reads the specific array to generate a graphics,
[0101] and a sampling control module, the sampling control module being used to determine the sampling rate of the sparse sampling after adjustment according to the adjustment amplitude of the generated graphic display range;
[0102] The specific array includes a block 1 composed of binary data and a block 2 for interpreting the binary data in the block 1.
[0103] In specific scenarios:
[0104] The generated graphics include an extended coordinate axis for indicating a display range, the block two includes a specific character string corresponding to the coordinate information on the extended coordinate axis, and the block one includes a specific byte stream corresponding to the specific character string; the sparse sampling method is to extract data at a fixed step interval or to extract data within a fixed step according to a rule.
[0105] Then: the sampling control module is used to determine the zoom amplitude when the display range of the generated graphics is adjusted, and determine the adjusted fixed step of the sparse sampling according to the zoom amplitude and the specific byte stream.
[0106] The modules mentioned in this embodiment actually refer to function division units, and are not limited to hardware function implementation units, software function implementation units and firmware function implementation units with fixed structures and / or connections; therefore, the above modules, for hardware, software or firmware function implementation units, can be composed of part of N1 hardware function implementation units, and all of N2 hardware function implementation units, and part of N3 software function implementation units, and all of N4 software function implementation units, and part of N5 firmware function implementation units, and all of N6 firmware function implementation units; the above N1, N2, N3, N4, N5 and N6 are all natural numbers, and N1+N2+N3+N4+N5+N6≥1.
[0107] Each module mentioned in this embodiment may be independently implemented by any one or more combinations of software, hardware and firmware, or may be implemented by any one or more combinations of software, hardware and firmware in multiple combinations, or may be implemented by any one or more combinations of software, hardware and firmware in a divided manner; each module may not only be in an executable environment, but may also be stored in a computer-readable storage medium, and the computer-readable storage medium may be a temporary computer-readable storage medium or a non-temporary computer-readable storage medium; between any two modules, when implemented, the structures may be parallel to each other, the structures may be crossed with each other, or the structures may be inclusion relationships.
[0108] It is not difficult for ordinary technicians in this technical field to understand that the graphics generation system based on binary data transmission provided in this embodiment is actually an implementation of graphics generation based on binary data transmission provided for this embodiment, and provides a specific optimized method to implement product solutions and product function allocation solutions. Therefore, the explanation of graphics generation based on binary data transmission is also applicable to a graphics generation system based on binary data transmission.
[0109] Some or all of the steps included in the implementation of a graphic generation method based on binary data transmission provided in the above embodiment can be completed by an electronic device. Based on this, this embodiment also provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor. The processor executes the program to implement some or all of the steps of a graphic generation method based on binary data transmission described in the above embodiment, as well as the recombination of some steps in a manner that is easily conceivable to ordinary technicians in this technical field.
[0110] In addition, it is not difficult for ordinary technicians in this technical field to understand that some or all of the steps included in implementing a graphics generation method based on binary data transmission provided by the above embodiment can be stored on a non-temporary computer-readable storage medium and then executed by a processor. Based on this, this embodiment also provides a non-temporary computer-readable storage medium on which a computer program is stored. The program is executed by a processor to implement some or all of the steps of a graphics generation method based on binary data transmission described in the above embodiment, as well as the recombination of some steps in a way that is easily conceivable to ordinary technicians in this technical field.
[0111] The non-temporary computer-readable storage medium described in this embodiment includes but is not limited to one or a combination of the following devices: a drum memory, a tape memory, a disk memory, an optical disk memory and a semiconductor memory; the semiconductor memory may specifically be a read-only memory (ROM), or a programmable read-only memory (PROM), or an erasable programmable read-only memory (EPROM), or a one-time programmable read-only memory (OPTROM), or an electrically erasable programmable read-only memory (EEPROM), or a flash memory (Flash memory), or a nitride read-only memory (NROM), etc.
[0112] The preferred embodiments of the present invention are specifically described above. Of course, the present invention can also take forms different from the above-mentioned embodiments. Equivalent changes or corresponding modifications made by technicians familiar with the field without violating the concept of the present invention should fall within the scope of protection of the present invention.
Claims
1. A graphics generation method based on binary data transmission, characterized in that: include: The server implemented in a compiled language transmits the drawing data to the client implemented in an interpreted language. The client generates a specific array according to the drawing data, and Reading the specific array to generate a graph; The specific array includes a block 1 composed of binary data, and a block 2 for interpreting the binary data in the block 1; the server obtains the drawing data by sparse sampling from the original data; When the display range of the generated graph is adjusted, the server adjusts the sampling rate of the sparse sampling accordingly; The generated graph includes an extended coordinate axis for indicating a display range, the block 2 includes a specific string corresponding to coordinate information on the extended coordinate axis, and the block 1 includes a specific byte stream corresponding to the specific string; The sparse sampling method extracts data at fixed step intervals; when the display range of the generated graph is adjusted, the scaling amplitude is determined, and: Obtaining the byte difference between adjacent specific byte streams before the display range of the generated graphics is adjusted, The byte difference value 1 is scaled according to the scaling amplitude to obtain the byte difference value 2 by calculation, The byte difference of two is the fixed step of the sparse sampling after the display range of the generated graphics is adjusted.
2. A method for generating graphics based on binary data transmission according to claim 1, characterized in that: The method for determining the scaling amplitude is: Obtaining the coordinate difference of the specific character string corresponding to both ends of the extended coordinate axis before the display range of the generated graphic is adjusted, After the display range of the generated graphic is adjusted, the coordinate difference between the two ends of the extended coordinate axis corresponding to the specific character string is obtained. The ratio between the coordinate difference value 1 and the coordinate difference value 2 is calculated to be the scaling amplitude.
3. A method for generating graphics based on binary data transmission according to claim 1, characterized in that: The server stores the drawing data in a memory, and the client reads the data in the memory according to fixed bytes based on a communication protocol to generate the specific array.
4. A graphics generation system based on binary data transmission, characterized in that: include: A server implemented in a compiled language and used to provide drawing data. A client implemented in an interpreted language. The client comprises an array generation module for generating a specific array according to the drawing data, and A graphics generation module that reads the specific array to generate a graphics; The specific array includes a block 1 composed of binary data, and a block 2 for interpreting the binary data in the block 1; It also includes a lower computer for obtaining a signal and generating signal data, and the server includes a signal parsing module for parsing the signal data into raw data; The server also includes a data sampling module for obtaining the drawing data by sparse sampling from the original data; The client further includes a sampling control module, and the sampling control module is used to determine the sampling rate of the sparse sampling after adjustment according to the adjustment range of the generated graphic display range; The generated graph includes an extended coordinate axis for indicating a display range, the block 2 includes a specific string corresponding to coordinate information on the extended coordinate axis, and the block 1 includes a specific byte stream corresponding to the specific string; the sparse sampling method is to extract data at a fixed step interval; The sampling control module is used to determine the zoom range when the display range of the generated graphics is adjusted, and: Obtaining the byte difference between adjacent specific byte streams before the display range of the generated graphics is adjusted, The byte difference value 1 is scaled according to the scaling amplitude to obtain the byte difference value 2 by calculation, The byte difference of two is the fixed step of the sparse sampling after the display range of the generated graphics is adjusted.
5. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement a graphics generation method based on binary data transmission as described in any one of claims 1 to 3.
6. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: The program is executed by a processor to implement a graphics generation method based on binary data transmission as described in any one of claims 1 to 3.
Citation Information
Patent Citations
Data transmission method based on C / S architecture browser and server
CN101860533A
WebGIS (Web Geographic Information System) vector data high-efficiency transmission method
CN104899311A