Flow quotation data compression method and related equipment

By compressing and transmitting only the differences in market data using differential compression, the method addresses bandwidth and delay issues in financial market data transmission, ensuring real-time accuracy and efficiency.

CN119094787AInactive Publication Date: 2024-12-06SHENZHEN TINYSOFT CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410998697.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-24
Publication Date
2024-12-06
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing data transmission solutions for financial market data face challenges in balancing bandwidth requirements and real-time performance, particularly in the Shanghai and Shenzhen Stock Exchanges and major futures exchanges, where uncompressed real-time market data transmission demands high bandwidth and introduces transmission delays.

Method used

A method for compressing popular sentiment data by determining differences in market data at different times, encoding and compressing these differences, and transmitting only the changed data, using differential data compression and incremental updates to reduce redundancy and improve efficiency.

Benefits of technology

This approach reduces bandwidth requirements, enhances data transmission efficiency, and improves system stability by ensuring real-time updates and accurate data synchronization, while minimizing network load and storage needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119094787A_ABST
    Figure CN119094787A_ABST
Patent Text Reader

Abstract

The invention discloses a flow quotation data compression method and related equipment, and relates to the field of data compression, and the method comprises the steps: determining first flow quotation data at a first moment; determining second flow quotation data at a second moment; acquiring first compressed data of the first disk port data and the second disk port data; obtaining difference data of the first basic market information data and the second basic market information data; performing coding compression on the difference data to obtain second compressed data; and packaging and transmitting the first compressed data and the second compressed data to the terminal equipment, so that the client decodes the compressed data, and updates the first flow market data according to the decoded compressed data. The method is used for solving the problems of bandwidth efficiency and transmission delay in the transmission process of market information type time series data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data compression, and in particular to a method for compressing popular sentiment data and related equipment. Background Art

[0002] In the current field of financial market data transmission, the real-time market data transmission of the Shanghai and Shenzhen Stock Exchanges and several major futures exchanges is generally not compressed. Specifically, each field data (whether integer or floating point) is usually encoded and transmitted in 8 bytes (i.e. int64 format). Although this method ensures the integrity and accuracy of the data, it also brings about a large transmission bandwidth requirement. At present, the bandwidth required for a single market to transmit real-time market information is as high as 10M, which poses a significant challenge in terms of data transmission efficiency and cost.

[0003] In order to meet this challenge, some compression transmission solutions have emerged in the market. Among them, a common strategy is to aggregate multiple real-time streaming data packets and then compress them. Although this method can reduce the size of transmitted data to a certain extent, thereby improving transmission efficiency, it also has obvious defects. Specifically, this solution needs to wait for multiple real-time market data packets to arrive before compression and packaging can be performed for transmission. This waiting process inevitably introduces additional transmission delays. For financial market market data that requires extremely high real-time performance, this delay may seriously affect the timeliness and effectiveness of data transmission.

[0004] Therefore, existing data transmission solutions have problems in balancing bandwidth requirements and real-time performance. Summary of the invention

[0005] The present application provides a popular sentiment data compression method and related equipment, which are used to solve the bandwidth efficiency and transmission delay problems faced by market time series data during transmission.

[0006] In a first aspect, the present application provides a method for compressing popular sentiment data, which determines first popular sentiment data at a first moment, wherein the first popular sentiment data is popular sentiment data that has been updated to a terminal device, and the first popular sentiment data includes first market data and first basic market data; Determine second popular sentiment data at a second moment, the second moment and the first moment are two adjacent moments, and the first moment is before the second moment, and the second popular sentiment data includes second market data and second basic market data; Obtain first compressed data of first disk data and second disk data; Obtaining difference data between the first basic market data and the second basic market data; Encoding and compressing the difference data to obtain second compressed data; The first compressed data and the second compressed data are packaged and transmitted to the terminal device, so that the client decodes the compressed data and updates the first stream sentiment data according to the decoded compressed data.

[0007] By adopting the above technical solution, first, the server side will obtain the popular sentiment data at different times, including the market data and the basic market data, track the market dynamics in real time, ensure the timeliness and accuracy of the data, and compare and process the first market data with the second market data, the first basic market data with the second basic market data, effectively reduce the redundancy of data transmission, thereby improving the efficiency of data transmission. Secondly, by using the differential data compression technology, by calculating and encoding the field difference and its corresponding field identifier, the change amount of the data is represented in a more compact form. This encoding and compression method not only reduces the storage space of the data, but also reduces the bandwidth requirement for data transmission, making the data transmission more economical and efficient. Furthermore, by the packaged transmission of the first compressed data and the second compressed data, the incremental update of the data is realized, that is, only the changed part of the data needs to be transmitted to update the entire data set. This incremental update method greatly reduces the load on the server and the client, and improves the response speed and stability of the system. In summary, this embodiment, on the basis of ensuring the timeliness and accuracy of the data, effectively improves the data transmission efficiency and system stability through differential data compression and incremental update technology, and provides users with more efficient and convenient market data services.

[0008] In conjunction with some embodiments of the first aspect, in some embodiments, obtaining first compressed data of first disk data and second disk data specifically includes: Compare the first handicap data with the second handicap data to obtain mobile location information; The second handicap data is updated based on the mobile position information to obtain mobile handicap data; Comparing the first handicap data with the moving handicap data to obtain a data change difference; The moving position and the data change difference are recorded as first compressed data.

[0009] By adopting the above technical solution, the mobile position information is obtained by comparing the first handicap data with the second handicap data, and the second handicap data is updated based on the mobile position information to obtain the mobile handicap data. Furthermore, by comparing the original first handicap data with the updated mobile handicap data, the data change difference is obtained, and it is recorded together with the mobile position information as the first compressed data. This processing method greatly reduces the amount of data that needs to be transmitted, especially when the handicap data does not change much between adjacent moments, it can significantly reduce the network burden and increase the data transmission speed. At the same time, by transmitting compressed data, storage space is further saved, so that more market data can be saved and quickly retrieved with limited resources.

[0010] In conjunction with some embodiments of the first aspect, in some embodiments, comparing the first handicap data with the second handicap data to obtain the mobile position information specifically includes: Slide the second handicap data relative to the first handicap data, and calculate a similarity score between the first handicap data and the second handicap data for each slide; The mobile position information of the mobile position with the highest similarity score is obtained.

[0011] By adopting the above technical solution, the second handicap data is slid relative to the first handicap data, aiming to find the best alignment position of the handicap data at two moments. By calculating the similarity score of each slide and selecting the moving position with the highest similarity as the best moving position, it is ensured that the second handicap data after the movement is highly consistent with the first handicap data in structure, thereby achieving a great fit between the data.

[0012] In conjunction with some embodiments of the first aspect, in some embodiments, obtaining difference data between the first basic market data and the second basic market data specifically includes: Calculate the field difference between the first basic market data and the corresponding field of the second basic market data; The field difference value and the field identifier corresponding to the field difference value are recorded as difference data.

[0013] By adopting the above technical solution, the difference between each field of the first basic market data and the second basic market data is obtained, and the field difference and the field representation are recorded as difference data. Subsequently, only the difference data needs to be compressed and transmitted, which greatly reduces the bandwidth required in the real-time market transmission process.

[0014] In combination with some embodiments of the first aspect, in some embodiments, encoding and compressing the difference data to obtain second compressed data specifically includes: Encoding the field difference values ​​in the difference data based on a preset encoding rule; One byte is allocated to represent the field identifier of the field difference.

[0015] By adopting the above technical solution, the field differences in the difference data are encoded by preset encoding rules, so that the encoding process is more normalized and standardized, the encoding efficiency is improved, the consistency and predictability of the encoding are ensured, and the encoding process is more efficient and reliable. By allocating one byte to represent the field identifier of the field difference, the size of the compressed data is effectively reduced, thereby reducing the cost of data transmission and storage.

[0016] In combination with some embodiments of the first aspect, in some embodiments, encoding the field difference in the difference data based on a preset encoding rule specifically includes: Determine whether a target difference is within a preset value range, wherein the target difference is any one of the field differences; If not, determining that the target difference is the first difference; Encoding the first difference in the form of a first byte plus an extension byte, wherein the first byte includes an extension identification bit, a decimal point offset bit, a sign bit, and an extension value bit, and adopts a bit allocation of 1+3+1+3; If so, determining that the target difference is a second difference; Allocate one byte to encode the second difference, the byte including an extension flag bit, a decimal point offset bit, a sign bit, and a value bit, and adopt a bit allocation of 1+3+1+3; Setting the extension flag to 0 or 1 indicates that the target difference does not need to be extended.

[0017] By adopting the above technical solution, a preset encoding rule is introduced to encode the field difference in the difference data. This encoding method adopts different encoding strategies according to the size of the difference when judging whether the target difference is within the preset value range. For the difference within the preset range, one byte is directly allocated for encoding, which saves the encoding space; and for the difference beyond the preset range, the first byte plus the extension byte is used for encoding, ensuring that even large values ​​can be accurately represented. Specifically, the design of the first byte includes an extension identification bit, a decimal point offset bit, a sign bit, and an extension value bit. Such a design enables the first byte to carry multiple information at the same time, further improving the compactness of the encoding. The introduction of the extension byte ensures that there is enough space to encode large values ​​when necessary, ensuring the accuracy of the data. In addition, by setting the extension identification bit, it is clearly identified whether the target difference needs to be expanded. This design enables the decoding end to quickly identify which data needs to be expanded during decoding, thereby speeding up the decoding speed of the data.

[0018] In combination with some embodiments of the first aspect, in some embodiments, encoding the first difference in the form of a first byte plus an extension byte specifically includes: Setting the extension flag bit to 1 or 0 indicates that the target difference needs to be extended; Calculate the number of extended bytes required for the first difference, and set the extended value bit to the number of extended bytes of the first difference; Set the extension byte to the numeric portion of the first difference.

[0019] By adopting the above technical solution, for large differences that exceed the preset range, the first byte plus the extension byte is used for encoding, which can ensure that the amount of transmitted data is reduced while maintaining sufficient information accuracy.

[0020] In a second aspect, an embodiment of the present application provides a computer-readable storage medium comprising instructions, which, when executed by one or more processors, causes the processor to perform a method as described in the first aspect and any possible implementation of the first aspect.

[0021] In a third aspect, an embodiment of the present application provides a computer program product, including a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the method described in the first aspect and any possible implementation of the first aspect.

[0022] In a fourth aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory, wherein the memory stores a computer program, and when the processor executes the computer program, it implements the method described in the first aspect and any possible implementation method of the first aspect.

[0023] One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages: 1. This application significantly reduces the amount of data that needs to be transmitted by comparing the market data and basic market data at two adjacent moments and extracting the difference data for encoding and compression. Compared with transmitting complete data, this incremental update method can greatly reduce the network bandwidth usage and improve data transmission efficiency.

[0024] 2. This application uses data compression technology, which efficiently encodes and compresses the difference data, records the moving position and the change difference as key information, and reduces the transmission of redundant information. This not only reduces the complexity of data transmission, but also improves the data transmission efficiency, allowing the client to receive updated data more quickly.

[0025] 3. When processing popular market data, this application not only considers the mobile location information of the market data, but also considers the difference data of the basic market data, and has high flexibility and adaptability. It can select the appropriate data compression and encoding method according to the characteristics of different data types to achieve the best compression effect and transmission performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 It is a flow chart of a method for compressing popular sentiment data in an embodiment of the present application; Figure 2 This is a schematic diagram of a data table of a popular sentiment data compression method in an embodiment of the present application; Figure 3 It is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0027] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to be used as limitations to the present application. As used in the specification and appended claims of the present application, the singular expressions "one", "a kind of", "said", "above", "the" and "this" are intended to also include plural expressions, unless there is a clear indication to the contrary in the context. It should also be understood that the term "and / or" used in the present application refers to and includes any or all possible combinations of one or more listed items.

[0028] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.

[0029] See also Figure 1 , which is a flow chart of a popular sentiment data compression method in an embodiment of the present application.

[0030] S101, determining first popular sentiment data at a first moment, where the first popular sentiment data is popular sentiment data updated to a terminal device, and the first popular sentiment data includes first market data and first basic market data; The server collects original stock market data through various data sources, and then obtains popular sentiment data after cleaning, formatting and other processing, and stores the popular sentiment data in the server-side database. When the terminal device needs to update the popular sentiment data, the method described in this application is executed to update the popular sentiment data of the terminal device to the latest data.

[0031] The above-mentioned first-popular sentiment data is the latest popular sentiment data that has been transmitted to the terminal device and updated on the terminal device. Assuming that this is the first moment, the update of the first-popular sentiment data is completed on the terminal device at this time. This update is completed based on the method described in this application. At this time, the server side has stored the complete first-popular sentiment data.

[0032] The above-mentioned first-tier market data mainly includes two parts: the first market data and the first basic market data. The market data reflects the real-time trading situation of the market, including key information such as buying and selling prices and buying and selling quantities. The basic market data includes data such as opening price, closing price, increase or decrease, and trading volume.

[0033] S102, determining second popular sentiment data at a second moment, where the second moment and the first moment are two adjacent moments, and the first moment is before the second moment, and the second popular sentiment data includes second market data and second basic market data; The first trend sentiment data has been updated in the terminal device. After a preset time period, assuming this is the second moment, the server has collected and processed the second trend sentiment data and stored it in the database. At this time, the second trend sentiment data has not been updated to the terminal device.

[0034] The second-tier sentiment data also consists of market data and basic market data. The second-tier sentiment data reflects the latest changes in the market status. Compared with the first-tier sentiment data at the first moment, the second-tier sentiment data at the second moment may contain minor adjustments or fluctuations. Through this step, a new reference point is obtained for the subsequent data comparison and compression.

[0035] S103, obtaining first compressed data of the first disk data and the second disk data; The first thing that needs to be done is to compare the first handicap data with the second handicap data. Based on the sliding window algorithm, the second handicap data is slid relative to the first handicap data, and the similarity of the two sets of data is calculated at each possible alignment position. By comparing the similarity scores at all possible moving positions, the position with the highest similarity score (or the smallest similarity loss) is found. This position is the best alignment position of the second handicap data table relative to the first handicap data. Once the best matching position is found, the distance and direction that the second handicap data needs to move can be determined to achieve the best alignment with the first handicap data.

[0036] Next, the second handicap data is updated according to the obtained mobile position information. After obtaining the updated second handicap data, it is necessary to compare the first handicap data with the updated second handicap data to obtain the data change difference. This step compares the two handicap data item by item, finds the data elements that have changed, and calculates the change amount of these elements. These changes will be recorded as data change differences, which are an important basis for subsequent encoding compression.

[0037] Finally, the moving position information and the data change difference are recorded as the first compressed data. This step summarizes and organizes the information obtained in the above two steps to form the final first compressed data. This compressed data contains the main change information of the market data between the two moments, which can effectively reduce the amount of data to be transmitted and improve data transmission efficiency.

[0038] Next, we will Figure 2 The following example illustrates the process of obtaining the first compressed data: See also Figure 2 , a schematic diagram of a market data of a popular sentiment data compression method in an embodiment of the present application, Figure 2 The attached figure (a) in the figure shows the ten-level sell order data of a certain security. At time T0, the sell price of 1 is 10.01, the entrustment volume is 100, and the stock price rises. At time T1, the sell price of 1 is 10.2, and the entrustment volume is 300.

[0039] Step 1: First, compare the data at time T0 and time T1. Based on the sliding window algorithm and similarity calculation, T1 moves 1 unit in the positive direction, such as Figure 2 Figure (b) in the figure; Step 2: Then scan each cell of the T1 and T0 data tables and calculate the data change difference; Step 3: Record data changes: item1: 200->300, the difference is 100; item10: 10.1->10.11, the difference is 0.01; item10: 1000->800, the difference is -200; Step 4: The compression logic of the entire data table is: <1①A⑩B(10)C; in: <1 means moving 1 unit in the positive direction; ① Indicates the amount of entrustment in item1, occupying 1 byte; A means the difference of ① is 100, which occupies 1 byte; ⑩ represents the price in item10, which occupies 1 byte; B means the difference of ⑩ is 0.01, which occupies 1 byte; (10) represents the amount of entrustment in item10, which occupies 1 byte; C means the difference of (10) is -200, which occupies 1 byte.

[0040] S104, obtaining difference data between the first basic market data and the second basic market data; Basic market data is an important part of the financial market, including key information such as opening price, closing price, price increase or decrease, and trading volume. In order to efficiently transmit this data, we adopt the method of differential data acquisition to reduce redundant information during the transmission process.

[0041] First, the corresponding fields in the first basic market data and the second basic market data are compared item by item. During the comparison process, the difference between the corresponding fields of the basic market data at two moments, i.e., the field difference, is calculated. These field differences represent the amount of change in the basic market data at different moments.

[0042] Next, these field differences are recorded with their corresponding field identifiers to form difference data. Field identifiers are used to identify the specific name or type of each field to ensure that data can be accurately identified and decoded during transmission and reception. By combining field differences with field identifiers, a complete difference data set is constructed, which contains the main changes in the basic market data from the first moment to the second moment.

[0043] This method of obtaining differential data can not only reduce the amount of data transmitted and reduce bandwidth requirements, but also improve the efficiency and accuracy of data transmission. Because differential data only contains the changed part of the data, the receiving end can quickly update the original data (i.e. the first basic market data) after receiving the differential data to obtain the latest market data. Compared with directly transmitting the complete data set, this method is more efficient and saves resources.

[0044] S105, encoding and compressing the difference data to obtain second compressed data; According to the field difference between the first basic market data and the second basic market data obtained in step S104, the encoding compression operation is performed based on the 64-bit data compression algorithm. In the encoding process, it is first determined whether the target difference (i.e., any one of the field differences) is within a preset value range. According to the preset encoding rules, this preset value range is the value range of the difference that can be expressed by the first byte, and is related to the structural design of the first byte.

[0045] If the target difference is within the preset range, the system will treat it as the second difference and allocate a byte to represent the field difference. The byte includes an extension flag, a decimal point offset, a sign bit, and a value bit, and is encoded according to the bit allocation of 1+3+1+3. Among them, the extension flag is set to 0, indicating that the field difference does not need to be further extended. The three decimal point offset bits can represent different decimal point positions from 0 to 7 (a total of 8 types), which means that decimals of different precisions can be represented. If the sign bit is 0, it is a positive number, and if it is 1, it is a negative number. The three value bits are used to represent the absolute value of the difference.

[0046] Assuming that the difference is 0.5 at this time, the extended representation bit of the first byte is 0, indicating that there is no need to allocate extended bytes, and the first byte can represent the difference. The decimal point is offset by 1 bit, which is 001. The sign bit is 0, indicating that the difference is a positive value. The value bit is 101, so the encoding of the first byte is 0001 0101.

[0047] However, if the target difference exceeds the preset numerical range, the large value requires more bits to represent. For the encoding of the first difference, the system encodes it in the form of a first byte plus an extended byte. In the first byte, the extended identification bit is set to 1, indicating that the field difference requires further extended bytes to be fully represented. At the same time, the first byte also includes a decimal point offset bit, a sign bit, and an extended value bit, which are used to indicate the decimal point position, the sign of the value, and the number of extended bytes, and are also encoded using a bit allocation of 1+3+1+3. The extended value bit is used to indicate the number of extended bytes to ensure that the numerical part of the first difference can be fully encoded. The extended byte is directly used to encode the numerical part of the first difference, and is encoded in binary format.

[0048] Assume that the difference at this time is -10, and the difference range exceeds the preset range. In the first byte, the extension flag is set to 1, indicating that additional bytes are required to represent the difference, the decimal point offset is 000, the sign bit is 1, and the extended value bit is 001, indicating that 1 byte is required to represent the value of the difference. The encoding value of the first byte is: 1000 1001; at this time, another extension byte will be allocated to represent the difference, and the encoding value of the extension byte is: 0000 0101, so the encoding value of the difference is: 1000 1001 0000 0101.

[0049] This differential data encoding and compression method based on preset encoding rules can effectively reduce data transmission redundancy and improve data transmission efficiency. At the same time, since the encoding process follows unified standards and specifications, the decoding end can quickly restore the original data to ensure data accuracy and consistency.

[0050] S106: Pack the first compressed data and the second compressed data and transmit them to the terminal device, so that the client decodes the compressed data and updates the first trend data according to the decoded compressed data.

[0051] After the encoding and compression of the difference data is completed, the second compressed data obtained in step S105 is packaged with the first compressed data obtained in step S103 to form a complete update data packet. This data packet contains the main change information of the popular sentiment data from the first moment to the second moment. By transmitting this data packet to the terminal device, the client can quickly decode and update the popular sentiment data thereon, thereby realizing real-time update and synchronization of data.

[0052] In summary, this application mainly optimizes the bandwidth efficiency and transmission delay problems in the transmission of popular sentiment data. By determining the popular sentiment data at different times and comparing the market data at adjacent times, the mobile position information and the data change difference are obtained, and then the first compressed data is obtained. At the same time, the difference in basic market data is calculated, and the difference data is encoded and compressed to reduce the redundancy of data transmission. This compression method not only improves the efficiency of data transmission, but also reduces the load on the server and client through incremental updates, thereby improving the response speed and stability of the system.

[0053] See also Figure 3 , Figure 3 A schematic diagram of the structure of a computer device provided in an embodiment of the present application, such as Figure 3 As shown, the computer device 300 of this embodiment may include: a memory 301 and a processor 302 .

[0054] The memory 301 stores a computer program that can be loaded by the processor 302 and execute the method in the above embodiment.

[0055] The processor 302 and the memory 301 are connected, for example, via a bus.

[0056] Optionally, the computer device 300 may further include a transceiver. It should be noted that in actual applications, the number of transceivers is not limited to one, and the structure of the computer device 300 does not constitute a limitation on the embodiments of the present application.

[0057] The processor 302 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. The processor 302 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.

[0058] The bus may include a path to transmit information between the above components. The bus may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0059] The memory 301 can be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to these.

[0060] The memory 301 is used to store the application code for executing the solution of the present application, and the execution is controlled by the processor 302. The processor 302 is used to execute the application code stored in the memory 301 to implement the contents shown in the above method embodiment.

[0061] The computer device 300 includes but is not limited to: mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc., and can also be servers, etc.

[0062] The computer device of this embodiment can be used to execute the method of any of the above embodiments. The implementation principles and technical effects are similar and will not be described in detail here.

[0063] The present application also provides a computer-readable storage medium storing a computer program that can be loaded by a processor and execute the method in the above embodiment.

[0064] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

[0065] As used in the above embodiments, the term "when..." may be interpreted to mean "if..." or "after..." or "in response to determining..." or "in response to detecting...", depending on the context. Similarly, the phrases "upon determining..." or "if (the stated condition or event) is detected" may be interpreted to mean "if determining..." or "in response to determining..." or "upon detecting (the stated condition or event)" or "in response to detecting (the stated condition or event)", depending on the context.

[0066] Those skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.

Claims

1. A method for compressing popular sentiment data, It is characterized in that The following steps are involved: Determine first popular sentiment data at a first moment, wherein the first popular sentiment data is the popular sentiment data updated to the terminal device, and the first popular sentiment data includes first market data and first basic market data; Determine second popular sentiment data at a second moment, the second moment and the first moment are two adjacent moments, and the first moment is before the second moment, and the second popular sentiment data includes second market data and second basic market data; Acquire first compressed data of the first disk data and the second disk data; Obtaining difference data between the first basic market data and the second basic market data; Encoding and compressing the difference data to obtain second compressed data; The first compressed data and the second compressed data are packaged and transmitted to the terminal device, so that the client decodes the compressed data and updates the first popular sentiment data according to the decoded compressed data.

2. The method for compressing popular sentiment data according to claim 1, It is characterized in that The obtaining of the first compressed data of the first disk data and the second disk data specifically includes: Compare the first handicap data with the second handicap data to obtain mobile position information; The second handicap data is updated based on the mobile position information to obtain mobile handicap data; Comparing the first handicap data with the mobile handicap data to obtain a data change difference; The moving position information and the data change difference are recorded as the first compressed data.

3. The method for compressing popular sentiment data according to claim 2, It is characterized in that The comparing the first handicap data with the second handicap data to obtain the mobile position information specifically includes: Slide the second handicap data relative to the first handicap data, and calculate a similarity score between the first handicap data and the second handicap data for each slide; The mobile position information of the mobile position with the highest similarity score is obtained.

4. The method for compressing popular sentiment data according to claim 1, It is characterized in that The obtaining of difference data between the first basic market data and the second basic market data specifically includes: Calculating the field difference between the first basic market data and the corresponding field of the second basic market data; The field difference value and the field identifier corresponding to the field difference value are recorded as the difference data.

5. The method for compressing popular sentiment data according to claim 1, It is characterized in that The encoding and compressing the difference data to obtain second compressed data specifically includes: Encoding the field difference in the difference data based on a preset encoding rule; One byte is allocated to represent the field identifier of the field difference value.

6. The method for compressing popular sentiment data according to claim 5, It is characterized in that The encoding of the field difference in the difference data based on a preset encoding rule specifically includes: Determine whether a target difference is within a preset value range, wherein the target difference is any one of the field differences; If not, determining that the target difference is the first difference; Encoding the first difference in the form of a first byte plus an extension byte, wherein the first byte includes an extension identification bit, a decimal point offset bit, a sign bit, and an extension value bit, and adopts a bit allocation of 1+3+1+3; If so, determining that the target difference is a second difference; Allocate one byte to encode the second difference, the byte including an extension flag bit, a decimal point offset bit, a sign bit, and a value bit, and adopt a bit allocation of 1+3+1+3; Setting the extension flag to 0 or 1 indicates that the target difference does not need to be extended.

7. The method for compressing popular sentiment data according to claim 6, It is characterized in that The first difference is encoded in the form of a first byte plus an extension byte, specifically including: Setting the extension flag bit to 1 or 0 indicates that the target difference needs to be extended; Calculating the number of extended bytes required for the first difference, and setting the extended value bits to the number of extended bytes of the first difference; The extension byte is set to the numerical portion of the first difference value.

8. A computer-readable storage medium comprising instructions, It is characterized in that When executed by one or more processors, the processors are caused to execute the popular sentiment data compression method as described in any one of claims 17.

9. A computer program product comprising a computer readable storage medium, Features A computer program is stored, which, when executed by a processor, implements the popular sentiment data compression method as described in any one of claims 1 to 7.

10. An electronic device comprising a processor and a memory, It is characterized in that The memory stores a computer program, and when the processor executes the computer program, the sentiment data compression method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Market data processing method and device, terminal equipment and storage medium

    CN112003814A

  • Market data issuing method, device, system, equipment and medium

    CN114124878A

  • Information processor, information processing method and information processing program

    JP2015184692A