CN112669213A - Real-time market situation map dynamic updating method and device, electronic equipment and storage medium - Google Patents

Real-time market situation map dynamic updating method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN112669213A
CN112669213A CN202011642730.3A CN202011642730A CN112669213A CN 112669213 A CN112669213 A CN 112669213A CN 202011642730 A CN202011642730 A CN 202011642730A CN 112669213 A CN112669213 A CN 112669213A
Authority
CN
China
Prior art keywords
time
market
real
request
data
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.)
Pending
Application number
CN202011642730.3A
Other languages
Chinese (zh)
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.)
Ping An Securities Co Ltd
Original Assignee
Ping An Securities 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 Ping An Securities Co Ltd filed Critical Ping An Securities Co Ltd
Priority to CN202011642730.3A priority Critical patent/CN112669213A/en
Publication of CN112669213A publication Critical patent/CN112669213A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

The invention relates to a data processing technology, and discloses a real-time market quotation dynamic updating method, which comprises the following steps: the method comprises the steps that a client side obtains a request timestamp, generates a real-time market transmission request according to the request timestamp, sends the real-time market transmission request to a server side, the server side receives the real-time market transmission request and records data receiving time, obtains real-time market data generated between the request timestamp and the data receiving time, obtains a request judgment result according to the data receiving time, sends the real-time market data, the data receiving time and the request judgment result to the client side, the client side generates an incremental market diagram according to the real-time market data, and the incremental market diagram is spliced with a current market diagram to generate a real-time market diagram. In addition, the invention also relates to a block chain technology, and the real-time market situation graph can be stored in the nodes in the block chain. The invention can solve the problem of excessive redundant data of the picture.

Description

Real-time market situation map dynamic updating method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a method and an apparatus for dynamically updating a real-time market chart, and a computer-readable storage medium.
Background
The real-time market chart is used for displaying a data dynamic change chart changing along with the development of time, and has wide application in the fields of securities and the like. The real-time market chart (hereinafter referred to as market chart) is characterized in that the picture needs to be updated every fixed time in the transaction time. The following methods are commonly adopted in the industry for showing and updating market situation diagrams: when the pictures need to be updated, the client sends a request to the server, and after the server draws the incremental market map on the basis of the original market map, the server returns a complete market map which is drawn according to the historical data, the incremental data and the future empty data to the client.
The updating mode based on the real-time market situation map has the following defects: the redundant data of the pictures is too much, so that a great amount of waste is caused to the flow of users and companies, the response speed of the page is reduced under the condition that the bandwidth is limited, and the user experience is reduced.
Disclosure of Invention
The invention provides a method and a device for dynamically updating a real-time market quotation map and a computer readable storage medium, and mainly aims to solve the problem of excessive redundant data of pictures.
In order to achieve the above object, the present invention provides a method for dynamically updating a real-time market chart applied to a client, including:
acquiring a request timestamp, generating a real-time market transmission request according to the request timestamp, sending the real-time market transmission request to a server, and recording request sending time;
receiving data fed back by the server based on the real-time market transmission request, and acquiring real-time market data, data receiving time and a request judgment result from the fed-back data;
generating an incremental market quotation map according to the real-time market quotation data, and splicing the incremental market quotation map with the current market quotation map to generate a real-time market quotation map;
and when the request judgment result is a first preset value, updating the request timestamp by using the data receiving time, and repeatedly executing the steps when the time difference between the current time and the request sending time reaches a preset time threshold value to dynamically update the real-time market situation map.
Optionally, the splicing the incremental market chart and the current market chart includes:
extracting printable characters of the incremental market chart to obtain the printable characters of the incremental market chart, and storing the printable characters of the incremental market chart;
extracting printable characters of a current market situation graph to obtain printable characters of the current market situation, and storing the printable characters of the current market situation;
and splicing the incremental market printable characters and the current market printable characters to obtain a real-time market chart.
Optionally, the obtaining of the real-time market chart by splicing the incremental market printable characters and the current market printable characters includes:
declaring an original image I in a canvas rendering environment, extracting current market printable characters, and setting the current market printable characters as a reference path of the original image I to obtain a standard image I;
generating a real-time market canvas by utilizing the canvas rendering environment, and drawing the standard image I to the real-time market canvas;
declaring a second original image in the canvas rendering environment, extracting the incremental market printable characters, and setting the incremental market printable characters as a reference path of the second original image to obtain a second standard image;
drawing the standard image II onto the real-time market canvas;
and splicing the first standard image and the second standard image through a function to obtain the real-time market situation map.
In order to achieve the above object, the present invention provides a method for dynamically updating a real-time market chart applied to a server, comprising:
receiving a real-time market transmission request sent by a client, recording the time for receiving the real-time market transmission request, generating data receiving time, and acquiring a request timestamp in the real-time market transmission request;
acquiring real-time market data generated between the request timestamp and the data receiving time, and obtaining a request judgment result according to the data receiving time;
and sending the real-time market data, the data receiving time and the request judgment result to the client.
Optionally, the obtaining a request judgment result according to the data receiving time includes:
if the data receiving time is within a preset time range, setting the request judgment result as a first preset value;
and if the data receiving time is not within the preset time range, setting the request judgment result as a second preset value.
In order to solve the above problem, the present invention further provides a device for dynamically updating a real-time market chart applied to a client, where the device includes:
the request updating module is used for acquiring a request timestamp, generating a real-time market transmission request according to the request timestamp, sending the real-time market transmission request to a server and recording request sending time;
the data receiving module is used for receiving data fed back by the server based on the real-time market transmission request, and acquiring real-time market data, data receiving time and a request judgment result from the fed-back data;
the splicing generation module is used for generating an incremental market quotation map according to the real-time market quotation data, splicing the incremental market quotation map with the current market quotation map and generating a real-time market quotation map;
and the polling request module is used for updating the request timestamp by using the data receiving time when the request judgment result is a first preset value, and repeatedly executing the steps when the time difference between the current time and the request sending time reaches a preset time threshold value to dynamically update the real-time market quotation map.
Optionally, the splicing generation module obtains the real-time market chart by:
extracting printable characters of the incremental market chart to obtain the printable characters of the incremental market chart, and storing the printable characters of the incremental market chart;
extracting printable characters of a current market situation graph to obtain printable characters of the current market situation, and storing the printable characters of the current market situation;
and splicing the incremental market printable characters and the current market printable characters to obtain a real-time market chart.
Preferably, the real-time market situation map is obtained by performing the following operations:
declaring an original image I in a canvas rendering environment, extracting current market printable characters, and setting the current market printable characters as a reference path of the original image I to obtain a standard image I;
generating a real-time market canvas by utilizing the canvas rendering environment, and drawing the standard image I to the real-time market canvas;
declaring a second original image in the canvas rendering environment, extracting the incremental market printable characters, and setting the incremental market printable characters as a reference path of the second original image to obtain a second standard image;
drawing the standard image II onto the real-time market canvas;
and splicing the first standard image and the second standard image through a function to obtain the real-time market situation map.
In order to solve the above problem, the present invention further provides a real-time market chart dynamic updating device applied to a server, where the device includes:
the request receiving module is used for receiving a real-time market transmission request sent by a client, recording the time for receiving the real-time market transmission request, generating data receiving time and acquiring a request timestamp in the real-time market transmission request;
the data acquisition module is used for acquiring the real-time market data generated between the request timestamp and the data receiving time and obtaining a request judgment result according to the data receiving time;
and the data sending module is used for sending the real-time market data, the data receiving time and the request judgment result to the client.
Optionally, the data obtaining module obtains the request judgment result by:
if the data receiving time is within a preset time range, setting the request judgment result as a first preset value;
and if the data receiving time is not within the preset time range, setting the request judgment result as a second preset value.
In order to solve the above problem, the present invention also provides an electronic device, including:
a memory storing at least one instruction; and
and the processor executes the instructions stored in the memory to realize the real-time market quotation dynamic updating method.
In order to solve the above problem, the present invention further provides a computer-readable storage medium, where at least one instruction is stored in the computer-readable storage medium, and the at least one instruction is executed by a processor in an electronic device to implement the above real-time dynamic market chart updating method.
The embodiment of the invention generates the incremental market situation graph at the client by using the request timestamp and the real-time market situation data generated between the data receiving time when the server receives the real-time market situation transmission request, and only the market situation data is transmitted between the client and the server without transmitting pictures, so that the flow is saved, the page response speed is improved, and the user experience is improved.
Drawings
Fig. 1 is a schematic flowchart of a dynamic updating method of a real-time market chart applied to a client according to a first embodiment of the present invention;
fig. 2 is a schematic flowchart of a real-time market chart dynamic updating method applied to a server according to a second embodiment of the present invention;
FIG. 3 is a functional block diagram of a real-time market chart dynamic update apparatus applied to a client according to a third embodiment of the present invention;
FIG. 4 is a functional block diagram of a real-time market chart dynamic update apparatus applied to a server according to a fourth embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device of a real-time market chart dynamic updating method according to a fifth embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The execution subject of the real-time market quotation dynamic updating method provided by the embodiment of the application includes, but is not limited to, at least one of electronic devices such as a server and a terminal, which can be configured to execute the method provided by the embodiment of the application. In other words, the real-time market chart dynamic updating method may be performed by software or hardware installed in the terminal device or the server device, and the software may be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like.
Fig. 1 is a schematic flow chart of a method for dynamically updating a real-time market chart applied to a client according to a first embodiment of the present invention. In this embodiment, the method for dynamically updating a real-time market chart includes:
s11, acquiring the request time stamp, generating a real-time market transmission request according to the request time stamp, sending the real-time market transmission request to a server, and recording the request sending time.
Preferably, the client is software capable of providing real-time market display, real-time market analysis and real-time market trading. And if the user A uses the software of the same style of flowers to inquire about the real-time market trading of the stocks, the software of the same style of flowers is the client.
In detail, in the embodiment of the present invention, the request timestamp refers to an acquisition deadline of data in the current market map, for example, if the current market map is generated according to data acquired by the server before 20, 5 and 20 days in 2020 by 10:0, the request timestamp is 20, 20 and 10:0 in 2020, and represents that the client needs to acquire data after 10, 10:0 in 20 and 20 days in 2020 from the server at this time. In the embodiment of the invention, the initial value of the request timestamp is null, and the request timestamp is updated according to the feedback data of the server. The real-time market quotation transmission request refers to a request sent by the client to the server at preset time intervals for acquiring a real-time data change state diagram.
The embodiment of the invention can acquire the request timestamp from a request list in the block chain, and transmit the request timestamp to the server as the parameter of the real-time market transmission request.
And S12, receiving data fed back by the server based on the real-time market transmission request, and acquiring real-time market data, data receiving time and a request judgment result from the fed-back data.
In this embodiment of the present invention, the real-time market data refers to real-time data, such as real-time trading data of stocks, that is obtained by the server from the time of the request timestamp to the time of the server receiving the real-time market transmission request. The data receiving time is the time when the server receives the real-time market transmission request. And the request judgment result is obtained according to the data receiving time and is represented by a Boolean value, wherein if the data receiving time is within a preset time range, the request judgment result is a first preset value, and if the data receiving time is not within the preset time range, the request judgment result is a second preset value.
For example, the stock market may be opened at 9:00 am and closed at 15:00 pm. When the client initiates the real-time market plot transmission request to the server for the first time, the request timestamp is marked as date-tag empty, the data receiving time of the server is 12/1/2019, and when the data receiving time is 10: 01/am, the data receiving time is marked as date-tag 20191201100100 (12/1/2019, and when the data receiving time is 10: 01/am), and the request timestamp is updated to date-tag 20191201100100 (12/1/2019, and when the data receiving time is 10: 01/am). Further, when the data reception time (10: 01 a.m.) is between preset time periods [ 9:00, 15:00 ], the request determination result is obtained as diff-tag true, and when the data reception time (15:00) is not between preset time periods [ 9:00, 15:00 ], the request determination result is obtained as diff-tag false.
And S13, generating an incremental market chart according to the real-time market data, and splicing the incremental market chart with the current market chart to generate the real-time market chart.
The preferred embodiment of the invention splices the incremental market chart and the current market chart by using the function in the pre-constructed canvas rendering environment.
Preferably, the splicing the incremental market chart and the current market chart specifically includes:
extracting printable characters of the incremental market chart to obtain the printable characters of the incremental market chart, and storing the printable characters of the incremental market chart;
extracting printable characters of a current market situation graph to obtain printable characters of the current market situation, and storing the printable characters of the current market situation;
and splicing the incremental market printable characters and the current market printable characters to obtain a real-time market chart.
Further, the splicing according to the incremental market printable characters and the current market printable characters to obtain a real-time market diagram includes:
declaring an original image I in a canvas rendering environment, extracting current market printable characters, and setting the current market printable characters as a reference path of the original image I to obtain a standard image I;
generating a real-time market canvas by utilizing the canvas rendering environment, and drawing the standard image I to the real-time market canvas;
declaring a second original image in the canvas rendering environment, extracting the incremental market printable characters, and setting the incremental market printable characters as a reference path of the second original image to obtain a second standard image;
drawing the standard image II onto the real-time market canvas;
and splicing the first standard image and the second standard image through a function to obtain the real-time market situation map.
In detail, the printable characters can be Base64 codes, the Base64 codes reduce extra HTTP requests caused by downloading pictures, a static picture with a reference path of Base64 character strings is generated through the advantages of rendering pictures by a client, portability and compatibility are high, a Canvas picture does not need to be rendered by a browser, loading speed is high, consumption of performance of the browser of the client is low, and traffic usage is reduced.
For example, taking a picture of 50kb in size as an example, the total requested traffic from the first minute to the last minute is about 12050kb, whereas only about 51kb of traffic is required using the incremental technique, which greatly reduces the cost of traffic for the company.
And S14, judging whether the request judgment result is a first preset value.
And if the request judgment result is the second preset value, ending the process.
If the request judgment result is the first preset value, executing S15, updating the request timestamp by using the data receiving time, returning to the S11 when the time difference between the current time and the request sending time reaches a preset time threshold value, and dynamically updating the real-time market situation map.
As described above, the preset values may be expressed by boolean values, the first preset value is diff-tag-true, and the second preset value is diff-tag-false. The preset time threshold refers to a time interval of sending the real-time market transmission request each time, and may be, for example, 1 minute.
For example, when the data receiving time of the server receiving the real-time market situation map transmission request for the first time is 12/1/2019, 10:01 am, and the preset starting time is 9:00 am, the server determines that the request is the first time according to the data receiving time, obtains the real-time market situation data from 9:00 to 10:01, obtains a request judgment result diff-tag true, and the client obtains the request judgment result and judges that the request judgment result is the first preset value, so that the real-time market situation transmission request can be sent next time. And simultaneously acquiring the current time, if the current time is 10:01:30 in the morning and the time difference between the current time and the request timestamp is less than a preset time threshold value for 1 minute, continuing to wait until the time difference between the current time and the request timestamp reaches the preset time threshold value, sending the real-time market transmission request by the client for the second time, and changing the request timestamp to date-tag 20191201100100 (12/1/2019 in 10:01 in the morning). And when the data receiving time of the server terminal for finally receiving the real-time market transmission request is 12/1/2019 and 15:00 in the afternoon, acquiring the real-time market data from 15:00 to 14:59 to obtain a request judgment result diff-tag-false, and the client terminal acquires the request judgment result and judges the request judgment result as a second preset value, stopping sending the real-time market transmission request and ending the request.
Fig. 2 is a schematic flow chart of a real-time market chart dynamic updating method applied to a server according to a second embodiment of the present invention. In this embodiment, the method for dynamically updating a real-time market chart includes:
s21, receiving a real-time market transmission request sent by a client, recording the time for receiving the real-time market transmission request, generating data receiving time, and acquiring a request time stamp in the real-time market transmission request.
Preferably, the real-time market transmission request includes a request timestamp (date-tag), when the server receives the real-time market transmission request for the first time, the request timestamp is null, and is recorded as date-tag null, and when the server does not receive the real-time market transmission request for the first time, the request timestamp is data fed back by the server based on the real-time market transmission request last time.
And S22, acquiring the real-time market data generated between the request timestamp and the data receiving time, and obtaining a request judgment result according to the data receiving time.
In detail, the obtaining of the request judgment result according to the data receiving time specifically includes:
if the data receiving time is within a preset time range, setting the request judgment result as a first preset value;
and if the data receiving time is not within the preset time range, setting the request judgment result as a second preset value.
For example, if the time of opening a stock market is 9:00 am and the time of closing the stock market is 15:00 pm, the time period [ 9:00, 15:00 ] is the preset time range. When the server receives the real-time market quotation map transmission request for the first time, the data receiving time of the server is 2019, 12 and 1 day, and when the data receiving time is 10:01 a.m., the data receiving time is recorded as date-tag 20191201100100(2019, 12 and 1 day, and when the data receiving time is in a preset time range, the request judgment result is a first preset value diff-tag true. And the client side adopts a mechanism of polling once in 1 minute, until the real-time market chart transmission request is finally received, the data receiving time is recorded as date-tag 20191201150000, the data receiving time is not in a preset time range, and the request judgment result is obtained as a second preset value diff-tag false.
And S23, sending the real-time market data, the data receiving time and the request judgment result to the client.
Preferably, in the embodiment of the present invention, the real-time market data, the data receiving time, and the request determining result are sent to the client, the real-time market data is used for splicing by the client, and the data receiving time and the request determining result are used for sending the real-time market map transmission request next time by the client.
For example, if the data receiving time of the server is 12/1/2019, and 10:01 am, the data receiving time is recorded as date-tag 20191201100100 (12/1/2019, and 10:01 am), if the data receiving time is within the time range between market opening and market receiving, the request determination result is obtained, the server sends the data receiving time and the request determination result to the client, and the request timestamp in the real-time market scenario transmission request sent by the client next time is date-tag 20191201100100, and the request determination result is diff-tag true.
The embodiment of the invention generates the incremental market situation graph at the client by using the request timestamp and the real-time market situation data generated between the data receiving time when the server receives the real-time market situation transmission request, and only the market situation data is transmitted between the client and the server without transmitting pictures, so that the flow is saved, the page response speed is improved, and the user experience is improved.
Fig. 3 is a functional block diagram of a real-time market chart dynamic updating apparatus applied to a client according to a third embodiment of the present invention.
The real-time market chart dynamic updating device 100 applied to the client can be installed in electronic equipment such as the client and the like. According to the realized functions, the real-time market chart dynamic updating device applied to the client can comprise a request updating module 101, a data receiving module 102, a splicing generation module 103 and a polling request module 104. The module of the present invention, which may also be referred to as a unit, refers to a series of computer program segments that can be executed by a processor of an electronic device and that can perform a fixed function, and that are stored in a memory of the electronic device.
In the present embodiment, the functions regarding the respective modules/units are as follows:
the request updating module 101 is configured to obtain a request timestamp, generate a real-time market transmission request according to the request timestamp, send the real-time market transmission request to a server, and record request sending time;
preferably, the client is software capable of providing real-time market display, real-time market analysis and real-time market trading. And if the user A uses the software of the same style of flowers to inquire about the real-time market trading of the stocks, the software of the same style of flowers is the client.
In detail, in the embodiment of the present invention, the request timestamp refers to an acquisition deadline of data in the current market map, for example, if the current market map is generated according to data acquired by the server before 20, 5 and 20 days in 2020 by 10:0, the request timestamp is 20, 20 and 10:0 in 2020, and represents that the client needs to acquire data after 10, 10:0 in 20 and 20 days in 2020 from the server at this time. In the embodiment of the invention, the initial value of the request timestamp is null, and the request timestamp is updated according to the feedback data of the server. The real-time market quotation transmission request refers to a request sent by the client to the server at preset time intervals for acquiring a real-time data change state diagram.
The embodiment of the invention can acquire the request timestamp from a request list in the block chain, and transmit the request timestamp to the server as the parameter of the real-time market transmission request.
The data receiving module 102 is configured to receive data fed back by the server based on the real-time market transmission request, and obtain real-time market data, data receiving time, and a request judgment result from the fed-back data.
In this embodiment of the present invention, the real-time market data refers to real-time data, such as real-time trading data of stocks, that is obtained by the server from the time of the request timestamp to the time of the server receiving the real-time market transmission request. The data receiving time is the time when the server receives the real-time market transmission request. And the request judgment result is obtained according to the data receiving time and is represented by a Boolean value, wherein if the data receiving time is within a preset time range, the request judgment result is a first preset value, and if the data receiving time is not within the preset time range, the request judgment result is a second preset value.
For example, the stock market may be opened at 9:00 am and closed at 15:00 pm. When the client initiates the real-time market plot transmission request to the server for the first time, the request timestamp is marked as date-tag empty, the data receiving time of the server is 12/1/2019, and when the data receiving time is 10: 01/am, the data receiving time is marked as date-tag 20191201100100 (12/1/2019, and when the data receiving time is 10: 01/am), and the request timestamp is updated to date-tag 20191201100100 (12/1/2019, and when the data receiving time is 10: 01/am). Further, when the data reception time (10: 01 a.m.) is between preset time periods [ 9:00, 15:00 ], the request determination result is obtained as diff-tag true, and when the data reception time (15:00) is not between preset time periods [ 9:00, 15:00 ], the request determination result is obtained as diff-tag false.
And the splicing generation module 103 is configured to generate an incremental market chart according to the real-time market data, splice the incremental market chart with the current market chart, and generate a real-time market chart.
The preferred embodiment of the invention splices the incremental market chart and the current market chart by using the function in the pre-constructed canvas rendering environment.
Preferably, the concatenation generating module 103 concatenates the incremental market situation map and the current market situation map by:
extracting printable characters of the incremental market chart to obtain the printable characters of the incremental market chart, and storing the printable characters of the incremental market chart;
extracting printable characters of a current market situation graph to obtain printable characters of the current market situation, and storing the printable characters of the current market situation;
and splicing the incremental market printable characters and the current market printable characters to obtain a real-time market chart.
Further, the splicing generation module 103 obtains a real-time market chart by the following operations:
declaring an original image I in a canvas rendering environment, extracting current market printable characters, and setting the current market printable characters as a reference path of the original image I to obtain a standard image I;
generating a real-time market canvas by utilizing the canvas rendering environment, and drawing the standard image I to the real-time market canvas;
declaring a second original image in the canvas rendering environment, extracting the incremental market printable characters, and setting the incremental market printable characters as a reference path of the second original image to obtain a second standard image;
drawing the standard image II onto the real-time market canvas;
and splicing the first standard image and the second standard image through a function to obtain the real-time market situation map.
In detail, the printable characters can be Base64 codes, the Base64 codes reduce extra HTTP requests caused by downloading pictures, a static picture with a reference path of Base64 character strings is generated through the advantages of rendering pictures by a client, portability and compatibility are high, a Canvas picture does not need to be rendered by a browser, loading speed is high, consumption of performance of the browser of the client is low, and traffic usage is reduced.
For example, taking a picture of 50kb in size as an example, the total requested traffic from the first minute to the last minute is about 12050kb, whereas only about 51kb of traffic is required using the incremental technique, which greatly reduces the cost of traffic for the company.
The polling request module 104 is configured to determine whether the request determination result is a first preset value, update the request timestamp by using the data receiving time when the request determination result is the first preset value, repeat the above steps when a time difference between the current time and the request sending time reaches a preset time threshold, dynamically update the real-time market quotation map, and end the process if the request determination result is a second preset value.
As described above, the preset values may be expressed by boolean values, the first preset value is diff-tag-true, and the second preset value is diff-tag-false. The preset time threshold refers to a time interval of sending the real-time market transmission request each time, and may be, for example, 1 minute.
For example, when the data receiving time of the server receiving the real-time market situation map transmission request for the first time is 12/1/2019, 10:01 am, and the preset starting time is 9:00 am, the server determines that the request is the first time according to the data receiving time, obtains the real-time market situation data from 9:00 to 10:01, obtains a request judgment result diff-tag true, and the client obtains the request judgment result and judges that the request judgment result is the first preset value, so that the real-time market situation transmission request can be sent next time. And simultaneously acquiring the current time, if the current time is 10:01:30 in the morning and the time difference between the current time and the request timestamp is less than a preset time threshold value for 1 minute, continuing to wait until the time difference between the current time and the request timestamp reaches the preset time threshold value, sending the real-time market transmission request by the client for the second time, and changing the request timestamp to date-tag 20191201100100 (12/1/2019 in 10:01 in the morning). And when the data receiving time of the server terminal for finally receiving the real-time market transmission request is 12/1/2019 and 15:00 in the afternoon, acquiring the real-time market data from 15:00 to 14:59 to obtain a request judgment result diff-tag-false, and the client terminal acquires the request judgment result and judges the request judgment result as a second preset value, stopping sending the real-time market transmission request and ending the request.
Fig. 4 is a functional block diagram of a real-time market chart dynamic updating apparatus applied to a server according to a fourth embodiment of the present invention.
The real-time market chart dynamic updating device 200 applied to the server side can be installed in electronic equipment such as a server. According to the realized functions, the real-time market chart dynamic updating device applied to the server can comprise a request receiving module 201, a data acquiring module 202 and a data sending module 203. The module of the present invention, which may also be referred to as a unit, refers to a series of computer program segments that can be executed by a processor of an electronic device and that can perform a fixed function, and that are stored in a memory of the electronic device.
In the present embodiment, the functions regarding the respective modules/units are as follows:
the request receiving module 201 is configured to receive a real-time market transmission request sent by a client, record a time for receiving the real-time market transmission request, generate a data receiving time, and obtain a request timestamp in the real-time market transmission request.
Preferably, the real-time market transmission request includes a request timestamp (date-tag), when the server receives the real-time market transmission request for the first time, the request timestamp is null, and is recorded as date-tag null, and when the server does not receive the real-time market transmission request for the first time, the request timestamp is data fed back by the server based on the real-time market transmission request last time.
The data obtaining module 202 is configured to obtain the real-time market data generated between the request timestamp and the data receiving time, and obtain a request judgment result according to the data receiving time.
In detail, the data obtaining module 202 obtains the request judgment result by:
if the data receiving time is within a preset time range, setting the request judgment result as a first preset value;
and if the data receiving time is not within the preset time range, setting the request judgment result as a second preset value.
For example, if the time of opening a stock market is 9:00 am and the time of closing the stock market is 15:00 pm, the time period [ 9:00, 15:00 ] is the preset time range. When the server receives the real-time market quotation map transmission request for the first time, the data receiving time of the server is 2019, 12 and 1 day, and when the data receiving time is 10:01 a.m., the data receiving time is recorded as date-tag 20191201100100(2019, 12 and 1 day, and when the data receiving time is in a preset time range, the request judgment result is a first preset value diff-tag true. And the client side adopts a mechanism of polling once in 1 minute, until the real-time market chart transmission request is finally received, the data receiving time is recorded as date-tag 20191201150000, the data receiving time is not in a preset time range, and the request judgment result is obtained as a second preset value diff-tag false.
The data sending module 203 is configured to send the real-time market data, the data receiving time, and the request determination result to the client.
Preferably, in the embodiment of the present invention, the real-time market data, the data receiving time, and the request determining result are sent to the client, the real-time market data is used for splicing by the client, and the data receiving time and the request determining result are used for sending the real-time market map transmission request next time by the client.
For example, if the data receiving time of the server is 12/1/2019, and 10:01 am, the data receiving time is recorded as date-tag 20191201100100 (12/1/2019, and 10:01 am), if the data receiving time is within the time range between market opening and market receiving, the request determination result is obtained, the server sends the data receiving time and the request determination result to the client, and the request timestamp in the real-time market scenario transmission request sent by the client next time is date-tag 20191201100100, and the request determination result is diff-tag true.
Fig. 5 is a schematic structural diagram of an electronic device according to a method for dynamically updating a real-time market chart according to a fifth embodiment of the present invention.
The electronic device 1 may include a processor 10, a memory 11 and a bus, and may further include a computer program stored in the memory 11 and executable on the processor 10, such as a real-time market chart dynamic update program 12.
The memory 11 includes at least one type of readable storage medium, which includes flash memory, removable hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device 1, such as a removable hard disk of the electronic device 1. The memory 11 may also be an external storage device of the electronic device 1 in other embodiments, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the electronic device 1. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device 1. The memory 11 may be used to store not only application software installed in the electronic device 1 and various types of data, such as codes of the real-time market chart dynamic update program 12, but also temporarily store data that has been output or will be output.
The processor 10 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same or different functions, including one or more Central Processing Units (CPUs), microprocessors, digital Processing chips, graphics processors, and combinations of various control chips. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects various components of the electronic device by using various interfaces and lines, and executes various functions and processes data of the electronic device 1 by running or executing programs or modules (for example, executing a real-time market map dynamic update program, etc.) stored in the memory 11 and calling data stored in the memory 11.
The bus may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is arranged to enable connection communication between the memory 11 and at least one processor 10 or the like.
Fig. 5 only shows an electronic device with components, and it will be understood by a person skilled in the art that the structure shown in fig. 5 does not constitute a limitation of the electronic device 1, and may comprise fewer or more components than shown, or a combination of certain components, or a different arrangement of components.
For example, although not shown, the electronic device 1 may further include a power supply (such as a battery) for supplying power to each component, and preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so as to implement functions of charge management, discharge management, power consumption management, and the like through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. The electronic device 1 may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
Further, the electronic device 1 may further include a network interface, and optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a bluetooth interface, etc.), which are generally used for establishing a communication connection between the electronic device 1 and other electronic devices.
Optionally, the electronic device 1 may further comprise a user interface, which may be a Display (Display), an input unit (such as a Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable for displaying information processed in the electronic device 1 and for displaying a visualized user interface, among other things.
It is to be understood that the described embodiments are for purposes of illustration only and that the scope of the appended claims is not limited to such structures.
The real-time market situation map dynamic update program 12 stored in the memory 11 of the electronic device 1 is a combination of a plurality of instructions, and when running in the processor 10, can realize:
acquiring a request timestamp, generating a real-time market transmission request according to the request timestamp, sending the real-time market transmission request to a server, and recording request sending time;
receiving data fed back by the server based on the real-time market transmission request, and acquiring real-time market data, data receiving time and a request judgment result from the fed-back data;
generating an incremental market quotation map according to the real-time market quotation data, and splicing the incremental market quotation map with the current market quotation map to generate a real-time market quotation map;
and when the request judgment result is a first preset value, updating the request timestamp by using the data receiving time, and repeatedly executing the steps when the time difference between the current time and the request sending time reaches a preset time threshold value to dynamically update the real-time market situation map.
In another embodiment of the present invention, the real-time market chart dynamic update program 12 stored in the memory 11 of the electronic device 1 is a combination of a plurality of instructions, and when running in the processor 10, can implement:
receiving a real-time market transmission request sent by a client, recording the time for receiving the real-time market transmission request, generating data receiving time, and acquiring a request timestamp in the real-time market transmission request;
acquiring real-time market data generated between the request timestamp and the data receiving time, and obtaining a request judgment result according to the data receiving time;
and sending the real-time market data, the data receiving time and the request judgment result to the client.
Specifically, the specific implementation method of the processor 10 for the instruction may refer to the description of the relevant steps in the embodiment corresponding to fig. 1 or fig. 2, which is not repeated herein.
Further, the integrated modules/units of the electronic device 1, if implemented in the form of software functional units and sold or used as separate products, may be stored in a non-volatile computer-readable storage medium. The computer-readable medium may include: any entity or device capable of carrying said computer program code, recording medium, U-disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM).
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method can be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof.
The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the system claims may also be implemented by one unit or means in software or hardware. The terms second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims (10)

1. A real-time market chart dynamic updating method is characterized in that the method is applied to a client side and specifically comprises the following steps:
step A: acquiring a request timestamp, generating a real-time market transmission request according to the request timestamp, sending the real-time market transmission request to a server, and recording request sending time;
and B: receiving data fed back by the server based on the real-time market transmission request, and acquiring real-time market data, data receiving time and a request judgment result from the fed-back data;
and C: generating an incremental market quotation map according to the real-time market quotation data, and splicing the incremental market quotation map with the current market quotation map to generate a real-time market quotation map;
step D: and when the request judgment result is a first preset value, updating the request timestamp by using the data receiving time, and repeatedly executing the step A, the step B and the step C when the time difference between the current time and the request sending time reaches a preset time threshold value, so as to dynamically update the real-time market situation map.
2. The method for dynamically updating the real-time market quotation map according to claim 1, wherein the step of splicing the incremental market quotation map with the current market quotation map comprises the following steps:
extracting printable characters of the incremental market chart to obtain the printable characters of the incremental market chart, and storing the printable characters of the incremental market chart;
extracting printable characters of a current market situation graph to obtain printable characters of the current market situation, and storing the printable characters of the current market situation;
and splicing the incremental market printable characters and the current market printable characters to obtain a real-time market chart.
3. The method for dynamically updating a real-time market chart according to claim 2, wherein the step of splicing the incremental market printable characters and the current market printable characters to obtain the real-time market chart comprises the steps of:
declaring an original image I in a canvas rendering environment, extracting current market printable characters, and setting the current market printable characters as a reference path of the original image I to obtain a standard image I;
generating a real-time market canvas by utilizing the canvas rendering environment, and drawing the standard image I to the real-time market canvas;
declaring a second original image in the canvas rendering environment, extracting the incremental market printable characters, and setting the incremental market printable characters as a reference path of the second original image to obtain a second standard image;
drawing the standard image II onto the real-time market canvas;
and splicing the first standard image and the second standard image through a function to obtain the real-time market situation map.
4. A real-time market situation map dynamic updating method is characterized in that the method is applied to a server side and specifically comprises the following steps:
receiving a real-time market transmission request sent by a client, recording the time for receiving the real-time market transmission request, generating data receiving time, and acquiring a request timestamp in the real-time market transmission request;
acquiring real-time market data generated between the request timestamp and the data receiving time, and obtaining a request judgment result according to the data receiving time;
and sending the real-time market data, the data receiving time and the request judgment result to the client.
5. The method for dynamically updating a real-time market chart according to claim 4, wherein the obtaining a request judgment result according to the data receiving time comprises:
if the data receiving time is within a preset time range, setting the request judgment result as a first preset value;
and if the data receiving time is not within the preset time range, setting the request judgment result as a second preset value.
6. The device for dynamically updating the real-time market quotation map is applied to a client, and comprises:
the request updating module is used for acquiring a request timestamp, generating a real-time market transmission request according to the request timestamp, sending the real-time market transmission request to a server and recording request sending time;
the data receiving module is used for receiving data fed back by the server based on the real-time market transmission request, and acquiring real-time market data, data receiving time and a request judgment result from the fed-back data;
the splicing generation module is used for generating an incremental market quotation map according to the real-time market quotation data, splicing the incremental market quotation map with the current market quotation map and generating a real-time market quotation map;
and the polling request module is used for updating the request timestamp by using the data receiving time when the request judgment result is a first preset value, and repeatedly executing the steps when the time difference between the current time and the request sending time reaches a preset time threshold value to dynamically update the real-time market quotation map.
7. The device for dynamically updating a real-time market quotation according to claim 6, wherein the splicing generation module of the client obtains the real-time market quotation by:
declaring an original image I in a canvas rendering environment, extracting current market printable characters, and setting the current market printable characters as a reference path of the original image I to obtain a standard image I;
generating a real-time market canvas by utilizing the canvas rendering environment, and drawing the standard image I to the real-time market canvas;
declaring a second original image in the canvas rendering environment, extracting the incremental market printable characters, and setting the incremental market printable characters as a reference path of the second original image to obtain a second standard image;
drawing the standard image II onto the real-time market canvas;
and splicing the first standard image and the second standard image through a function to obtain the real-time market situation map.
8. The utility model provides a real-time market situation map dynamic update device, its characterized in that, the device is applied to the server side, the device includes:
the request receiving module is used for receiving a real-time market transmission request sent by a client, recording the time for receiving the real-time market transmission request, generating data receiving time and acquiring a request timestamp in the real-time market transmission request;
the data acquisition module is used for acquiring the real-time market data generated between the request timestamp and the data receiving time and obtaining a request judgment result according to the data receiving time;
and the data sending module is used for sending the real-time market data, the data receiving time and the request judgment result to the client.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method for dynamically updating a real-time market chart according to any one of claims 1 to 3 or 4 to 5.
10. A computer-readable storage medium, storing a computer program, wherein the computer program, when executed by a processor, implements the real-time market chart dynamic updating method according to any one of claims 1 to 3 or claims 4 to 5.
CN202011642730.3A 2020-12-30 2020-12-30 Real-time market situation map dynamic updating method and device, electronic equipment and storage medium Pending CN112669213A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011642730.3A CN112669213A (en) 2020-12-30 2020-12-30 Real-time market situation map dynamic updating method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011642730.3A CN112669213A (en) 2020-12-30 2020-12-30 Real-time market situation map dynamic updating method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112669213A true CN112669213A (en) 2021-04-16

Family

ID=75412349

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011642730.3A Pending CN112669213A (en) 2020-12-30 2020-12-30 Real-time market situation map dynamic updating method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112669213A (en)

Similar Documents

Publication Publication Date Title
CN112653760B (en) Cross-server file transmission method and device, electronic equipment and storage medium
CN111880948A (en) Data refreshing method and device, electronic equipment and computer readable storage medium
CN113890712A (en) Data transmission method and device, electronic equipment and readable storage medium
CN112256783A (en) Data export method and device, electronic equipment and storage medium
CN114185776A (en) Big data point burying method, device, equipment and medium for application program
CN113868528A (en) Information recommendation method and device, electronic equipment and readable storage medium
CN116450723A (en) Data extraction method, device, computer equipment and storage medium
CN112669213A (en) Real-time market situation map dynamic updating method and device, electronic equipment and storage medium
CN114691782A (en) Database table increment synchronization method and device and storage medium
CN115016754A (en) Method and device for synchronously displaying pages among devices, electronic device and medium
CN115174541A (en) H5 resource loading method and device, electronic equipment and storage medium
CN114064033A (en) Front-end component development method and device, electronic equipment and readable storage medium
CN112632422A (en) Intelligent image cutting method and device, electronic equipment and storage medium
CN112637280B (en) Data transmission method, device, electronic equipment and storage medium
CN111652747B (en) Electronic policy processing method, device, equipment and computer readable storage medium
CN116483747B (en) Quotation snapshot issuing method, device, equipment and medium
CN115174698B (en) Market data decoding method, device, equipment and medium based on table entry index
CN115454610A (en) Real-time progress feedback method and device, electronic equipment and computer readable storage medium
CN116841678A (en) Method, device, equipment and storage medium for uniformly refreshing labels at front end of webpage
CN115409581A (en) Product recommendation method, device, equipment and medium based on user behavior configuration
CN117116441A (en) Date object creation-based consultation reservation method, device, equipment and storage medium
CN114138316A (en) Incremental package generation and downloading method and device, electronic equipment and readable storage medium
CN113704109A (en) Front-end and back-end data interaction method and device, electronic equipment and storage medium
CN113032168A (en) Data transmission rate dynamic adjustment method and device, electronic equipment and storage medium
CN115174555A (en) File transmission method and device, 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