CN116483747B - Quotation snapshot issuing method, device, equipment and medium - Google Patents

Quotation snapshot issuing method, device, equipment and medium Download PDF

Info

Publication number
CN116483747B
CN116483747B CN202310758698.2A CN202310758698A CN116483747B CN 116483747 B CN116483747 B CN 116483747B CN 202310758698 A CN202310758698 A CN 202310758698A CN 116483747 B CN116483747 B CN 116483747B
Authority
CN
China
Prior art keywords
snapshot
issuing
issued
client
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.)
Active
Application number
CN202310758698.2A
Other languages
Chinese (zh)
Other versions
CN116483747A (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.)
Huarui Distributed Beijing Technology Co ltd
Shenzhen Huarui Distributed Technology Co ltd
Original Assignee
Huarui Distributed Beijing Technology Co ltd
Shenzhen Huarui Distributed 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 Huarui Distributed Beijing Technology Co ltd, Shenzhen Huarui Distributed Technology Co ltd filed Critical Huarui Distributed Beijing Technology Co ltd
Priority to CN202310758698.2A priority Critical patent/CN116483747B/en
Publication of CN116483747A publication Critical patent/CN116483747A/en
Application granted granted Critical
Publication of CN116483747B publication Critical patent/CN116483747B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0877Cache access modes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/06Asset management; Financial planning or analysis
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Physics & Mathematics (AREA)
  • Finance (AREA)
  • General Physics & Mathematics (AREA)
  • Accounting & Taxation (AREA)
  • Development Economics (AREA)
  • Entrepreneurship & Innovation (AREA)
  • General Engineering & Computer Science (AREA)
  • Game Theory and Decision Science (AREA)
  • Human Resources & Organizations (AREA)
  • Operations Research (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • General Business, Economics & Management (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to the technical field of big data, and provides a method, a device, equipment and a medium for issuing a quotation snapshot, which can perform format standardization processing on snapshot data issued by a trade exchange to obtain a snapshot to be issued, and perform standardization processing on the snapshot format before caching, so that a downstream client API (application program interface) is not required to be changed when the snapshot is issued, the snapshot to be issued is issued to a client initiating a real-time subscription request on the snapshot data, and bypass caching is performed on the snapshot to be issued by utilizing an asynchronous cache thread, on one hand, the snapshot data is issued in real time preferentially, on the other hand, snapshot storage is performed by a caching technology, so that the snapshot is directly obtained from the cache when the snapshot is issued subsequently, the issuing efficiency of the quotation snapshot is improved, when the snapshot subscription request initiated by any client is received, a filtering result is obtained based on the cache, a snapshot issuing strategy of any client is generated according to the filtering result, and the issuing filtering record is updated, and the snapshot is prevented from being issued repeatedly.

Description

Quotation snapshot issuing method, device, equipment and medium
Technical Field
The present invention relates to the field of big data technologies, and in particular, to a method, an apparatus, a device, and a medium for issuing a quotation snapshot.
Background
With the continuous opening of the financial market, investors have increasingly high degrees of organization, quantification and participation in the market by high-frequency transactions, and are extremely sensitive to time delay, and even a delay of 1 microsecond can have a decisive influence on the execution of high-speed transactions, and even finally influence the coil-mouth trading and investment benefits.
However, according to different varieties, the real-time snapshot market of the current exchange has fixed update frequency, the update frequency of inactive security codes is lower, the interval is longer, and the update interval of certain security codes is as long as 10 seconds, so that when a user newly adds a security code subscription or accesses in a disk, the corresponding snapshot market information can be obtained only by waiting for a fixed update interval or even longer, and the requirement of clients on timely obtaining market information in the scenes can not be met.
Disclosure of Invention
In view of the foregoing, it is necessary to provide a method, apparatus, device and medium for issuing a quotation snapshot, which aims to solve the problem of low issuing efficiency of the latest quotation snapshot.
A quotation snapshot issuing method, the quotation snapshot issuing method comprising:
when snapshot data issued by an exchange are received, carrying out format standardization processing on the snapshot data to obtain a snapshot to be issued;
Issuing the snapshot to be issued to a client for initiating a real-time subscription request to the snapshot data, and performing bypass caching on the snapshot to be issued by utilizing an asynchronous cache thread;
when a snapshot subscription request initiated by any client is received, filtering and re-processing is carried out based on the cache, so as to obtain a filtering and re-processing result;
and generating a snapshot issuing strategy for any client according to the filtering and repeating result, and updating an issuing filtering and repeating record.
According to a preferred embodiment of the present invention, the performing format normalization processing on the snapshot data, to obtain a snapshot to be issued includes:
analyzing the snapshot data to obtain first data;
acquiring the quotation type of the snapshot data;
acquiring a pre-configured data format corresponding to the quotation type of the snapshot data;
and transcoding the first data according to the data format to obtain the snapshot to be issued.
According to a preferred embodiment of the present invention, the performing bypass caching on the snapshot to be issued by using an asynchronous cache thread includes:
sending the snapshot to be issued to a lock-free message queue by using the asynchronous cache thread and performing asynchronous dequeuing from the lock-free message queue to a cache;
Determining the historical issuing condition of the snapshot to be issued at each client;
synchronously recording the historical issuing conditions of the snapshot to be issued at each client in the cache by using a BitSet data structure;
when caching, for each security code, only the snapshot to be issued corresponding to the latest snapshot data is stored.
According to a preferred embodiment of the invention, the method further comprises:
when the random client is detected to be accessed in a disk for initial subscription, determining that the snapshot subscription request is received; or alternatively
And when detecting that the random client dynamically subscribes to a new security code, determining that the snapshot subscription request is received.
According to a preferred embodiment of the present invention, the filtering processing based on the cache to obtain a filtering result includes:
determining the latest target snapshot subscribed by the arbitrary client according to the snapshot subscription request;
acquiring the historical launching condition of the target snapshot recorded in the cache at any client as a target launching record;
when the target issuing record shows that the target snapshot has an issuing record at the optional client, determining the filtering result as a first result; or alternatively
And when the target issuing record shows that the target snapshot does not issue records at any client, determining the filtering result as a second result.
According to a preferred embodiment of the present invention, the generating a snapshot issuing policy for the arbitrary client according to the filtering result includes:
when the filtering result is the first result, determining that the snapshot issuing strategy is not to issue the target snapshot to the arbitrary client; or alternatively
And when the filtering result is the second result, determining that the snapshot issuing strategy is to issue the target snapshot to the optional client.
According to a preferred embodiment of the present invention, the updating the downloading filter re-record includes:
when the snapshot issuing policy is that the target snapshot is not issued to the arbitrary client, the issuing filtering re-record is not updated; or alternatively
When the snapshot issuing policy is to issue the target snapshot to the arbitrary client, after detecting to issue the target snapshot to the arbitrary client, updating the historical issuing condition of the target snapshot in the issuing filtering record to the arbitrary client.
A quotation snapshot issuing device, the quotation snapshot issuing device comprising:
The processing unit is used for carrying out format normalization processing on the snapshot data when receiving the snapshot data issued by the exchange to obtain a snapshot to be issued;
the cache unit is used for sending the snapshot to be sent to a client side initiating a real-time subscription request to the snapshot data, and carrying out bypass cache on the snapshot to be sent by utilizing an asynchronous cache thread;
the filtering unit is used for filtering the weight based on the cache to obtain a filtering result when receiving a snapshot subscription request initiated by any client;
and the generating unit is used for generating a snapshot issuing strategy for any client according to the filtering and re-recording result and updating the issuing filtering and re-recording record.
A computer device, the computer device comprising:
a memory storing at least one instruction; and
And the processor executes the instructions stored in the memory to realize the quotation snapshot issuing method.
A computer-readable storage medium having stored therein at least one instruction for execution by a processor in a computer device to implement the quotation snapshot issuing method.
According to the technical scheme, the method and the system can normalize the format of the snapshot data issued by the exchange to obtain the snapshot to be issued, the snapshot format is normalized before caching, so that an API interface of a downstream client is not required to be changed when the snapshot is issued, the snapshot to be issued is issued to the client initiating the real-time subscription request to the snapshot data, and the snapshot to be issued is cached by utilizing an asynchronous cache thread, on one hand, the snapshot data are issued in real time preferentially, on the other hand, the snapshot is stored through a caching technology, so that the snapshot is directly obtained from the cache when the snapshot is issued subsequently, response of the exchange is not required to be waited, the issuing efficiency of the quotation snapshot is improved, when the snapshot subscription request initiated by any client is received, filtering and repeating processing are carried out based on the cache to obtain a filtering result, and the snapshot issuing strategy to any client is generated according to the filtering result, and the issuing filtering and repeating record is updated, so that the snapshot is prevented from being issued repeatedly.
Drawings
FIG. 1 is a flow chart of a preferred embodiment of the method for issuing a snapshot of a market according to the present invention.
FIG. 2 is a functional block diagram of a preferred embodiment of the instant invention.
FIG. 3 is a block diagram of a computer device for implementing a preferred embodiment of a method for issuing a snapshot of a market according to the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in detail with reference to the accompanying drawings and specific embodiments.
FIG. 1 is a flow chart of a preferred embodiment of the method for issuing a snapshot of a market according to the present invention. The order of the steps in the flowchart may be changed and some steps may be omitted according to various needs.
The market snapshot issuing method is applied to one or more computer devices, wherein the computer device is a device capable of automatically performing numerical calculation and/or information processing according to preset or stored instructions, and the hardware of the computer device comprises, but is not limited to, a microprocessor, an application specific integrated circuit (Application Specific Integrated Circuit, an ASIC), a programmable gate array (Field-Programmable Gate Array, an FPGA), a digital processor (Digital Signal Processor, a DSP), an embedded device and the like.
The computer device may be any electronic product that can interact with a user in a human-computer manner, such as a personal computer, tablet computer, smart phone, personal digital assistant (Personal Digital Assistant, PDA), game console, interactive internet protocol television (Internet Protocol Television, IPTV), smart wearable device, etc.
The computer device may also include a network device and/or a user device. Wherein the network device includes, but is not limited to, a single network server, a server group composed of a plurality of network servers, or a Cloud based Cloud Computing (Cloud Computing) composed of a large number of hosts or network servers.
The server may be an independent server, or may be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and basic cloud computing services such as big data and artificial intelligence platforms.
Among these, artificial intelligence (Artificial Intelligence, AI) is the theory, method, technique and application system that uses a digital computer or a digital computer-controlled machine to simulate, extend and extend human intelligence, sense the environment, acquire knowledge and use knowledge to obtain optimal results.
Artificial intelligence infrastructure technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a robot technology, a biological recognition technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and other directions.
The network in which the computer device is located includes, but is not limited to, the internet, a wide area network, a metropolitan area network, a local area network, a virtual private network (Virtual Private Network, VPN), and the like.
And S10, when snapshot data issued by the exchange are received, carrying out format standardization processing on the snapshot data to obtain a snapshot to be issued.
In this embodiment, the performing format normalization processing on the snapshot data, to obtain a snapshot to be issued includes:
analyzing the snapshot data to obtain first data;
acquiring the quotation type of the snapshot data;
acquiring a pre-configured data format corresponding to the quotation type of the snapshot data;
and transcoding the first data according to the data format to obtain the snapshot to be issued.
Wherein the quotation types include, but are not limited to: spot type, index type, stock type, etc.
Each quotation type corresponds to different data formats, format standardization processing is performed before caching of the quotation snapshot, and subscription scenes of snapshot data of all quotation types are covered comprehensively, so that format conversion is not needed when snapshot issuing is performed subsequently, a downstream client API (Application Programming Interface ) interface is not needed to be changed, and issuing efficiency is improved.
S11, the snapshot to be issued is issued to a client side which initiates a real-time subscription request to the snapshot data, and bypass caching is carried out on the snapshot to be issued by utilizing an asynchronous cache thread.
In this embodiment, the snapshot to be issued is preferentially issued to the client that initiates the real-time subscription request to the snapshot data, so as to respond to the quotation subscription request in time, and ensure the real-time issuing efficiency of the quotation snapshot.
In this embodiment, the performing, by-pass caching on the snapshot to be issued by using an asynchronous cache thread includes:
sending the snapshot to be issued to a lock-free message queue by using the asynchronous cache thread and performing asynchronous dequeuing from the lock-free message queue to a cache;
Determining the historical issuing condition of the snapshot to be issued at each client;
synchronously recording the historical issuing conditions of the snapshot to be issued at each client in the cache by using a BitSet data structure;
when caching, for each security code, only the snapshot to be issued corresponding to the latest snapshot data is stored.
The BitSet data structure can be used for carrying out bitwise operation on the data types, so that the caching efficiency is improved.
Wherein, the storing and indexing can be rapidly performed through the unorded_map.
In the embodiment, zero copies of snapshot messages are sent to the message queue without locks, and then the messages are dequeued and cached in an out-of-step mode, so that the reading and writing efficiency is improved.
In the above embodiment, the fast cache of the snapshot to be issued can be implemented through the unordered_map, and meanwhile, because the BitSet data structure has the attribute of being fast and consuming less time, the historical issuing condition of the snapshot to be issued in each client can be synchronously recorded in the cache by using the BitSet data structure, so that the fast record of the historical issuing condition can be implemented, and the time consumption of the cache operation is further reduced.
And S12, when a snapshot subscription request initiated by any client is received, filtering and re-processing is performed based on the cache, and a filtering and re-processing result is obtained.
In this embodiment, the issuing of the latest quotation snapshot is triggered under the following two conditions, and specifically, the method further includes:
when the random client is detected to be accessed in a disk for initial subscription, determining that the snapshot subscription request is received; or alternatively
And when detecting that the random client dynamically subscribes to a new security code, determining that the snapshot subscription request is received.
And triggering the snapshot subscription request under the two conditions so as to rapidly issue the quotation snapshot.
In this embodiment, the filtering processing based on the cache to obtain a filtering result includes:
determining the latest target snapshot subscribed by the arbitrary client according to the snapshot subscription request;
acquiring the historical launching condition of the target snapshot recorded in the cache at any client as a target launching record;
when the target issuing record shows that the target snapshot has an issuing record at the optional client, determining the filtering result as a first result; or alternatively
And when the target issuing record shows that the target snapshot does not issue records at any client, determining the filtering result as a second result.
S13, generating a snapshot issuing strategy for any client according to the filtering and repeating result, and updating an issuing filtering and repeating record.
In this embodiment, the generating a snapshot issuing policy for the arbitrary client according to the filtering result includes:
when the filtering result is the first result, determining that the snapshot issuing strategy is not to issue the target snapshot to the arbitrary client; or alternatively
And when the filtering result is the second result, determining that the snapshot issuing strategy is to issue the target snapshot to the optional client.
Specifically, when the filtering result is the first result, the target issuing record displays that the target snapshot has an issuing record at the arbitrary client, which indicates that the target snapshot is issued to the arbitrary client, so that the snapshot issuing policy can be determined not to issue the target snapshot to the arbitrary client without repeating the issuing to the arbitrary client.
Conversely, when the filtering result is the second result, the target issuing record shows that the target snapshot has no issuing record at the arbitrary client, which indicates that the target snapshot has not been issued to the arbitrary client, so that the target snapshot needs to be issued to the arbitrary client, and the snapshot issuing policy may be determined to be issued to the arbitrary client.
In the embodiment, the snapshot issuing strategy is determined through filtering and reprocessing, so that the problem of repeated subscription and repeated issuing of the quotation snapshots can be effectively avoided.
In this embodiment, the updating the sending filter re-record includes:
when the snapshot issuing policy is that the target snapshot is not issued to the arbitrary client, the issuing filtering re-record is not updated; or alternatively
When the snapshot issuing policy is to issue the target snapshot to the arbitrary client, after detecting to issue the target snapshot to the arbitrary client, updating the historical issuing condition of the target snapshot in the issuing filtering record to the arbitrary client.
In the above embodiment, the issue filtering re-record is updated according to different snapshot issue policies, so that the problem of repeated subscription and repeated issue of the quotation snapshots can be further avoided.
According to the embodiment, under the condition that the current real-time quotation issuing of the system is not affected, the latest snapshot quotation information of the current cached real-time quotation can be immediately issued according to the subscription conditions aiming at the client-side dynamic newly-added quotation code subscription and the initial subscription of the accessed client-side in the disk by means of asynchronous caching technology and filtering and re-processing, the next updating interval of the exchange (namely, the exchange quotation fixed updating interval is usually in seconds, and the quotation snapshot is issued at the fixed time interval because of the exchange, so that the exchange is required to be waited) is not needed, and the snapshot waiting time of the client-side is shortened to be in a subtle level, so that the method is particularly suitable for the snapshot information of the quotation code with longer snapshot updating interval, such as private recruitment and quantization exchange with higher quotation data delay requirement on the quotation system, and a high-frequency exchange.
According to the technical scheme, the method and the system can normalize the format of the snapshot data issued by the exchange to obtain the snapshot to be issued, the snapshot format is normalized before caching, so that an API interface of a downstream client is not required to be changed when the snapshot is issued, the snapshot to be issued is issued to the client initiating the real-time subscription request to the snapshot data, and the snapshot to be issued is cached by utilizing an asynchronous cache thread, on one hand, the snapshot data are issued in real time preferentially, on the other hand, the snapshot is stored through a caching technology, so that the snapshot is directly obtained from the cache when the snapshot is issued subsequently, response of the exchange is not required to be waited, the issuing efficiency of the quotation snapshot is improved, when the snapshot subscription request initiated by any client is received, filtering and repeating processing are carried out based on the cache to obtain a filtering result, and the snapshot issuing strategy to any client is generated according to the filtering result, and the issuing filtering and repeating record is updated, so that the snapshot is prevented from being issued repeatedly.
FIG. 2 is a functional block diagram of a preferred embodiment of the instant invention. The market snapshot issuing device 11 includes a processing unit 110, a buffer unit 111, a filtering unit 112, and a generating unit 113. The module/unit referred to in the present invention refers to a series of computer program segments, which are stored in a memory, capable of being executed by a processor and of performing a fixed function. In the present embodiment, the functions of the respective modules/units will be described in detail in the following embodiments.
The processing unit 110 is configured to, when receiving snapshot data issued by the exchange, perform format normalization processing on the snapshot data to obtain a snapshot to be issued.
In this embodiment, the processing unit 110 performs format normalization processing on the snapshot data, and obtaining the snapshot to be issued includes:
analyzing the snapshot data to obtain first data;
acquiring the quotation type of the snapshot data;
acquiring a pre-configured data format corresponding to the quotation type of the snapshot data;
and transcoding the first data according to the data format to obtain the snapshot to be issued.
Wherein the quotation types include, but are not limited to: spot type, index type, stock type, etc.
Each quotation type corresponds to different data formats, format standardization processing is performed before caching of the quotation snapshot, and subscription scenes of snapshot data of all quotation types are covered comprehensively, so that format conversion is not needed when snapshot issuing is performed subsequently, a downstream client API (Application Programming Interface ) interface is not needed to be changed, and issuing efficiency is improved.
The caching unit 111 is configured to issue the snapshot to be issued to a client that initiates a real-time subscription request to the snapshot data, and bypass-cache the snapshot to be issued by using an asynchronous cache thread.
In this embodiment, the snapshot to be issued is preferentially issued to the client that initiates the real-time subscription request to the snapshot data, so as to respond to the quotation subscription request in time, and ensure the real-time issuing efficiency of the quotation snapshot.
In this embodiment, the caching unit 111 uses an asynchronous cache thread to bypass the to-be-issued snapshot, including:
sending the snapshot to be issued to a lock-free message queue by using the asynchronous cache thread and performing asynchronous dequeuing from the lock-free message queue to a cache;
determining the historical issuing condition of the snapshot to be issued at each client;
synchronously recording the historical issuing conditions of the snapshot to be issued at each client in the cache by using a BitSet data structure;
when caching, for each security code, only the snapshot to be issued corresponding to the latest snapshot data is stored.
The BitSet data structure can be used for carrying out bitwise operation on the data types, so that the caching efficiency is improved.
Wherein, the storing and indexing can be rapidly performed through the unorded_map.
In the embodiment, zero copies of snapshot messages are sent to the message queue without locks, and then the messages are dequeued and cached in an out-of-step mode, so that the reading and writing efficiency is improved.
In the above embodiment, the fast cache of the snapshot to be issued can be implemented through the unordered_map, and meanwhile, because the BitSet data structure has the attribute of being fast and consuming less time, the historical issuing condition of the snapshot to be issued in each client can be synchronously recorded in the cache by using the BitSet data structure, so that the fast record of the historical issuing condition can be implemented, and the time consumption of the cache operation is further reduced.
The filtering unit 112 is configured to perform filtering processing based on the cache when a snapshot subscription request initiated by an arbitrary client is received, so as to obtain a filtering result.
In this embodiment, the issuing of the latest quotation snapshot is triggered under the following two conditions, specifically, when detecting that the random client accesses in the disk to perform initial subscription, determining that the snapshot subscription request is received; or alternatively
And when detecting that the random client dynamically subscribes to a new security code, determining that the snapshot subscription request is received.
And triggering the snapshot subscription request under the two conditions so as to rapidly issue the quotation snapshot.
In this embodiment, the filtering unit 112 performs filtering processing based on the cache, and the obtaining a filtering result includes:
determining the latest target snapshot subscribed by the arbitrary client according to the snapshot subscription request;
acquiring the historical launching condition of the target snapshot recorded in the cache at any client as a target launching record;
when the target issuing record shows that the target snapshot has an issuing record at the optional client, determining the filtering result as a first result; or alternatively
And when the target issuing record shows that the target snapshot does not issue records at any client, determining the filtering result as a second result.
The generating unit 113 is configured to generate a snapshot issuing policy for the arbitrary client according to the filtering result, and update an issuing filtering record.
In this embodiment, the generating unit 113 generates, according to the filtering result, a snapshot issuing policy to the arbitrary client, including:
when the filtering result is the first result, determining that the snapshot issuing strategy is not to issue the target snapshot to the arbitrary client; or alternatively
And when the filtering result is the second result, determining that the snapshot issuing strategy is to issue the target snapshot to the optional client.
Specifically, when the filtering result is the first result, the target issuing record displays that the target snapshot has an issuing record at the arbitrary client, which indicates that the target snapshot is issued to the arbitrary client, so that the snapshot issuing policy can be determined not to issue the target snapshot to the arbitrary client without repeating the issuing to the arbitrary client.
Conversely, when the filtering result is the second result, the target issuing record shows that the target snapshot has no issuing record at the arbitrary client, which indicates that the target snapshot has not been issued to the arbitrary client, so that the target snapshot needs to be issued to the arbitrary client, and the snapshot issuing policy may be determined to be issued to the arbitrary client.
In the embodiment, the snapshot issuing strategy is determined through filtering and reprocessing, so that the problem of repeated subscription and repeated issuing of the quotation snapshots can be effectively avoided.
In this embodiment, the updating the sending-down filter re-record by the generating unit 113 includes:
When the snapshot issuing policy is that the target snapshot is not issued to the arbitrary client, the issuing filtering re-record is not updated; or alternatively
When the snapshot issuing policy is to issue the target snapshot to the arbitrary client, after detecting to issue the target snapshot to the arbitrary client, updating the historical issuing condition of the target snapshot in the issuing filtering record to the arbitrary client.
In the above embodiment, the issue filtering re-record is updated according to different snapshot issue policies, so that the problem of repeated subscription and repeated issue of the quotation snapshots can be further avoided.
According to the embodiment, under the condition that the current real-time quotation issuing of the system is not affected, the latest snapshot quotation information of the current cached real-time quotation can be immediately issued according to the subscription conditions aiming at the client-side dynamic newly-added quotation code subscription and the initial subscription of the accessed client-side in the disk by means of asynchronous caching technology and filtering and re-processing, the next updating interval of the exchange (namely, the exchange quotation fixed updating interval is usually in seconds, and the quotation snapshot is issued at the fixed time interval because of the exchange, so that the exchange is required to be waited) is not needed, and the snapshot waiting time of the client-side is shortened to be in a subtle level, so that the method is particularly suitable for the snapshot information of the quotation code with longer snapshot updating interval, such as private recruitment and quantization exchange with higher quotation data delay requirement on the quotation system, and a high-frequency exchange.
According to the technical scheme, the method and the system can normalize the format of the snapshot data issued by the exchange to obtain the snapshot to be issued, the snapshot format is normalized before caching, so that an API interface of a downstream client is not required to be changed when the snapshot is issued, the snapshot to be issued is issued to the client initiating the real-time subscription request to the snapshot data, and the snapshot to be issued is cached by utilizing an asynchronous cache thread, on one hand, the snapshot data are issued in real time preferentially, on the other hand, the snapshot is stored through a caching technology, so that the snapshot is directly obtained from the cache when the snapshot is issued subsequently, response of the exchange is not required to be waited, the issuing efficiency of the quotation snapshot is improved, when the snapshot subscription request initiated by any client is received, filtering and repeating processing are carried out based on the cache to obtain a filtering result, and the snapshot issuing strategy to any client is generated according to the filtering result, and the issuing filtering and repeating record is updated, so that the snapshot is prevented from being issued repeatedly.
Fig. 3 is a schematic structural diagram of a computer device according to a preferred embodiment of the present invention for implementing a market snapshot issuing method.
The computer device 1 may comprise a memory 12, a processor 13 and a bus, and may further comprise a computer program, such as a snapshot issuing program, stored in the memory 12 and executable on the processor 13.
It will be appreciated by those skilled in the art that the schematic diagram is merely an example of the computer device 1 and does not constitute a limitation of the computer device 1, the computer device 1 may be a bus type structure, a star type structure, the computer device 1 may further comprise more or less other hardware or software than illustrated, or a different arrangement of components, for example, the computer device 1 may further comprise an input-output device, a network access device, etc.
It should be noted that the computer device 1 is only used as an example, and other electronic products that may be present in the present invention or may be present in the future are also included in the scope of the present invention by way of reference.
The memory 12 includes at least one type of readable storage medium including flash memory, a removable hard disk, a multimedia card, a card memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, etc. The memory 12 may in some embodiments be an internal storage unit of the computer device 1, such as a removable hard disk of the computer device 1. The memory 12 may in other embodiments also be an external storage device of the computer device 1, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which are provided on the computer device 1. Further, the memory 12 may also include both an internal storage unit and an external storage device of the computer device 1. The memory 12 may be used not only for storing application software installed in the computer device 1 and various types of data, such as code of a quotation snapshot issuing program, etc., but also for temporarily storing data that has been output or is to be output.
The processor 13 may be comprised of integrated circuits in some embodiments, for example, a single packaged integrated circuit, or may be comprised of multiple integrated circuits packaged with the same or different functions, including one or more central processing units (Central Processing unit, CPU), microprocessors, digital processing chips, graphics processors, a combination of various control chips, and the like. The processor 13 is a Control Unit (Control Unit) of the computer device 1, connects the respective components of the entire computer device 1 using various interfaces and lines, executes various functions of the computer device 1 and processes data by running or executing programs or modules stored in the memory 12 (for example, executing a snapshot issuing program, etc.), and calling data stored in the memory 12.
The processor 13 executes the operating system of the computer device 1 and various types of applications installed. The processor 13 executes the application program to implement the steps of the above-described embodiments of the method for issuing a snapshot of a market, such as the steps shown in fig. 1.
Illustratively, the computer program may be partitioned into one or more modules/units that are stored in the memory 12 and executed by the processor 13 to complete the present invention. The one or more modules/units may be a series of computer readable instruction segments capable of performing the specified functions, which instruction segments describe the execution of the computer program in the computer device 1. For example, the computer program may be divided into a processing unit 110, a buffering unit 111, a filtering unit 112, a generating unit 113.
The integrated units implemented in the form of software functional modules described above may be stored in a computer readable storage medium. The software functional module is stored in a storage medium, and includes several instructions for causing a computer device (which may be a personal computer, a computer device, or a network device, etc.) or a processor (processor) to execute portions of the method for issuing a snapshot of a market according to the embodiments of the present invention.
The modules/units integrated in the computer device 1 may be stored in a computer readable storage medium if implemented in the form of software functional units and sold or used as separate products. Based on this understanding, the present invention may also be implemented by a computer program for instructing a relevant hardware device to implement all or part of the procedures of the above-mentioned embodiment method, where the computer program may be stored in a computer readable storage medium and the computer program may be executed by a processor to implement the steps of each of the above-mentioned method embodiments.
Wherein the computer program comprises computer program code which may be in source code form, object code form, executable file or some intermediate form etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory, or the like.
Further, the computer-readable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created from the use of blockchain nodes, and the like.
The blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm and the like. The Blockchain (Blockchain), which is essentially a decentralised database, is a string of data blocks that are generated by cryptographic means in association, each data block containing a batch of information of network transactions for verifying the validity of the information (anti-counterfeiting) and generating the next block. The blockchain may include a blockchain underlying platform, a platform product services layer, an application services layer, and the like.
The bus may be a peripheral component interconnect standard (peripheral component interconnect, PCI) bus or an extended industry standard architecture (extended industry standard architecture, EISA) bus, among others. The bus may be classified as an address bus, a data bus, a control bus, etc. For ease of illustration, only one straight line is shown in fig. 3, but not only one bus or one type of bus. The bus is arranged to enable a connection communication between the memory 12 and at least one processor 13 or the like.
Although not shown, the computer device 1 may further comprise a power source (such as a battery) for powering the various components, preferably the power source may be logically connected to the at least one processor 13 via a power management means, whereby the functions of charge management, discharge management, and power consumption management are achieved by the power management means. The power supply may also include one or more of any of a direct current or alternating current power supply, recharging device, power failure detection circuit, power converter or inverter, power status indicator, etc. The computer device 1 may further include various sensors, bluetooth modules, wi-Fi modules, etc., which will not be described in detail herein.
Further, the computer device 1 may also comprise a network interface, optionally comprising a wired interface and/or a wireless interface (e.g. WI-FI interface, bluetooth interface, etc.), typically used for establishing a communication connection between the computer device 1 and other computer devices.
The computer device 1 may optionally further comprise a user interface, which may be a Display, an input unit, such as a Keyboard (Keyboard), or 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, or the like. The display may also be referred to as a display screen or display unit, as appropriate, for displaying information processed in the computer device 1 and for displaying a visual user interface.
It should be understood that the embodiments described are for illustrative purposes only and are not limited to this configuration in the scope of the patent application.
Fig. 3 shows only a computer device 1 with components 12-13, it being understood by those skilled in the art that the structure shown in fig. 3 is not limiting of the computer device 1 and may include fewer or more components than shown, or may combine certain components, or a different arrangement of components.
In connection with fig. 1, the memory 12 in the computer device 1 stores a plurality of instructions to implement a market snapshot issuing method, the processor 13 may execute the plurality of instructions to implement:
when snapshot data issued by an exchange are received, carrying out format standardization processing on the snapshot data to obtain a snapshot to be issued;
issuing the snapshot to be issued to a client for initiating a real-time subscription request to the snapshot data, and performing bypass caching on the snapshot to be issued by utilizing an asynchronous cache thread;
when a snapshot subscription request initiated by any client is received, filtering and re-processing is carried out based on the cache, so as to obtain a filtering and re-processing result;
and generating a snapshot issuing strategy for any client according to the filtering and repeating result, and updating an issuing filtering and repeating record.
Specifically, the specific implementation method of the above instructions by the processor 13 may refer to the description of the relevant steps in the corresponding embodiment of fig. 1, which is not repeated herein.
The data in this case were obtained legally.
In the several embodiments provided in the present invention, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical function division, and there may be other manners of division when actually implemented.
The invention is operational with numerous general purpose or special purpose computer system environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like. The invention may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The invention may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical units, may be located in one place, or may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional module in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units can be realized in a form of hardware or a form of hardware and a form of software functional modules.
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 characteristics 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.
Furthermore, it is evident that the word "comprising" does not exclude other elements or steps, and that the singular does not exclude a plurality. The units or means stated in the invention may also be implemented by one unit or means, either by software or hardware. The terms first, second, etc. are used to denote a name, but not any particular order.
Finally, it should be noted that the above-mentioned embodiments are merely for illustrating the technical solution of the present invention and not for limiting the same, and although the present invention has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications and equivalents may be made to the technical solution of the present invention without departing from the spirit and scope of the technical solution of the present invention.

Claims (9)

1. The quotation snapshot issuing method is characterized by comprising the following steps of:
when snapshot data issued by an exchange are received, carrying out format standardization processing on the snapshot data to obtain a snapshot to be issued;
issuing the snapshot to be issued to a client for initiating a real-time subscription request to the snapshot data, and performing bypass caching on the snapshot to be issued by utilizing an asynchronous cache thread; the step of using the asynchronous cache thread to bypass the to-be-issued snapshot comprises the following steps: sending the snapshot to be issued to a lock-free message queue by using the asynchronous cache thread and performing asynchronous dequeuing from the lock-free message queue to a cache; determining the historical issuing condition of the snapshot to be issued at each client; synchronously recording the historical issuing conditions of the snapshot to be issued at each client in the cache by using a BitSet data structure; when caching, only storing the snapshot to be issued corresponding to the latest snapshot data for each security code;
When a snapshot subscription request initiated by any client is received, filtering and re-processing is carried out based on the cache, so as to obtain a filtering and re-processing result;
and generating a snapshot issuing strategy for any client according to the filtering and repeating result, and updating an issuing filtering and repeating record.
2. The method for issuing a snapshot of a market as set forth in claim 1, wherein the performing format normalization processing on the snapshot data to obtain a snapshot to be issued includes:
analyzing the snapshot data to obtain first data;
acquiring the quotation type of the snapshot data;
acquiring a pre-configured data format corresponding to the quotation type of the snapshot data;
and transcoding the first data according to the data format to obtain the snapshot to be issued.
3. The market snapshot issuing method according to claim 1, wherein the method further comprises:
when the random client is detected to be accessed in a disk for initial subscription, determining that the snapshot subscription request is received; or alternatively
And when detecting that the random client dynamically subscribes to a new security code, determining that the snapshot subscription request is received.
4. The method for issuing the market snapshot according to claim 1, wherein the filtering based on the cache to obtain a filtered result includes:
Determining the latest target snapshot subscribed by the arbitrary client according to the snapshot subscription request;
acquiring the historical launching condition of the target snapshot recorded in the cache at any client as a target launching record;
when the target issuing record shows that the target snapshot has an issuing record at the optional client, determining the filtering result as a first result; or alternatively
And when the target issuing record shows that the target snapshot does not issue records at any client, determining the filtering result as a second result.
5. The method for issuing a snapshot of a market according to claim 4, wherein generating a snapshot issuing policy for the arbitrary client according to the filtering result comprises:
when the filtering result is the first result, determining that the snapshot issuing strategy is not to issue the target snapshot to the arbitrary client; or alternatively
And when the filtering result is the second result, determining that the snapshot issuing strategy is to issue the target snapshot to the optional client.
6. The method for issuing a snapshot of a market according to claim 5, wherein updating the issuing filter re-record comprises:
When the snapshot issuing policy is that the target snapshot is not issued to the arbitrary client, the issuing filtering re-record is not updated; or alternatively
When the snapshot issuing policy is to issue the target snapshot to the arbitrary client, after detecting to issue the target snapshot to the arbitrary client, updating the historical issuing condition of the target snapshot in the issuing filtering record to the arbitrary client.
7. The utility model provides a device is issued to quotation snapshot which characterized in that, device is issued to quotation snapshot includes:
the processing unit is used for carrying out format normalization processing on the snapshot data when receiving the snapshot data issued by the exchange to obtain a snapshot to be issued;
the cache unit is used for sending the snapshot to be sent to a client side initiating a real-time subscription request to the snapshot data, and carrying out bypass cache on the snapshot to be sent by utilizing an asynchronous cache thread; the step of using the asynchronous cache thread to bypass the to-be-issued snapshot comprises the following steps: sending the snapshot to be issued to a lock-free message queue by using the asynchronous cache thread and performing asynchronous dequeuing from the lock-free message queue to a cache; determining the historical issuing condition of the snapshot to be issued at each client; synchronously recording the historical issuing conditions of the snapshot to be issued at each client in the cache by using a BitSet data structure; when caching, only storing the snapshot to be issued corresponding to the latest snapshot data for each security code;
The filtering unit is used for filtering the weight based on the cache to obtain a filtering result when receiving a snapshot subscription request initiated by any client;
and the generating unit is used for generating a snapshot issuing strategy for any client according to the filtering and re-recording result and updating the issuing filtering and re-recording record.
8. A computer device, the computer device comprising:
a memory storing at least one instruction; and
A processor executing instructions stored in the memory to implement the market snapshot issuing method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized by: the computer readable storage medium having stored therein at least one instruction for execution by a processor in a computer device to implement the market snapshot issuing method of any of claims 1 to 6.
CN202310758698.2A 2023-06-26 2023-06-26 Quotation snapshot issuing method, device, equipment and medium Active CN116483747B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310758698.2A CN116483747B (en) 2023-06-26 2023-06-26 Quotation snapshot issuing method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310758698.2A CN116483747B (en) 2023-06-26 2023-06-26 Quotation snapshot issuing method, device, equipment and medium

Publications (2)

Publication Number Publication Date
CN116483747A CN116483747A (en) 2023-07-25
CN116483747B true CN116483747B (en) 2023-09-08

Family

ID=87223634

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310758698.2A Active CN116483747B (en) 2023-06-26 2023-06-26 Quotation snapshot issuing method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN116483747B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108182152A (en) * 2017-11-28 2018-06-19 深圳市丰巢科技有限公司 A kind of local cache based on Redis refreshes implementation method and device
US10678697B1 (en) * 2019-01-31 2020-06-09 Salesforce.Com, Inc. Asynchronous cache building and/or rebuilding
CN114817387A (en) * 2022-04-01 2022-07-29 盈立数智科技(深圳)有限公司 Market replay method and system based on log file
CN115456781A (en) * 2022-09-16 2022-12-09 中国建设银行股份有限公司 Market data processing method and device, electronic equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9501796B2 (en) * 2013-09-18 2016-11-22 Chicago Mercantile Exchange Inc. Dataset intersection determination

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108182152A (en) * 2017-11-28 2018-06-19 深圳市丰巢科技有限公司 A kind of local cache based on Redis refreshes implementation method and device
US10678697B1 (en) * 2019-01-31 2020-06-09 Salesforce.Com, Inc. Asynchronous cache building and/or rebuilding
CN114817387A (en) * 2022-04-01 2022-07-29 盈立数智科技(深圳)有限公司 Market replay method and system based on log file
CN115456781A (en) * 2022-09-16 2022-12-09 中国建设银行股份有限公司 Market data processing method and device, electronic equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
期权做市商业务验证系统的研究与实现;宋元杰;《中国优秀硕士论文电子期刊网》;第4-58页 *

Also Published As

Publication number Publication date
CN116483747A (en) 2023-07-25

Similar Documents

Publication Publication Date Title
CN114124968B (en) Load balancing method, device, equipment and medium based on market data
CN111694843B (en) Missing number detection method and device, electronic equipment and storage medium
CN114675976B (en) GPU (graphics processing Unit) sharing method, device, equipment and medium based on kubernets
CN115269523A (en) File storage and query method based on artificial intelligence and related equipment
CN116743885B (en) UDP engine-based data transmission method, device, equipment and medium
CN116701233B (en) Transaction system testing method, equipment and medium based on high concurrency report simulation
CN115314570B (en) Data issuing method, device, equipment and medium based on protocol development framework
CN116823437A (en) Access method, device, equipment and medium based on configured wind control strategy
CN115269709B (en) Inquiry and playback method, device, equipment and medium based on market data
CN116483747B (en) Quotation snapshot issuing method, device, equipment and medium
CN116630048B (en) Trading method, device, equipment and medium based on futures quotation K line
CN118037453B (en) Order processing method, device, equipment and medium of transaction system
CN118014696B (en) Transaction order preheating method, device, equipment and medium
CN116934263B (en) Product batch admittance method, device, equipment and medium
CN115543214B (en) Data storage method, device, equipment and medium in low-delay scene
CN116361753B (en) Authority authentication method, device, equipment and medium
CN114860349B (en) Data loading method, device, equipment and medium
CN116739611B (en) Customer information tracking management method, device, equipment and medium
CN117914943B (en) Data subscription and pushing method, device, equipment and medium
CN116455997B (en) STEP market multipath forwarding method, STEP market multipath forwarding device, STEP market multipath forwarding equipment and STEP market multipath forwarding medium
CN116401104A (en) Application data source switching method, device, equipment and medium
CN117371104A (en) House design replacement and assembly method, device, equipment and medium
CN118193493A (en) Service method, device, equipment and medium based on law enforcement event processing task
CN118014732A (en) Data return method, device, equipment and medium
CN116455527A (en) Message retransmission 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