CN109062574B - Extensible securities market data transmission display method and system - Google Patents

Extensible securities market data transmission display method and system Download PDF

Info

Publication number
CN109062574B
CN109062574B CN201810756706.9A CN201810756706A CN109062574B CN 109062574 B CN109062574 B CN 109062574B CN 201810756706 A CN201810756706 A CN 201810756706A CN 109062574 B CN109062574 B CN 109062574B
Authority
CN
China
Prior art keywords
data
protocol
client
protocol field
enabling bit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810756706.9A
Other languages
Chinese (zh)
Other versions
CN109062574A (en
Inventor
田淑宁
朱留锋
荣强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
LightHouse Technology Co Ltd
Original Assignee
Wuhan Dengta Zhiguang Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Dengta Zhiguang Technology Co ltd filed Critical Wuhan Dengta Zhiguang Technology Co ltd
Priority to CN201810756706.9A priority Critical patent/CN109062574B/en
Publication of CN109062574A publication Critical patent/CN109062574A/en
Application granted granted Critical
Publication of CN109062574B publication Critical patent/CN109062574B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer And Data Communications (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The invention discloses an extensible stock market data transmission display method, which comprises the following steps: defining a protocol file by adopting an interface description language, wherein the protocol file comprises a protocol field of stock market data; translating the protocol file into a source code of a preset language by using a translator, wherein an enabling bit of each protocol field is defined in the source code; the client end utilizes the enabling bit setting interface to enable and set the protocol field of the data to be requested and initiates a data request to the server end, wherein the data request comprises enabling bit information of the protocol field of the requested data; the server receives the data request and obtains the enabling bit information; and the server returns the data of the protocol field to the client according to the enabling bit information. The invention can satisfy multi-terminal and multi-language, and can conveniently expand the field, and select the field transmission by setting the enable bit, thereby reducing the data transmission quantity and reducing the transmission bandwidth.

Description

Extensible securities market data transmission display method and system
Technical Field
The invention belongs to the technical field of electronic finance, and particularly relates to an extensible stock market data transmission display method and system.
Background
Stock market data is numerous, however, data that needs to be transmitted and displayed is often different in different application scenarios, such as different data needed when viewing a drive and viewing real-time data. However, in the conventional security application software, only the same data transmission interface is usually provided, and the same data field is transmitted through the interface in different scenes, so that a large number of unnecessary fields are transmitted, that is, the data transmission flow is increased, and the data bandwidth is wasted.
Disclosure of Invention
In view of the above-identified deficiencies in the art or needs for improvements, the present invention provides an extensible stock market data transmission display scheme by defining a protocol IDL file and then translating the IDL file into actual code in a corresponding language using a translation program. The translation tool numbers the protocol fields in sequence; when the client requests data, the transmission enabling bit of the field can be set according to the field name to determine whether the data needs to be transmitted on the network; simultaneously converting single-precision floating point numbers and double-precision floating point numbers into integer numbers according to the precision specified in the IDL file, and then automatically carrying out inverse operation at a client to obtain original values; when floating point numbers need to be displayed, the client can directly acquire precision according to the source codes generated by the IDL file, and display according to the precision.
To achieve the above object, according to an aspect of the present invention, there is provided an extensible stock market data transmission display method, including:
defining a protocol file by adopting an interface description language, wherein the protocol file comprises a protocol field of stock market data;
translating the protocol file into a source code of a preset language by using a translator, wherein the source code defines an enabling bit of each protocol field and defines an enabling bit setting interface;
the client end utilizes the enabling bit setting interface to enable and set the protocol field of the data to be requested and initiates a data request to the server end, wherein the data request comprises enabling bit information of the protocol field of the requested data;
the server receives the data request and obtains the enabling bit information, and the enabling bit information is used for the server to determine a protocol field of the data required to be requested by the client;
and the server determines the data of the protocol field requested by the client according to the enabling bit information and returns the data of the protocol field to the client.
In the method, the protocol field of the stock market data is defined through the IDL protocol file, a function interface is provided, a uniform request and response structure body is set, and the request enabling bit is transmitted in follow-up assistance through the structure body. The IDL file can then be translated into the actual code of the corresponding programming language using a translator. The method can be used between multiple terminals (including android, iOS, Windows, Linux and WeChat small programs) and multiple languages (C, C + +, Java, Javascript and ObjectC), can conveniently expand the fields and set the selection fields to transmit through the enable bits. Therefore, the data transmission quantity can be reduced, and the transmission bandwidth can be reduced.
In an embodiment of the present invention, the protocol file further defines a display precision of a floating point number of each protocol field, the source code further includes an encoding function and a decoding function, the encoding function is configured to encode, at the server end, a corresponding floating point number according to the display precision of the floating point number of each protocol field in an alignment-to-integer manner to obtain an integer number, and the decoding function is configured to decode, at the client end, the integer number back to the floating point number according to the display precision of the floating point number of each protocol field.
In the embodiment of the invention, the floating point number is coded into the integer number before the server transmits the data to the client by defining the display precision of each field, and the integer number is decoded into the floating point number after the client receives the data. Therefore, the security market data can be encoded, compressed, transmitted and decoded according to the characteristics of minimum occupation bit encoding and the like, thereby reducing the data transmission quantity and the transmission bandwidth.
In an embodiment of the present invention, after receiving and decoding the floating point number, the client displays the floating point number on the client according to the display precision.
In the embodiment of the invention, by defining the display precision of each field, when the corresponding field is displayed at the client, the display is carried out according to the defined display precision. Therefore, different display accuracies can be defined for different application scenes, and the subsequent maintenance and expansion of the application program are facilitated.
In an embodiment of the present invention, the enable bit setting interface includes an enable bit setting function of the corresponding protocol field, and the client performs enable setting on the corresponding protocol field by using the enable bit setting function.
In the embodiment of the invention, when the client requests data from the server, the corresponding enable bit can be set in the data request through the enable bit setting function, and the enable bit represents the data field required by the client, so that different clients can set different enable bits according to different data requirements. The method can reduce the data transmission quantity and the transmission bandwidth, and is convenient for the subsequent maintenance and expansion of the program.
In an embodiment of the present invention, the protocol file further defines a display precision of a floating point number of each protocol field, the source code further includes a Json encoding function and a Json decoding function, the Json encoding function is configured to encode and convert a corresponding floating point number according to the display precision of the floating point number of each protocol field at the server to obtain a Json type data, and the Json decoding function is configured to convert the received Json type data into a structure value at the client for display at the client.
In the embodiment of the invention, a Json coding and decoding function is also provided in the source code, and Json type data coding and decoding operation can be carried out on data, so that the requirement of web end display such as WeChat small programs and the like can be met conveniently.
In one embodiment of the invention, the protocol file defines a stock market comprising fields of one or more of: opening price, closing price, yesterday closing price, highest price, lowest price, current price, stop price, volume of transaction, price for buying in five gear, quantity of buying in five gear, price for selling in five gear or quantity of selling in five gear.
In the embodiment of the invention, the stock market data is defined, and particularly, the single-precision floating point number and the double-precision floating point number which are used in large quantity in the stock market data are specially optimized, so that the transmission bandwidth is reduced.
In an embodiment of the present invention, an enable bit obtaining interface is defined in the source code, and the server side obtains enable bit information of the data request by using the enable bit obtaining interface.
In the embodiment of the invention, the enable bit acquisition interface is defined in the source code, so that after a data request sent by a client is received, the enable bit information in the data request can be acquired through the enable bit acquisition interface, thereby determining which fields of data the client needs to request, and returning different data to different clients according to the requirements of different clients.
According to another aspect of the present invention, there is also provided an extensible stock market data transmission display system, including a client and a server, wherein:
the client and the server both comprise source codes, wherein the source codes are obtained by translating a protocol file into a preset language by using a translator, an enabling bit of each protocol field is defined in the source codes, an enabling bit setting interface is defined, the protocol file is defined by adopting an interface description language, and the protocol file comprises protocol fields of stock market data;
the client is used for enabling and setting the protocol field needing to request data by using the enabling bit setting interface and initiating a data request to the server, wherein the data request comprises enabling bit information of the protocol field of the requested data;
the server is used for receiving the data request and obtaining the enabling bit information, and the enabling bit information is used for the server to determine a protocol field of the client needing to request data;
and the server is used for acquiring the data of the protocol field requested by the client according to the enabling bit information and returning the data of the protocol field to the client.
In the system provided by the invention, the protocol field of the stock market data is defined through the IDL protocol file, a function interface is provided, a uniform request and response structure body is set, and the request enable bit is transmitted in follow-up assistance through the structure body. The IDL file can then be translated into the actual code of the corresponding programming language using a translator. The method can be used between multiple terminals (including android, iOS, Windows, Linux and WeChat small programs) and multiple languages (C, C + +, Java, Javascript and ObjectC), can conveniently expand the fields and set the selection fields to transmit through the enable bits. Therefore, the data transmission quantity can be reduced, and the transmission bandwidth can be reduced.
In an embodiment of the present invention, the protocol file further defines a display precision of a floating point number of each protocol field, the source code further includes an encoding function and a decoding function, the encoding function is configured to encode, at the server end, a corresponding floating point number according to the display precision of the floating point number of each protocol field in an alignment-to-integer manner to obtain an integer number, and the decoding function is configured to decode, at the client end, the integer number back to the floating point number according to the display precision of the floating point number of each protocol field.
In an embodiment of the present invention, after receiving and decoding the floating point number, the client displays the floating point number on the client according to the display precision.
Generally, compared with the prior art, the technical scheme of the invention has the following beneficial effects: the invention can be used between multiple terminals (including android, iOS, Windows, Linux, WeChat small program) and multiple languages (C, C + +, Java, Javascript, ObjectC), and can encode, compress, transmit, decode and display the securities quotation data according to the characteristics of extensible field encoding, selectable field transmission, specifiable precision display, minimum occupation bit encoding and the like. Particularly, single-precision floating point numbers and double-precision floating point numbers which are used in a large amount in the stock market data are specially optimized, and transmission bandwidth is reduced. The scheme is simple and easy to understand, and is suitable for various scenes needing to transmit the securities quotation.
Drawings
FIG. 1 is a schematic flow chart illustrating an expandable securities market data transmission display method according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of an extensible stock market data process according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an extensible stock market data transmission display system according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. In addition, the technical features involved in the embodiments of the present invention described below may be combined with each other as long as they do not conflict with each other.
The existing stock market software usually adopts the same data interface, needs to use different fields in different scenes, but transmits the same fields through the same data interface, thereby transmitting a large number of unnecessary fields.
In order to solve the above problems, as shown in fig. 1, the present invention provides an extensible method for transmitting and displaying stock market data, which uses an Interface Description Language (IDL) file to define a protocol field of the stock market data and define an enable bit setting Interface, and then uses a translator to translate the IDL file into source codes of various programming languages. The source code defines the enable bit of each field, and defines the enable bit of each field to set the function, so that the code can call the function conveniently to set whether the field is transmitted on the network. The enable bits correspond to the bits of the byte, so that each byte may contain 8 enable bits. If 32 fields are included in the data returned by a certain interface, but in a certain scene, I only need to use 4 fields. Then the remaining 28 enable bits are turned off when requested by the client. The server side obtains the enable bit after the request of the receiving end, and only returns the corresponding 4 fields according to the setting state of the enable bit when the server side returns data, thereby greatly saving the flow.
Specifically, as shown in fig. 1, the present invention provides an extensible stock market data transmission display method, including:
s1, defining a protocol file by adopting an interface description language, wherein the protocol file comprises protocol fields of stock market data;
IDL is an abbreviation of Interface Description Language, refers to Interface Description Language, is a part of CORBA specification, and is the basis of cross-platform development. IDL is a computer language used to describe the interfaces of software components. IDLs describe interfaces in a neutral way so that objects running on different platforms and programs written in different languages can communicate with each other; for example, one component is written in C + + and another component is written in Java. IDLs are typically used to remotely invoke software. In this case, object components on different operating systems are typically called by the remote client terminal, and may be written in different computer languages. The IDL establishes a bridge for communication between two different operating systems.
Specifically, in the embodiment of the present invention, the stock market data may be described by IDL, for example, IDL description language is defined:
Figure BDA0001726886720000071
Figure BDA0001726886720000072
Figure BDA0001726886720000081
here we describe the most common data request in stock market transmission, namely to obtain real-time market for a batch of stocks. It can be seen that we set the precision for floating point numbers in the structure. And simultaneously, providing a function interface, and setting a unified request and response structure body which is used for assisting in transmitting the request enable bit in the follow-up process. And the precision is the display precision of the client.
In particular, a security quote may be defined in the protocol file, the security quote including fields of one or more of: the market price is the price of opening, closing, yesterday closing, highest price, lowest price, current price, stop price rising, stop price falling, volume of bargain, price of buying in five gear, quantity of buying in five gear, price of selling in five gear or quantity of selling in five gear. In the embodiment of the present invention, the protocol text contains fields shown in the above codes.
S2, translating the protocol file into a source code of a preset language by using a translator, wherein the source code defines the enabling bit of each protocol field and defines an enabling bit setting interface;
specifically, the IDL file defined in step S1 is translated using a translator pair, which is:
struct SecQuote:public Thoth::protocol::Message
{
public:
static::Thoth::protocol::FieldType I_TYPE(){return::Thoth::protocol::FT_MESSAGE;}
SecQuote():sDtSecCode(""),sSecName(""),fClose(0),fOpen(0),fMax(0),fMin(0),fNow(0),fAmout(0)
{
}
void SetEnable_sDtSecCode(bool bEnable){xMAP.SetEnable(0,bEnable);}
void SetEnable_sSecName(bool bEnable){xMAP.SetEnable(1,bEnable);}
void SetEnable_fClose(bool bEnable){xMAP.SetEnable(2,bEnable);}
void SetEnable_fOpen(bool bEnable){xMAP.SetEnable(3,bEnable);}
void SetEnable_fMax(bool bEnable){xMAP.SetEnable(4,bEnable);}
void SetEnable_fMin(bool bEnable){xMAP.SetEnable(5,bEnable);}
void SetEnable_fNow(bool bEnable){xMAP.SetEnable(6,bEnable);}
void SetEnable_fAmout(bool bEnable){xMAP.SetEnable(7,bEnable);}
void SetEnable_vBuyp(bool bEnable){xMAP.SetEnable(8,bEnable);}
void SetEnable_vBuyv(bool bEnable){xMAP.SetEnable(9,bEnable);}
void SetEnable_vSellp(bool bEnable){xMAP.SetEnable(10,bEnable);}
void SetEnable_vSellv(bool bEnable){xMAP.SetEnable(11,bEnable);}
PMAP GetEnable(){return xMAP;}
void Encode(Thoth::protocol::BaseOutputStream&os)const
{
::Thoth::protocol::BaseOutputStream ostream(os.getBaseBuffer());
ostream.write((uint16_t)0,sDtSecCode);
ostream.write((uint16_t)1,sSecName);
ostream.write((uint16_t)2,fClose,2);
ostream.write((uint16_t)3,fOpen,2);
ostream.write((uint16_t)4,fMax,2);
ostream.write((uint16_t)5,fMin,2);
ostream.write((uint16_t)6,fNow,2);
ostream.write((uint16_t)7,fAmout,2);
ostream.write((uint16_t)8,vBuyp,2);
ostream.write((uint16_t)9,vBuyv,2);
ostream.write((uint16_t)10,vSellp,2);
ostream.write((uint16_t)11,vSellv,2);
}
void Decode(Thoth::protocol::BaseInputStream&is)
{
::Thoth::protocol::BaseInputStream istream(is.getBaseBuffer());
istream.read((uint16_t)0,sDtSecCode);
istream.read((uint16_t)1,sSecName);
istream.read((uint16_t)2,fClose,2);
istream.read((uint16_t)3,fOpen,2);
istream.read((uint16_t)4,fMax,2);
istream.read((uint16_t)5,fMin,2);
istream.read((uint16_t)6,fNow,2);
istream.read((uint16_t)7,fAmout,2);
istream.read((uint16_t)8,vBuyp,2);
istream.read((uint16_t)9,vBuyv,2);
istream.read((uint16_t)10,vSellp,2);
istream.read((uint16_t)11,vSellv,2);
}
JsonValue EncodeToJson()const
{
JsonValue xJsonValue;
xJsonValue["sDtSecCode"]=JsonValue::Write(sDtSecCode);
xJsonValue["sSecName"]=JsonValue::Write(sSecName);
xJsonValue["fClose"]=JsonValue::Write(fClose,2);
xJsonValue["fOpen"]=JsonValue::Write(fOpen,2);
xJsonValue["fMax"]=JsonValue::Write(fMax,2);
xJsonValue["fMin"]=JsonValue::Write(fMin,2);
xJsonValue["fNow"]=JsonValue::Write(fNow,2);
xJsonValue["fAmout"]=JsonValue::Write(fAmout,2);
xJsonValue["vBuyp"]=JsonValue::Write(vBuyp,2);
xJsonValue["vBuyv"]=JsonValue::Write(vBuyv,2);
xJsonValue["vSellp"]=JsonValue::Write(vSellp,2);
xJsonValue["vSellv"]=JsonValue::Write(vSellv,2);
return xJsonValue;
}
void DecodeFromJson(const JsonValue&xJsonValue)const
{
xJsonValue.Read(sDtSecCode,2);
xJsonValue.Read(sSecName,2);
xJsonValue.Read(fClose,2);
xJsonValue.Read(fOpen,2);
xJsonValue.Read(fMax,2);
xJsonValue.Read(fMin,2);
xJsonValue.Read(fNow,2);
xJsonValue.Read(fAmout,2);
xJsonValue.Read(vBuyp,2);
xJsonValue.Read(vBuyv,2);
xJsonValue.Read(vSellp,2);
xJsonValue.Read(vSellv,2);
}
public:
PMAP xMAP;
std::string sDtSecCode;
std::string sSecName;
float fClose;
float fOpen;
float fMax;
float fMin;
float fNow;
float fAmout;
vector<float>vBuyp;
vector<float>vBuyv;
vector<float>vSellp;
vector<float>vSellv;
};
in the above example, we translate the defined IDL file into the source code of C + + language, and in the generated C + + file we define the following interfaces:
an enable bit setting interface, such as SetEnable _ sdtsecccode, sets whether the field is transmitted over the network;
an enable bit acquisition interface, GetEnable, for acquiring the enable bit of the whole structure;
coding and decoding other ports such as floating point number according to the mode of aligning to integer by a coding function and an Encode;
decoding a function, Decode, performing inverse operation on the floating point number to obtain an original value;
json coding, EncodeToJson, converting fields according to the precision of floating point numbers, and facilitating display of small programs and other web terminals;
json decoding, DecodeFromJson, converting Json type data into structure numerical values;
as can be seen from the above codes, the enable bit setting interface includes an enable bit setting function of the corresponding protocol field, and the client performs enable setting on the corresponding protocol field by using the enable bit setting function.
Meanwhile, an enable bit acquisition interface is also defined in the source code, and the server side acquires enable bit information of the data request by using the enable bit acquisition interface.
S3, the client end utilizes the enabling bit setting interface to enable and set the protocol field of the data to be requested, and initiates a data request to the server end, wherein the data request comprises the enabling bit information of the protocol field of the requested data;
specifically, when a client needs to request data from a server, a request and influence structure is defined by a translator, so that an enable bit is set. Specifically, the method comprises the following steps:
struct QuoteReq:public Thoth::protocol::Message,public Thoth::protocol::Request
{
public:
QuoteReq()
{
}
void SetRequestPMAP(const PMAP&xPMAP){xMAP.SetRequestPMAP(xPMAP);}
void Encode(Thoth::protocol::BaseOutputStream&os)const
{
::Thoth::protocol::BaseOutputStream ostream(os.getBaseBuffer());
ostream.SetRequestPMAP(xMAP);
ostream.Write((uint16_t)0,vDtSecCode);
}
void Decode(Thoth::protocol::BaseInputStream&is)
{
::Thoth::protocol::BaseInputStream istream(is.getBaseBuffer());
istream.GetRequestPMAP(xMAP);
istream.Read((uint16_t)0,vDtSecCode);
}
public:
PMAP xMAP;
std::vector<std::string>vDtSecCode;
};
struct QuoteRsp:public Thoth::protocol::Message,public Thoth::protocol::Response{
public:
QuoteRsp()
{
}
void Encode(Thoth::protocol::BaseOutputStream&os)const
{
::Thoth::protocol::BaseOutputStream ostream(os.getBaseBuffer());
ostream.Write((uint16_t)0,vQuote);
}
void Decode(Thoth::protocol::BaseInputStream&is)
{
::Thoth::protocol::BaseInputStream istream(is.getBaseBuffer());
istream.GetRequestPMAP(xMAP);
istream.Read((uint16_t)0,vQuote);
}
public:
std::vector<SecQuote>vQuote;
};
the Request structure body inherits the protocol Request and encodes and decodes the PMAP enabling bit, so that the client can conveniently transmit the enabling bit to the server. And the client encodes the enabling bit through an Encode function.
S4, the server receives the data request and obtains the enabling bit information, the enabling bit information is used for the server to determine the protocol field of the data requested by the client;
and after the server receives the data request of the client, the server acquires the PMAP from the network parameters through a Decode function. And obtaining an enabling bit of the whole structure body through an enabling bit obtaining function GetEnable, wherein the enabling bit identifies a protocol field of the client needing to request data. And when data is transmitted, determining transmission parameters according to the enable bit.
And S5, the server determines the data of the protocol field requested by the client according to the enabling bit information, and returns the data of the protocol field to the client.
And the server side returns the data requested by the client side to the client side.
Further, in the existing stock market software, the single-precision and double-precision data transmission fixedly uses 4 bytes and 8 bytes, and the flow is wasted for small-value floating point numbers. Specifically, for the stock market, fields such as opening price, closing price, yesterday closing price, highest price, lowest price, stop-and-go price, volume of bargain, etc., are all floating point types. However, floating point numbers are fixedly transmitted in a network by using 4 bytes or 8 bytes, but if integer transmission is adopted, 1 or 2 bytes are often required for transmission. Therefore, before transmitting data, the server side transmits the data according to the precision specified in the protocol, such as the value: 12.88, precision: 2, to convert to a reshape 1288, the number that would have required 8 direct transmissions now only needs 2 bytes. And after the coding and decoding functions of the server are automatically converted, sending the converted coding and decoding functions to the client. The client automatically converts the numbers into 12.88 according to the specified precision, and then restores the numbers.
In order to achieve the above object, as shown in the embodiments in steps S1 and S2, the method further defines the display precision of the floating point number of each protocol field in the protocol file, and the source code further includes an encoding function and a decoding function, where the encoding function is used to encode, at the server end, the corresponding floating point number according to the display precision of the floating point number of each protocol field in an alignment-to-integer manner to obtain an integer number, and the decoding function is used to decode, at the client end, the integer number back to the floating point number according to the display precision of the floating point number of each protocol field.
In addition, Json coding and decoding functions can be set, fields can be converted according to the precision of floating point numbers, and web end display of small programs and the like is facilitated. Specifically, in order to achieve the above object, the method further defines the display precision of the floating point number of each protocol field in the protocol file, the source code further includes a Json encoding function and a Json decoding function, the Json encoding function is used for encoding and converting the corresponding floating point number according to the display precision of the floating point number of each protocol field at the server end to obtain Json type data, and the Json decoding function is used for converting the received Json type data into a structure value at the client end so as to be displayed at the client end.
Furthermore, in the existing security software, the display precision of the floating point number of the client depends on the prior convention, and the subsequent expansion is not facilitated. In order to solve the problems, when the stock quotation is displayed, the stock quotation is displayed according to the precision of each field, and at the moment, the client can directly call the precision acquisition function from the IDL translation file to obtain the display precision of each field, so that the stock quotation is displayed on the client. Specifically, the method of the present invention further comprises:
and S6, after receiving and decoding the floating point number by the client, displaying the floating point number on the client according to the display precision.
Further, as shown in fig. 2, as a schematic flow diagram of extensible securities market data processing in an embodiment of the present invention, an IDL file is defined, a protocol field of the securities market data and a corresponding display precision are defined in the IDL file, the IDL file is translated into a source file of a corresponding language through a translation program, and an enable bit operation function is implemented, a user sets an enable bit through the enable bit operation function in a client and performs an enable bit encoding to generate a request structure, the request structure is transmitted to a server through network data, the server decodes the request structure and decodes the enable bit to read original data of the corresponding field according to the enable bit, the server converts a floating point number according to the precision to generate an integer number, and then encodes the integer number to send the data to the client.
Further, as shown in fig. 3, the present invention also provides an extensible stock market data transmission display system, which includes a client and a server, wherein:
the client and the server both comprise source codes, wherein the source codes are obtained by translating a protocol file into a preset language by using a translator, an enabling bit of each protocol field is defined in the source codes, an enabling bit setting interface is defined, the protocol file is defined by adopting an interface description language, and the protocol file comprises protocol fields of stock market data;
the client is used for enabling and setting the protocol field needing to request data by using the enabling bit setting interface and initiating a data request to the server, wherein the data request comprises enabling bit information of the protocol field of the requested data;
the server is used for receiving the data request and obtaining the enabling bit information, and the enabling bit information is used for the server to determine a protocol field of the client needing to request data;
and the server is used for acquiring the data of the protocol field requested by the client according to the enabling bit information and returning the data of the protocol field to the client.
Furthermore, the protocol file also defines the display precision of the floating point number of each protocol field, the source code also includes an encoding function and a decoding function, the encoding function is used for encoding the corresponding floating point number according to the display precision of the floating point number of each protocol field in an alignment-to-integer manner at the server end to obtain an integer number, and the decoding function is used for decoding the integer number back to the floating point number at the client end according to the display precision of the floating point number of each protocol field.
And further, after receiving and decoding the floating point number by the client, displaying the floating point number on the client according to the display precision.
It will be understood by those skilled in the art that the foregoing is only a preferred embodiment of the present invention, and is not intended to limit the invention, and that any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (8)

1. An extensible stock market data transmission display method is characterized by comprising the following steps:
defining a protocol file by adopting an interface description language, wherein the protocol file comprises a protocol field of stock market data;
translating the protocol file into a source code of a preset language by using a translator, wherein the source code defines an enabling bit of each protocol field and defines an enabling bit setting interface;
the client end utilizes the enabling bit setting interface to enable and set the protocol field of the data to be requested and initiates a data request to the server end, wherein the data request comprises enabling bit information of the protocol field of the requested data;
the server receives the data request and obtains the enabling bit information, and the enabling bit information is used for the server to determine a protocol field of the data required to be requested by the client;
the server side determines the data of the protocol field requested by the client side according to the enabling bit information and returns the data of the protocol field to the client side;
the enabling bit setting interface comprises an enabling bit setting function of a corresponding protocol field, and the client utilizes the enabling bit setting function to enable and set the corresponding protocol field; and defining an enabling bit acquisition interface in the source code, and acquiring enabling bit information of the data request by the server side by using the enabling bit acquisition interface.
2. The scalable security market data transmission display method of claim 1, wherein the protocol file further defines a display precision of a floating point number of each protocol field, the source code further includes an encoding function and a decoding function, the encoding function is configured to encode, at the server, a corresponding floating point number according to the display precision of the floating point number of each protocol field in an alignment-to-integer manner to obtain an integer number, and the decoding function is configured to decode, at the client, the integer number back to the floating point number according to the display precision of the floating point number of each protocol field.
3. The scalable security market data transmission display method of claim 2, wherein the floating point number is displayed at the client according to the display precision after the floating point number is received and decoded by the client.
4. The scalable security market data transmission display method of claim 1, wherein the protocol file further defines a display precision of a floating point number of each protocol field, the source code further includes a Json encoding function and a Json decoding function, the Json encoding function is used at the server end to encode and convert a corresponding floating point number according to the display precision of the floating point number of each protocol field to obtain Json type data, and the Json decoding function is used at the client end to convert the received Json type data into a structure value so as to be displayed at the client end.
5. The scalable security quote data transmission presentation method of claim 1 or 2, wherein the protocol file defines a security quote comprising fields of one or more of: opening price, closing price, yesterday closing price, highest price, lowest price, current price, stop price, volume of transaction, price for buying in five gear, quantity of buying in five gear, price for selling in five gear or quantity of selling in five gear.
6. An extensible stock market data transmission display system, comprising a client and a server, wherein:
the client and the server both comprise source codes, wherein the source codes are obtained by translating a protocol file into a preset language by using a translator, an enabling bit of each protocol field is defined in the source codes, an enabling bit setting interface is defined, the protocol file is defined by adopting an interface description language, and the protocol file comprises protocol fields of stock market data;
the client is used for enabling and setting the protocol field needing to request data by using the enabling bit setting interface and initiating a data request to the server, wherein the data request comprises enabling bit information of the protocol field of the requested data;
the server is used for receiving the data request and obtaining the enabling bit information, and the enabling bit information is used for the server to determine a protocol field of the client needing to request data;
the server side is used for acquiring the data of the protocol field requested by the client side according to the enabling bit information and returning the data of the protocol field to the client side;
the enabling bit setting interface comprises an enabling bit setting function of a corresponding protocol field, and the client utilizes the enabling bit setting function to enable and set the corresponding protocol field; and defining an enabling bit acquisition interface in the source code, and acquiring enabling bit information of the data request by the server side by using the enabling bit acquisition interface.
7. The scalable security market data transmission display system of claim 6, wherein the protocol file further defines a display precision of a floating point number of each protocol field, the source code further comprises an encoding function and a decoding function, the encoding function is configured to encode, at the server, the corresponding floating point number according to the display precision of the floating point number of each protocol field in an alignment-to-integer manner to obtain an integer number, and the decoding function is configured to decode, at the client, the integer number back to the floating point number according to the display precision of the floating point number of each protocol field.
8. The scalable security market data transmission display system of claim 7, wherein the floating point number is displayed at the client according to the display precision after the floating point number is received and decoded by the client.
CN201810756706.9A 2018-07-11 2018-07-11 Extensible securities market data transmission display method and system Active CN109062574B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810756706.9A CN109062574B (en) 2018-07-11 2018-07-11 Extensible securities market data transmission display method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810756706.9A CN109062574B (en) 2018-07-11 2018-07-11 Extensible securities market data transmission display method and system

Publications (2)

Publication Number Publication Date
CN109062574A CN109062574A (en) 2018-12-21
CN109062574B true CN109062574B (en) 2022-02-18

Family

ID=64815891

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810756706.9A Active CN109062574B (en) 2018-07-11 2018-07-11 Extensible securities market data transmission display method and system

Country Status (1)

Country Link
CN (1) CN109062574B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112583878B (en) * 2019-09-30 2023-03-14 阿波罗智能技术(北京)有限公司 Vehicle information checking method, device, equipment and medium
CN111104776A (en) * 2019-12-23 2020-05-05 苏州思必驰信息科技有限公司 Floating point number processing method and device and electronic equipment
CN112291041B (en) * 2020-10-22 2022-05-27 山东云海国创云计算装备产业创新中心有限公司 Data decoding device and method based on FPGA
CN114124878B (en) * 2022-01-27 2022-04-22 深圳华锐金融技术股份有限公司 Market data issuing method, device, system, equipment and medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101267281A (en) * 2008-04-25 2008-09-17 北京中企开源信息技术有限公司 A transmission method and system for securities market data
CN103297186A (en) * 2012-02-29 2013-09-11 富士通株式会社 Data transmission apparatus, data transmission system and data transmission method
CN103812878A (en) * 2014-03-17 2014-05-21 哈尔滨理工大学 Android-based road condition information interaction system
WO2014100725A1 (en) * 2012-12-21 2014-06-26 Micronics, Inc. Portable fluorescence detection system and microassay cartridge
CN105373556A (en) * 2014-08-26 2016-03-02 凌群电脑股份有限公司 Quick data acquisition method with high transmission property and correctness
CN106502932A (en) * 2016-09-20 2017-03-15 中国科学院自动化研究所 The method of interconnecting interface and its write operation and read operation between the piece based on hierarchy
CN107301098A (en) * 2017-06-15 2017-10-27 搜易贷(北京)金融信息服务有限公司 A kind of remote procedure call device based on Thrift agreements, method and system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101267281A (en) * 2008-04-25 2008-09-17 北京中企开源信息技术有限公司 A transmission method and system for securities market data
CN103297186A (en) * 2012-02-29 2013-09-11 富士通株式会社 Data transmission apparatus, data transmission system and data transmission method
WO2014100725A1 (en) * 2012-12-21 2014-06-26 Micronics, Inc. Portable fluorescence detection system and microassay cartridge
CN103812878A (en) * 2014-03-17 2014-05-21 哈尔滨理工大学 Android-based road condition information interaction system
CN105373556A (en) * 2014-08-26 2016-03-02 凌群电脑股份有限公司 Quick data acquisition method with high transmission property and correctness
CN106502932A (en) * 2016-09-20 2017-03-15 中国科学院自动化研究所 The method of interconnecting interface and its write operation and read operation between the piece based on hierarchy
CN107301098A (en) * 2017-06-15 2017-10-27 搜易贷(北京)金融信息服务有限公司 A kind of remote procedure call device based on Thrift agreements, method and system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
性能优化二十之数据传输效率优化-FlatBuffers;Kiven_Android;《https://blog.csdn.net/hpc19950723/article/details/70834926》;20170427;第1-5页 *

Also Published As

Publication number Publication date
CN109062574A (en) 2018-12-21

Similar Documents

Publication Publication Date Title
CN109062574B (en) Extensible securities market data transmission display method and system
WO2017156916A1 (en) Data access method and device
US20100146127A1 (en) User-mode based remote desktop protocol (rdp) encoding architecture
EP0928070A2 (en) Compression of documents with markup language that preserves syntactical structure
US8751689B2 (en) Serialization and distribution of serialized content using socket-based communication
CN111104776A (en) Floating point number processing method and device and electronic equipment
CN113489805B (en) Butt joint method, device, equipment and storage medium of cloud desktop system
WO2023066183A1 (en) Data processing method and apparatus, device, and storage medium
CN113905241A (en) Video coding
CN110807111A (en) Three-dimensional graph processing method and device, storage medium and electronic equipment
CN108388549B (en) Information conversion method, information conversion device, storage medium and electronic device
CN114492316A (en) Data exchange coding and decoding method and system
US8983866B2 (en) Automated encoding of delta operators
US20120259754A1 (en) Automated encoding of field operators
US20140327698A1 (en) System and method for hybrid graphics and text rendering and client computer and graphics processing unit incorporating the same
US8489492B2 (en) Automated encoding of increment operators
CN105024923B (en) The method and device that message category based on XMPP extension message is realized
US8972497B2 (en) Automated encoding of field operators for absent fields
CN110548285B (en) Game communication control method and device, medium and electronic equipment
CN107332891B (en) HTTP request processing method, server and client
CN113779018A (en) Data processing method and device
CN112749353A (en) Processing method and device of webpage icon
CN112367294A (en) Network communication method between multiple hosts adapting to edge computing architecture
CN107920075A (en) A kind of system of data processing
CN104202335A (en) XML (extensive markup language) based simplified SAP (service access point) data transmission method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CB03 Change of inventor or designer information

Inventor after: Zhu Liufeng

Inventor after: Tian Shuning

Inventor after: Rong Qiang

Inventor before: Tian Shuning

Inventor before: Zhu Liufeng

Inventor before: Rong Qiang

CB03 Change of inventor or designer information
TR01 Transfer of patent right

Effective date of registration: 20240318

Address after: 430000 Taizhong Avenue, Gaoqiao Industrial Park, Taiwan investment zone, Dongxihu District, Wuhan City, Hubei Province

Patentee after: Lighthouse Technology Co.,Ltd.

Country or region after: China

Address before: Room 08, 15 / F, building 2, phase I, modern international design city, 41 Guanggu Avenue, Donghu New Technology Development Zone, Wuhan City, Hubei Province, 430000

Patentee before: WUHAN DENGTA ZHIGUANG TECHNOLOGY Co.,Ltd.

Country or region before: China

TR01 Transfer of patent right