WO2022206474A1 - Data acquisition method and apparatus, electronic device, and computer-readable storage medium - Google Patents

Data acquisition method and apparatus, electronic device, and computer-readable storage medium Download PDF

Info

Publication number
WO2022206474A1
WO2022206474A1 PCT/CN2022/082205 CN2022082205W WO2022206474A1 WO 2022206474 A1 WO2022206474 A1 WO 2022206474A1 CN 2022082205 W CN2022082205 W CN 2022082205W WO 2022206474 A1 WO2022206474 A1 WO 2022206474A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
cache area
source
block
cursor
Prior art date
Application number
PCT/CN2022/082205
Other languages
French (fr)
Chinese (zh)
Inventor
杨武
Original Assignee
北京字节跳动网络技术有限公司
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 北京字节跳动网络技术有限公司 filed Critical 北京字节跳动网络技术有限公司
Publication of WO2022206474A1 publication Critical patent/WO2022206474A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2453Query optimisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2453Query optimisation
    • G06F16/24534Query rewriting; Transformation
    • G06F16/24539Query rewriting; Transformation using cached or materialised query results
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2477Temporal data queries

Definitions

  • the present disclosure relates to the field of data acquisition, and in particular, to a data acquisition method, apparatus, electronic device, and computer-readable storage medium.
  • an embodiment of the present disclosure provides a data acquisition method, including:
  • the preset condition includes: the number of clients connected to the data source is greater than a first threshold; or, the amount of data generated by the data source within a preset time is greater than a second threshold.
  • acquiring the data generated by the first data source from a data storage area according to a first preset time interval and caching the data in the first cache area includes:
  • the data block is cached in the first cache area.
  • the data acquisition request includes a mark of the first data source and a data cursor
  • the acquiring a first data block corresponding to the data acquisition request from the first cache area includes: :
  • the first data block corresponding to the data cursor is acquired from the first cache area according to the data cursor.
  • the data cursor includes a flag to start data or a timestamp of the first data block.
  • acquiring the first data block corresponding to the data cursor from the first cache area according to the data cursor includes:
  • the first data block with the flag of the start data is queried from the first cache area or the first data block with the timestamp of the first data block is queried from the first cache area.
  • obtaining the first data block corresponding to the data obtaining request from the first cache area according to the data cursor includes:
  • the data cursor is the default cursor, acquire the latest first data block from the first cache area; the default cursor indicates that the data acquisition request is the first request by the client for the first data source data acquisition request.
  • the acquiring the data generated by the first data source and caching the data in the first cache area includes:
  • the compressed data is cached in the first cache area.
  • the sending the first data block to the client comprises:
  • the step S105 includes:
  • the server Before sending the first data block to the client, the server may generate a data cursor to be used by the client when sending a data request next time as the above-mentioned next data cursor. As mentioned above, the next data cursor may also be used. Including the sign of the next start data or the next time stamp of the first data block, wherein the sign of the next start data is the sign of the last data in the first data block obtained by the server this time, and the server is in the next After receiving the data acquisition request of the client for the second time, determine the first data block to be acquired according to the data flag; or, the next timestamp may be after the timestamp of the first data block acquired this time and separated by a specific time The timestamp of the interval, the specific interval can be appropriately set, for example, it can be the aforementioned preset time interval, unit time length, any other suitable setting value, etc., so that the next timestamp of the first data block is passed The first data block corresponding to the next timestamp in the first cache is queried.
  • the server asynchronously obtains the data generated by the first data source from the data storage area according to the first preset time interval, and caches the data in the first cache area.
  • the data in the first cache area It is stored in the form of data blocks, so that every time a client sends a data acquisition request, the data blocks sent by the server are the same data blocks, that is, the segments of the data blocks obtained by the client are the same, unlike In the prior art, the data obtained by each client may be different, so that the server does not need to obtain data from the storage area separately for each client, but can obtain the data requested by the client from the cache.
  • the number of times of fetching data from the data storage area is increased, and the data hit rate and CPU usage efficiency when fetching data are improved.
  • each message broker instance After determining the hot live broadcast room, each message broker instance asynchronously acquires the data generated in the live broadcast room in the last second from the data storage area every second, and divides the data into 1 second time length.
  • the data block is stored in the cache area of the message broker instance.
  • Each message broker instance corresponds to a cache area.
  • the cache area described in Figure 3 is the cache area of a message broker instance, including 3 seconds.
  • the time interval for client polling, the time interval for message broker instances to obtain messages, and the time length for dividing data blocks are the same, so that all clients obtain the same data block segmentation each time.
  • the message broker instance parses the data cursor, which includes the timestamp of the data block to be acquired this time.
  • the timestamp of the data block in the data cursor is the first 1 second of the current system time, for example, the current time is 10:10:01.
  • the timestamp is parsed from the data cursor. It is 10:10:00.
  • a data source acquisition module 401 configured to acquire a first data source, wherein the first data source is a data source that satisfies a preset condition;
  • a data block obtaining module 404 configured to obtain the first data block corresponding to the data obtaining request from the first cache area
  • a data block sending module 405, configured to send the first data block to the client.
  • the preset condition includes: the number of clients connected to the data source is greater than a first threshold; or, the amount of data generated by the data source within a preset time is greater than a second threshold.
  • the data caching module 402 is further configured to:
  • the data block is cached in the first cache area.
  • the data block obtaining module 404 is further configured to:
  • the first data block corresponding to the data cursor is acquired from the first cache area according to the data cursor.
  • the data cursor includes a flag to start data or a timestamp of the first data block.
  • the first data block with the flag of the start data is queried from the first cache or the first data block with the timestamp of the first data block is queried from the first cache.
  • the data block obtaining module 404 is further configured to:
  • the data cursor is the default cursor, acquire the latest first data block from the first cache area; the default cursor indicates that the data acquisition request is the first request by the client for the first data source data acquisition request.
  • the data caching module 402 is further configured to:
  • the compressed data is cached in the first cache area.
  • the data block sending module 405 is further configured to:
  • the next data cursor and the first data block are sent to the client.
  • the apparatus shown in FIG. 4 may execute the method of the embodiment shown in FIG. 1 .
  • the apparatus shown in FIG. 4 may execute the method of the embodiment shown in FIG. 1 .
  • the parts not described in detail in this embodiment reference may be made to the related description of the embodiment shown in FIG. 1 .
  • Terminal devices in the embodiments of the present disclosure may include, but are not limited to, such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablets), PMPs (portable multimedia players), vehicle-mounted terminals (eg, mobile terminals such as in-vehicle navigation terminals), etc., and stationary terminals such as digital TVs, desktop computers, and the like.
  • the electronic device shown in FIG. 5 is only an example, and should not impose any limitation on the function and scope of use of the embodiments of the present disclosure.
  • an electronic device 500 may include a processing device (eg, a central processing unit, a graphics processor, etc.) 501 that may be loaded into random access according to a program stored in a read only memory (ROM) 502 or from a storage device 508 Various appropriate actions and processes are executed by the programs in the memory (RAM) 503 . In the RAM 503, various programs and data required for the operation of the electronic device 500 are also stored.
  • the processing device 501, the ROM 502, and the RAM 503 are connected to each other through a bus 504.
  • An input/output (I/O) interface 505 is also connected to bus 504 .
  • I/O interface 505 input devices 506 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; including, for example, a liquid crystal display (LCD), speakers, vibration
  • An output device 507 such as a computer
  • a storage device 508 including, for example, a magnetic tape, a hard disk, etc.
  • Communication means 509 may allow electronic device 500 to communicate wirelessly or by wire with other devices to exchange data. While FIG. 5 shows electronic device 500 having various means, it should be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
  • embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated in the flowchart.
  • the computer program may be downloaded and installed from the network via the communication device 509, or from the storage device 508, or from the ROM 502.
  • the processing apparatus 501 When the computer program is executed by the processing apparatus 501, the above-mentioned functions defined in the methods of the embodiments of the present disclosure are executed.
  • the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the above two.
  • the computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or a combination of any of the above. More specific examples of computer readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable Programmable read only memory (EPROM or flash memory), fiber optics, portable compact disk read only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
  • a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
  • a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave with computer-readable program code embodied thereon. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • a computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device .
  • Program code embodied on a computer readable medium may be transmitted using any suitable medium including, but not limited to, electrical wire, optical fiber cable, RF (radio frequency), etc., or any suitable combination of the foregoing.
  • the client and server can use any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol) to communicate, and can communicate with digital data in any form or medium Communication (eg, a communication network) interconnects.
  • HTTP HyperText Transfer Protocol
  • Examples of communication networks include local area networks (“LAN”), wide area networks (“WAN”), the Internet (eg, the Internet), and peer-to-peer networks (eg, ad hoc peer-to-peer networks), as well as any currently known or future development network of.
  • the above-mentioned computer-readable medium may be included in the above-mentioned electronic device; or may exist alone without being assembled into the electronic device.
  • the above computer readable medium carries one or more programs, when the one or more programs are executed by the electronic device, the electronic device causes the electronic device to: execute the data acquisition method in the above embodiment.
  • Computer program code for performing operations of the present disclosure may be written in one or more programming languages, including but not limited to object-oriented programming languages—such as Java, Smalltalk, C++, and This includes conventional procedural programming languages - such as the "C" language or similar programming languages.
  • the program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server.
  • the remote computer may be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (eg, using an Internet service provider through Internet connection).
  • LAN local area network
  • WAN wide area network
  • each block in the flowchart or block diagrams may represent a module, segment, or portion of code that contains one or more logical functions for implementing the specified functions executable instructions.
  • the functions noted in the blocks may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved.
  • each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations can be implemented in dedicated hardware-based systems that perform the specified functions or operations , or can be implemented in a combination of dedicated hardware and computer instructions.
  • the units involved in the embodiments of the present disclosure may be implemented in a software manner, and may also be implemented in a hardware manner. Among them, the name of the unit does not constitute a limitation of the unit itself under certain circumstances.
  • exemplary types of hardware logic components include: Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), Systems on Chips (SOCs), Complex Programmable Logical Devices (CPLDs) and more.
  • FPGAs Field Programmable Gate Arrays
  • ASICs Application Specific Integrated Circuits
  • ASSPs Application Specific Standard Products
  • SOCs Systems on Chips
  • CPLDs Complex Programmable Logical Devices
  • machine-readable storage media would include one or more wire-based electrical connections, portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), fiber optics, compact disk read only memory (CD-ROM), optical storage, magnetic storage, or any suitable combination of the foregoing.
  • RAM random access memory
  • ROM read only memory
  • EPROM or flash memory erasable programmable read only memory
  • CD-ROM compact disk read only memory
  • magnetic storage or any suitable combination of the foregoing.
  • an electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores data that can be accessed by the at least one processor Instructions executed by at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform any one of the data acquisition methods of the foregoing first aspect.
  • a non-transitory computer-readable storage medium stores computer instructions for causing a computer to execute the foregoing Any one of the data acquisition methods in the first aspect.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Computational Linguistics (AREA)
  • Fuzzy Systems (AREA)
  • Mathematical Physics (AREA)
  • Probability & Statistics with Applications (AREA)
  • Software Systems (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

A data acquisition method and apparatus, an electronic device, and a computer-readable storage medium. The data acquisition method comprises: acquiring a first data source, wherein the first data source is a data source satisfying a preset condition; acquiring, from a data storage area, according to a first preset time interval, data generated by the first data source, and caching the data into a first cache area, data in the first cache area being stored in the form of data blocks, and each data block comprising data generated within a unit time; receiving a data acquisition request sent by a client; acquiring a first data block from the first cache area; and sending the first data block to the client.

Description

数据获取方法、装置、电子设备及计算机可读存储介质Data acquisition method, apparatus, electronic device, and computer-readable storage medium
相关申请的交叉引用CROSS-REFERENCE TO RELATED APPLICATIONS
本申请是以申请号为202110337448.2、申请日为2021年3月30日的中国申请为基础,并主张其优先权,该中国申请的公开内容在此作为整体引入本申请中。This application is based on the Chinese application with the application number of 202110337448.2 and the filing date of March 30, 2021, and claims its priority. The disclosure of the Chinese application is hereby incorporated into this application as a whole.
技术领域technical field
本公开涉及数据获取领域,尤其涉及一种数据获取方法、装置、电子设备及计算机可读存储介质。The present disclosure relates to the field of data acquisition, and in particular, to a data acquisition method, apparatus, electronic device, and computer-readable storage medium.
背景技术Background technique
在直播场景中,观众和观众之间、观众和主播之间都需要进行实时互动。由于直播业务发展迅速,导致直播间内观众的数量与日俱增,这就导致cpu计算资源指数增长,需要一个优化方案来提升服务端性能,从而提升cpu计算资源的使用率。In a live broadcast scenario, real-time interaction is required between viewers and viewers, and between viewers and anchors. Due to the rapid development of the live broadcast business, the number of viewers in the live broadcast room is increasing day by day, which leads to the exponential growth of CPU computing resources. An optimization solution is needed to improve the performance of the server, thereby increasing the utilization rate of CPU computing resources.
发明内容SUMMARY OF THE INVENTION
提供该发明内容部分以便以简要的形式介绍构思,这些构思将在后面的具体实施方式部分被详细描述。该发明内容部分并不旨在标识要求保护的技术方案的关键特征或必要特征,也不旨在用于限制所要求的保护的技术方案的范围。This Summary is provided to introduce concepts in a simplified form that are described in detail in the Detailed Description section that follows. This summary section is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to be used to limit the scope of the claimed technical solution.
为了解决上述技术问题,本公开实施例提出如下技术方案。In order to solve the above technical problems, the embodiments of the present disclosure propose the following technical solutions.
第一方面,本公开实施例提供一种数据获取方法,包括:In a first aspect, an embodiment of the present disclosure provides a data acquisition method, including:
获取第一数据源,其中所述第一数据源为满足预设条件的数据源;acquiring a first data source, wherein the first data source is a data source that satisfies a preset condition;
按照第一预设时间间隔从数据存储区域中获取所述第一数据源所产生的数据并将所述数据缓存到第一缓存区域中;其中,所述第一缓存区域中的数据以数据块的形式存储,所述数据块中包括在单位时间内所产生的数据;Acquire the data generated by the first data source from the data storage area according to the first preset time interval and cache the data in the first cache area; wherein, the data in the first cache area is divided into data blocks It is stored in the form of data block, and the data block includes the data generated in unit time;
接收客户端发送的数据获取请求;Receive the data acquisition request sent by the client;
从所述第一缓存区域中获取与所述数据获取请求对应的第一数据块;Acquire the first data block corresponding to the data acquisition request from the first cache area;
发送所述第一数据块至所述客户端。Sending the first data block to the client.
在一些实施例中,所述预设条件包括:连接到数据源上的客户端的数量大于第一阈值;或者,数据源在预设时间内所产生的数据的数量大于第二阈值。In some embodiments, the preset condition includes: the number of clients connected to the data source is greater than a first threshold; or, the amount of data generated by the data source within a preset time is greater than a second threshold.
在一些实施例中,所述按照第一预设时间间隔从数据存储区域中获取所述第一数据源所产生的数据并将所述数据缓存到第一缓存区域中,包括:In some embodiments, acquiring the data generated by the first data source from a data storage area according to a first preset time interval and caching the data in the first cache area includes:
响应于经过第一预设时间间隔,从数据存储区中获取所述第一数据源在所述第一预设时间间隔的时长中所产生的数据;其中,所述数据包括数据时间戳;In response to the elapse of a first preset time interval, acquiring data generated by the first data source during the duration of the first preset time interval from the data storage area; wherein the data includes a data timestamp;
将数据时间戳在同一单位时间内的数据组织成数据块;Organize data with data timestamps within the same unit of time into data blocks;
将所述数据块缓存到第一缓存区域中。The data block is cached in the first cache area.
在一些实施例中,所述数据获取请求中包括所述第一数据源的标记以及数据游标,所述从所述第一缓存区域中获取与所述数据获取请求对应的第一数据块,包括:In some embodiments, the data acquisition request includes a mark of the first data source and a data cursor, and the acquiring a first data block corresponding to the data acquisition request from the first cache area includes: :
根据所述第一数据源的标记确定第一缓存区域;determining a first cache area according to the mark of the first data source;
根据所述数据游标从所述第一缓存区域中获取与所述数据游标对应的第一数据块。The first data block corresponding to the data cursor is acquired from the first cache area according to the data cursor.
在一些实施例中,所述数据游标包括开始数据的标志或者所述第一数据块的时间戳。In some embodiments, the data cursor includes a flag to start data or a timestamp of the first data block.
在一些实施例中,所述根据所述数据游标从所述第一缓存区域中获取与所述数据游标对应的第一数据块,包括:In some embodiments, acquiring the first data block corresponding to the data cursor from the first cache area according to the data cursor includes:
从所述第一缓存区域中查询具有所述开始数据的标志的第一数据块或者从所述第一缓存区域中查询具有所述第一数据块的时间戳的第一数据块。The first data block with the flag of the start data is queried from the first cache area or the first data block with the timestamp of the first data block is queried from the first cache area.
在一些实施例中,所述根据所述数据游标从所述第一缓存区域中获取与所述数据获取请求对应的第一数据块,包括:In some embodiments, obtaining the first data block corresponding to the data obtaining request from the first cache area according to the data cursor includes:
若所述数据游标为默认游标,从所述第一缓存区域中获取最新的第一数据块;所述默认游标表示所述数据获取请求为所述客户端针对所述第一数据源的第一个数据获取请求。If the data cursor is the default cursor, acquire the latest first data block from the first cache area; the default cursor indicates that the data acquisition request is the first request by the client for the first data source data acquisition request.
在一些实施例中,所述获取所述第一数据源所产生的数据并将所述数据缓存到第一缓存区域中,包括:In some embodiments, the acquiring the data generated by the first data source and caching the data in the first cache area includes:
获取所述第一数据源所产生的数据;obtaining data generated by the first data source;
对所述数据进行压缩操作得到压缩数据;compressing the data to obtain compressed data;
将所述压缩数据缓存到第一缓存区域中。The compressed data is cached in the first cache area.
在一些实施例中,所述发送所述第一数据块至所述客户端,包括:In some embodiments, the sending the first data block to the client comprises:
生成下一个数据游标;Generate the next data cursor;
将所述下一个数据游标以及所述第一数据块发送至所述客户端。The next data cursor and the first data block are sent to the client.
第二方面,本公开实施例提供一种数据获取装置,包括:In a second aspect, an embodiment of the present disclosure provides a data acquisition device, including:
数据源获取模块,用于获取第一数据源,其中所述第一数据源为满足预设条件的数据源;a data source acquisition module, configured to acquire a first data source, wherein the first data source is a data source that satisfies a preset condition;
数据缓存模块,用于按照预设时间间隔从数据存储区域中获取所述第一数据源所产生的数据并将所述数据缓存到第一缓存区域中;其中,所述第一缓存区域中的数据以数据块的形式存储,所述数据块中包括在单位时间内所产生的数据;A data cache module, configured to acquire the data generated by the first data source from the data storage area at preset time intervals and cache the data in the first cache area; wherein, the data in the first cache area The data is stored in the form of data blocks, and the data blocks include data generated in a unit time;
请求接收模块,用于接收客户端发送的数据获取请求;The request receiving module is used to receive the data acquisition request sent by the client;
数据块获取模块,用于从所述第一缓存区域中获取与所述数据获取请求对应的第一数据块;a data block obtaining module, configured to obtain the first data block corresponding to the data obtaining request from the first cache area;
数据块发送模块,用于发送所述第一数据块至所述客户端。A data block sending module, configured to send the first data block to the client.
在一些实施例中,所述预设条件包括:连接到数据源上的客户端的数量大于第一阈值;或者,数据源在预设时间内所产生的数据的数量大于第二阈值。In some embodiments, the preset condition includes: the number of clients connected to the data source is greater than a first threshold; or, the amount of data generated by the data source within a preset time is greater than a second threshold.
在一些实施例中,所述数据缓存模块,还用于:In some embodiments, the data cache module is further used for:
响应于经过第一预设时间间隔,从数据存储区中获取所述第一数据源在所述第一预设时间间隔的时长中所产生的数据;其中,所述数据包括数据时间戳;In response to the elapse of a first preset time interval, acquiring data generated by the first data source during the duration of the first preset time interval from the data storage area; wherein the data includes a data timestamp;
将数据时间戳在同一单位时间内的数据组织成数据块;Organize data with data timestamps within the same unit of time into data blocks;
将所述数据块缓存到第一缓存区域中。The data block is cached in the first cache area.
在一些实施例中,数据块获取模块,还用于:In some embodiments, the data block obtaining module is also used to:
根据所述第一数据源的标记确定第一缓存区域;determining a first cache area according to the mark of the first data source;
根据数据游标从所述第一缓存区域中获取与所述数据游标对应的第一数据块。The first data block corresponding to the data cursor is acquired from the first cache area according to the data cursor.
在一些实施例中,所述数据游标包括开始数据的标志或者所述第一数据块的时间戳。In some embodiments, the data cursor includes a flag to start data or a timestamp of the first data block.
在一些实施例中,所述数据块获取模块,还用于:In some embodiments, the data block obtaining module is further configured to:
从所述第一缓存中查询具有所述开始数据的标志的第一数据块或者从所述第一缓存中查询具有所述第一数据块的时间戳的第一数据块。The first data block with the flag of the start data is queried from the first cache or the first data block with the timestamp of the first data block is queried from the first cache.
在一些实施例中,所述数据块获取模块,还用于:In some embodiments, the data block obtaining module is further configured to:
若所述数据游标为默认游标,从所述第一缓存区域中获取最新的第一数据块;所述默认游标表示所述数据获取请求为所述客户端针对所述第一数据源的第一个数据获取请求。If the data cursor is the default cursor, acquire the latest first data block from the first cache area; the default cursor indicates that the data acquisition request is the first request by the client for the first data source data acquisition request.
在一些实施例中,所述数据缓存模块,还用于:In some embodiments, the data cache module is further used for:
获取所述第一数据源所产生的数据;obtaining data generated by the first data source;
对所述数据进行压缩操作得到压缩数据;compressing the data to obtain compressed data;
将所述压缩数据缓存到第一缓存区域中。The compressed data is cached in the first cache area.
在一些实施例中,所述数据块发送模块,还用于:In some embodiments, the data block sending module is further configured to:
生成下一个数据游标;Generate the next data cursor;
将所述下一个数据游标以及所述第一数据块发送至所述客户端。The next data cursor and the first data block are sent to the client.
第三方面,本公开实施例提供一种电子设备,包括:In a third aspect, an embodiment of the present disclosure provides an electronic device, including:
存储器,用于存储计算机可读指令;以及memory for storing computer-readable instructions; and
处理器,用于运行所述计算机可读指令,使得所述电子设备实现上述第一方面中任一项所述的方法。A processor, configured to execute the computer-readable instructions, so that the electronic device implements the method described in any one of the above-mentioned first aspects.
第四方面,本公开实施例提供一种非暂态计算机可读存储介质,用于存储计算机可读指令,当所述计算机可读指令由计算机执行时,使得所述计算机实现上述第一方面中任一项所述的方法。In a fourth aspect, embodiments of the present disclosure provide a non-transitory computer-readable storage medium for storing computer-readable instructions, and when the computer-readable instructions are executed by a computer, enable the computer to implement the first aspect above. The method of any one.
第五方面,本公开实施例还提供一种计算机程序产品,承载有程序代码,所述程序代码包括的指令在由计算机执行时使得计算机实现上述第一方面中任一项所述的方法。In a fifth aspect, an embodiment of the present disclosure further provides a computer program product bearing program code, wherein the instructions included in the program code, when executed by the computer, cause the computer to implement the method described in any one of the first aspects above.
第六方面,本公开实施例还提供一种计算机程序,所述计算机程序包括的指令在由计算机执行时使得计算机实现上述第一方面中任一项所述的方法。In a sixth aspect, an embodiment of the present disclosure further provides a computer program, where the instructions included in the computer program, when executed by the computer, cause the computer to implement the method described in any one of the foregoing first aspects.
上述说明仅是本公开技术方案的概述,为了能更清楚了解本公开的技术手段,而可依照说明书的内容予以实施,并且为让本公开的上述和其他目的、特征和优点能够更明显易懂,以下特举较佳实施例,并配合附图,详细说明如下。The above description is only an overview of the technical solutions of the present disclosure. In order to understand the technical means of the present disclosure more clearly, it can be implemented according to the content of the description, and to make the above and other purposes, features and advantages of the present disclosure more obvious and easy to understand , the following specific preferred embodiments, and in conjunction with the accompanying drawings, are described in detail as follows.
附图说明Description of drawings
结合附图并参考以下具体实施方式,本公开各实施例的上述和其他特征、优点及方面 将变得更加明显。贯穿附图中,相同或相似的附图标记表示相同或相似的元素。应当理解附图是示意性的,原件和元素不一定按照比例绘制。The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent when taken in conjunction with the accompanying drawings and with reference to the following detailed description. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that the originals and elements are not necessarily drawn to scale.
图1为本公开实施例提供的数据获取方法的流程示意图;FIG. 1 is a schematic flowchart of a data acquisition method provided by an embodiment of the present disclosure;
图2为本公开实施例提供的数据获取方法的进一步流程示意图;FIG. 2 is a further schematic flowchart of a data acquisition method provided by an embodiment of the present disclosure;
图3为本公开实施例提供的数据获取方法的应用场景示意图。FIG. 3 is a schematic diagram of an application scenario of the data acquisition method provided by an embodiment of the present disclosure.
图4为本公开实施例提供的数据获取装置的实施例的结构示意图;FIG. 4 is a schematic structural diagram of an embodiment of a data acquisition apparatus provided by an embodiment of the present disclosure;
图5为根据本公开实施例提供的电子设备的结构示意图。FIG. 5 is a schematic structural diagram of an electronic device provided according to an embodiment of the present disclosure.
具体实施方式Detailed ways
下面将参照附图更详细地描述本公开的实施例。虽然附图中显示了本公开的某些实施例,然而应当理解的是,本公开可以通过各种形式来实现,而且不应该被解释为限于这里阐述的实施例,相反提供这些实施例是为了更加透彻和完整地理解本公开。应当理解的是,本公开的附图及实施例仅用于示例性作用,并非用于限制本公开的保护范围。Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for the purpose of A more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes, and are not intended to limit the protection scope of the present disclosure.
应当理解,本公开的方法实施方式中记载的各个步骤可以按照不同的顺序执行,和/或并行执行。此外,方法实施方式可以包括附加的步骤和/或省略执行示出的步骤。本公开的范围在此方面不受限制。It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and/or in parallel. Furthermore, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this regard.
本文使用的术语“包括”及其变形是开放性包括,即“包括但不限于”。术语“基于”是“至少部分地基于”。术语“一个实施例”表示“至少一个实施例”;术语“另一实施例”表示“至少一个另外的实施例”;术语“一些实施例”表示“至少一些实施例”。其他术语的相关定义将在下文描述中给出。As used herein, the term "including" and variations thereof are open-ended inclusions, ie, "including but not limited to". The term "based on" is "based at least in part on." The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions of other terms will be given in the description below.
需要注意,本公开中提及的“第一”、“第二”等概念仅用于对不同的装置、模块或单元进行区分,并非用于限定这些装置、模块或单元所执行的功能的顺序或者相互依存关系。It should be noted that concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or interdependence.
需要注意,本公开中提及的“一个”、“多个”的修饰是示意性而非限制性的,本领域技术人员应当理解,除非在上下文另有明确指出,否则应该理解为“一个或多个”。It should be noted that the modifications of "a" and "a plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless the context clearly indicates otherwise, they should be understood as "one or a plurality of". multiple".
获取直播间内互动消息的方式大体来说有两种:一种是客户端主动到服务端轮询拉取,另一种是由服务端将新消息推送到客户端。对于第一种来说,客户端每隔一段时间向服务端请求消息,服务端确定发送给客户端的消息之后,会将返回的数据进行压缩,客户端拿到数据后会进行解压。压缩对于服务端资源来说是比较大的开销,在客户端较多的情况下, 服务端需要针对每次的请求压缩数据,会耗费大量的cpu(central processing unit)资源,所以带宽和cpu资源之间是矛盾的,想获得一方面收益的同时就要增加另一个的成本。There are generally two ways to obtain interactive messages in the live broadcast room: one is that the client actively polls and pulls from the server, and the other is that the server pushes new messages to the client. For the first type, the client requests messages from the server at regular intervals. After the server determines the message sent to the client, it will compress the returned data, and the client will decompress the data after getting the data. Compression is a relatively large overhead for server resources. In the case of many clients, the server needs to compress data for each request, which will consume a lot of cpu (central processing unit) resources, so bandwidth and cpu resources There is a contradiction between them. If you want to obtain benefits on one side, you must increase the cost of the other.
本公开实施例公开了一种数据获取方法、装置、电子设备和计算机可读存储介质。其中该数据获取方法包括:获取第一数据源,其中所述第一数据源为满足预设条件的数据源;按照第一预设时间间隔从数据存储区域中获取所述第一数据源所产生的数据并将所述数据缓存到第一缓存区域中;其中,所述第一缓存区域中的数据以数据块的形式存储,所述数据块中包括在单位时间内所产生的数据;接收客户端发送的数据获取请求;从所述第一缓存区域中获取与所述数据获取请求对应的第一数据块;发送所述第一数据块至所述客户端。上述方法通过周期性的读取数据源的数据到缓存区域中,在接收到数据获取请求后从缓存区获取数据给客户端,解决了由于获取数据所带来的计算资源浪费的技术问题。The embodiments of the present disclosure disclose a data acquisition method, an apparatus, an electronic device, and a computer-readable storage medium. The data acquisition method includes: acquiring a first data source, wherein the first data source is a data source that satisfies a preset condition; acquiring the first data source from a data storage area according to a first preset time interval and cache the data in the first cache area; wherein, the data in the first cache area is stored in the form of data blocks, and the data blocks include data generated in a unit time; receiving customers the data acquisition request sent by the client; acquire the first data block corresponding to the data acquisition request from the first cache area; and send the first data block to the client. The above method solves the technical problem of wasting computing resources caused by acquiring data by periodically reading the data of the data source into the cache area, and obtaining data from the cache area to the client after receiving the data acquisition request.
图1为本公开实施例提供的数据获取方法实施例的流程图,本实施例提供的该数据获取方法可以由一数据获取装置来执行,该数据获取装置可以实现为软件,或者实现为软件和硬件的组合,该数据获取装置可以集成设置在数据获取系统中的某设备中,比如数据获取服务终端中。如图1所示,该方法包括如下步骤:1 is a flowchart of an embodiment of a data acquisition method provided by an embodiment of the present disclosure. The data acquisition method provided by this embodiment may be executed by a data acquisition device, and the data acquisition device may be implemented as software, or as software and A combination of hardware, the data acquisition device can be integrated in a device in a data acquisition system, such as a data acquisition service terminal. As shown in Figure 1, the method includes the following steps:
步骤S101:获取第一数据源,其中所述第一数据源为满足预设条件的数据源。Step S101: Obtain a first data source, wherein the first data source is a data source that satisfies a preset condition.
在该实施例中,客户端所要获取的数据由数据源产生。示例性的,所述数据源为直播场景下的直播间,所述直播间中包括主播客户端和观众客户端,主播客户端和观众客户端在直播间中互动产生消息,所述消息即为作为数据源的直播间所产生的数据。In this embodiment, the data to be acquired by the client is generated by the data source. Exemplarily, the data source is a live broadcast room in a live broadcast scenario, the live broadcast room includes a host client and a viewer client, and the host client and the audience client interact in the live broadcast room to generate a message, and the message is The data generated by the live studio as the data source.
在该步骤中,获取第一数据源,第一数据源为满足预设条件的数据源。所述预设条件包括:连接到数据源上的客户端的数量大于第一阈值;或者,数据源在预设时间内所产生的数据的数量大于第二阈值。示例性的,所述数据源为直播间,则所述预设条件可以是连接到直播间的客户端的数量大于第一阈值,如直播间所连接的客户端在1000个以上的,为热门直播间,即第一数据源;或者,所述预设条件可以是在单位时间内所产生的消息大于1000条以上,如在一分钟内所产生的消息大于1000条的直播间,为热门直播间,即第一数据源。可以理解的,上述预设条件仅为举例,不构成对本公开的限制,只要能够确定出产生的数据较多的数据源的预设条件均可以设置为预设条件,在此不再赘述。In this step, a first data source is acquired, and the first data source is a data source that satisfies a preset condition. The preset condition includes: the number of clients connected to the data source is greater than the first threshold; or, the amount of data generated by the data source within the preset time is greater than the second threshold. Exemplarily, if the data source is a live broadcast room, the preset condition may be that the number of clients connected to the live broadcast room is greater than the first threshold. For example, if there are more than 1,000 clients connected to the live broadcast room, it is a popular live broadcast. time, that is, the first data source; or, the preset condition may be that more than 1,000 messages are generated in a unit time. For example, a live room with more than 1,000 messages generated within one minute is a popular live room. , that is, the first data source. It can be understood that the above preset conditions are only examples and do not constitute a limitation of the present disclosure. As long as the preset conditions of data sources that generate more data can be determined, they can be set as preset conditions, which will not be repeated here.
返回附图1,所述数据获取方法,还包括步骤S102:按照第一预设时间间隔从数据存储区域中获取所述第一数据源所产生的数据并将所述数据缓存到第一缓存区域中;其中,所述第一缓存区域中的数据以数据块的形式存储,所述数据块中包括在单位时间内所产生的数据。Returning to FIG. 1, the data acquisition method further includes step S102: acquiring data generated by the first data source from a data storage area according to a first preset time interval and caching the data in the first cache area wherein, the data in the first cache area is stored in the form of data blocks, and the data blocks include data generated in a unit time.
所述第一数据源所产生的数据被存储在数据存储区域中,示例性的,所述数据存储区域可以是服务端的存储区域,如服务器中的存储器,或者单独的存储区域,如与服务端连接的网络存储器等等。所述第一数据源所产生的数据可被以适当的方式被存储在数据存储区域中,例如实时地存储,即一旦产生就存储。The data generated by the first data source is stored in a data storage area. Exemplarily, the data storage area may be a storage area of a server, such as a memory in a server, or a separate storage area, such as a storage area with a server. connected network storage, etc. The data generated by the first data source may be stored in the data storage area in a suitable manner, eg in real time, ie as soon as it is generated.
在一些实施例中,如图2所示,所述步骤S102包括:In some embodiments, as shown in FIG. 2 , the step S102 includes:
步骤S201,响应于经过第一预设的时间间隔,从数据存储区中获取所述第一数据源在所述时间间隔的时长中所产生的数据;其中,所述数据包括数据时间戳;Step S201, in response to passing a first preset time interval, obtain data generated by the first data source in the duration of the time interval from a data storage area; wherein, the data includes a data timestamp;
步骤S202,将数据时间戳在同一单位时间内的数据组织成数据块;Step S202, organize the data of the data time stamp within the same unit time into data blocks;
步骤S203,将所述数据块缓存到第一缓存区域中。Step S203, the data block is cached in the first cache area.
在该步骤S201中,按照第一预设时间间隔周期性的从所述数据存储区域获取第一数据源所产生的数据。作为示例,每隔第一预设时间间隔就从所述数据存储区域获取第一数据源所产生的数据,由此数据获取可以周期性地执行。所述存储区域中所存储的数据包括时间戳,所述时间戳可以是所述数据的生成时间或者所述数据的存储时间。特别地,每当要获取数据时,可以获取在获取数据的当前时间/时刻之前或者之后的预设时间间隔内的数据。例如,要获取数据时的时间可以是要获取数据时的当前系统时间,则可以在当前系统时间之前或之后预设时间间隔内的数据。作为一个示例,服务端按照所述第一预设时间间隔,异步地从所述存储区域中获取从上一次获取数据的时刻到本次获取数据的时刻之间所述第一数据源所产生的数据。示例性的,当前系统时间为9:00:01,所述第一预设时间间隔为1秒,则服务端从所述存储区域中获取时间戳在9:00:00到9:00:01之间的第一数据源所产生的数据。In this step S201, periodically acquiring data generated by a first data source from the data storage area according to a first preset time interval. As an example, the data generated by the first data source is acquired from the data storage area every first preset time interval, whereby the data acquisition can be performed periodically. The data stored in the storage area includes a time stamp, and the time stamp may be the generation time of the data or the storage time of the data. In particular, whenever data is to be acquired, data within a preset time interval before or after the current time/moment at which the data is acquired may be acquired. For example, the time when data is to be acquired may be the current system time when data is to be acquired, or data within a preset time interval before or after the current system time. As an example, the server asynchronously acquires, from the storage area according to the first preset time interval, the data generated by the first data source between the time when the data was acquired last time and the time when the data was acquired this time. data. Exemplarily, if the current system time is 9:00:01, and the first preset time interval is 1 second, the server obtains the timestamp from the storage area between 9:00:00 and 9:00:01 between the data generated by the first data source.
在步骤S202中,在获取到所述第一数据源所产生的数据之后,先将所述数据按照单位时间进行组织,生成数据块。所述单位时间的时长可以为任意时长,示例性的,但是单位时间为1秒,则将在时间戳在同1秒内的数据组织成数据块。例如,将时间戳在10:00:00到10:00:01(不包括10:00:01)之间的数据组织成数据块,并标记该数据块的时间戳为10:00:00;将10:00:01到10:00:02(不包括10:00:02)之间的数据组织成数据块,并标记该数据块的时间戳为10:00:01,依次类推。可以理解的,所述单位时间仅为举例,实际上可以使用任何单位时间长度作为组织数据块的单位,在此不再赘述。所述第一预设时间间隔可以与所述单位时间的长度相同,将每次将获取到的数据直接组织成数据块;或者,所述第一预设时间间隔可以大于所述单位时间的长度,将每次获取到的数据按照单位之间进行划分之后再组织成数据块。In step S202, after the data generated by the first data source is acquired, the data is firstly organized according to unit time to generate data blocks. The duration of the unit time may be any duration, which is exemplary, but if the unit time is 1 second, the data with timestamps within the same 1 second are organized into data blocks. For example, organize data with timestamps between 10:00:00 and 10:00:01 (excluding 10:00:01) into data blocks, and mark the data block with a timestamp of 10:00:00; Organize data between 10:00:01 and 10:00:02 (excluding 10:00:02) into data blocks, and mark the data block with a timestamp of 10:00:01, and so on. It can be understood that the unit time is only an example, in fact, any unit time length may be used as a unit for organizing data blocks, which will not be repeated here. The first preset time interval may be the same as the length of the unit time, and the data obtained each time is directly organized into data blocks; or, the first preset time interval may be greater than the length of the unit time. , the data obtained each time is divided according to the units and then organized into data blocks.
在步骤S203中,将所述数据块缓存到第一缓存区域中。所述第一缓存区域为与所述数据存储区域不同的存储区域,第一缓存区域可以由高速缓存构成,使得数据读取速度更快。In step S203, the data block is cached in the first cache area. The first cache area is a different storage area from the data storage area, and the first cache area may be constituted by a cache, so that the data reading speed is faster.
在一些实施例中,所述获取所述第一数据源所产生的数据并将所述数据缓存到第一缓存区域中,包括:In some embodiments, the acquiring the data generated by the first data source and caching the data in the first cache area includes:
获取所述第一数据源所产生的数据;obtaining data generated by the first data source;
对所述数据进行压缩操作得到压缩数据;compressing the data to obtain compressed data;
将所述压缩数据缓存到第一缓存区域中。The compressed data is cached in the first cache area.
在该可选实施例中,将所述数据进行压缩之后,再将压缩数据缓存到第一缓存区域中。可以理解的,所述压缩操作可以在将数据组织成数据块之后执行,也可以在将数据组织成数据块之前执行。In this optional embodiment, after the data is compressed, the compressed data is cached in the first cache area. It can be understood that the compression operation may be performed after the data is organized into data blocks, or may be performed before the data is organized into data blocks.
在一个实施例中,所述步骤S102由数据代理实例执行,所述数据代理实例由服务端的代理层生成。对于第一数据源,可以生成多个数据代理实例,每个数据代理实例均对应一个第一缓存区域,每个数据代理实例均执行所述步骤S102,异步的从所述存储区域中获取第一数据源所产生的数据,分别存储在对应的多个第一缓存区域中;或者,所述多个数据代理实例对应一个第一缓存区域,由其中一个数据代理实例异步的从所述存储域中获取第一数据源所产生的数据并存储在所述第一缓存区域中,多个数据代理实例共享所述第一缓存区域中的数据。可以理解的,所述第一缓存区域带有所述第一数据源的标记,或者所述第一数据源所生成的数据或者数据块带有所述第一数据源的标记。In one embodiment, the step S102 is performed by a data proxy instance, and the data proxy instance is generated by the proxy layer of the server. For the first data source, multiple data proxy instances may be generated, each data proxy instance corresponds to a first cache area, and each data proxy instance executes the step S102 to asynchronously acquire the first cache area from the storage area. The data generated by the data source are respectively stored in the corresponding multiple first cache areas; or, the multiple data proxy instances correspond to one first cache area, and one of the data proxy instances asynchronously retrieves the data from the storage area. The data generated by the first data source is acquired and stored in the first cache area, and multiple data proxy instances share the data in the first cache area. It can be understood that the first cache area is marked with the first data source, or the data or data blocks generated by the first data source are marked with the first data source.
返回附图1,所述数据获取方法,还包括步骤S103:接收客户端发送的数据获取请求。Returning to FIG. 1 , the data acquisition method further includes step S103 : receiving a data acquisition request sent by the client.
在该步骤中,服务端周期性的接收客户端发送的数据获取请求。In this step, the server periodically receives the data acquisition request sent by the client.
客户端以轮询的方式从服务端获取数据,轮询的周期为第二预设时间间隔;所述第二预设时间间隔可以与所述第一预设时间间隔相同,也可以与所述第一预设时间间隔不同。The client obtains data from the server in a polling manner, and the polling period is a second preset time interval; the second preset time interval may be the same as the first preset time interval, or may be the same as the The first preset time intervals are different.
在一个实施例中,使用数据代理实例接收客户端发送的数据获取请求,由于服务端连接有多个客户端,每个客户端均发送数据获取请求,为了减少某些数据代理实例的负担,可以通过负载均衡层将所述客户端发送的数据获取请求均衡的分配至所述数据代理实例上。可选的,所述负载均衡层随机将所述数据获取请求分配至数据代理实例或者根据预设 的策略将所述数据获取请求分配至数据代理实例,在此不再赘述。In one embodiment, a data proxy instance is used to receive a data acquisition request sent by a client. Since there are multiple clients connected to the server, each client sends a data acquisition request. In order to reduce the burden of some data proxy instances, you can The data acquisition request sent by the client is evenly distributed to the data proxy instance through the load balancing layer. Optionally, the load balancing layer randomly assigns the data acquisition request to a data proxy instance or allocates the data acquisition request to a data proxy instance according to a preset policy, which will not be repeated here.
返回附图1,所述数据获取方法,还包括步骤S104:从所述第一缓存区域中获取与所述数据获取请求对应的第一数据块。Returning to FIG. 1, the data acquisition method further includes step S104: acquiring a first data block corresponding to the data acquisition request from the first cache area.
在一些实施例中,所述数据获取请求中包括第一数据源的标记以及数据游标。第一数据源的标记用于表示客户端所请求的数据的来源,所述数据游标用于标记获取数据的起始位置,即本次所请求的数据的起点,所述第一数据源的标记以及数据游标均用于查找客户端所请求的数据。In some embodiments, the data acquisition request includes a mark of the first data source and a data cursor. The mark of the first data source is used to indicate the source of the data requested by the client, and the data cursor is used to mark the starting position of acquiring data, that is, the starting point of the data requested this time, and the mark of the first data source and data cursors are used to find the data requested by the client.
在一些实施例中,所述步骤S104包括:In some embodiments, the step S104 includes:
根据所述第一数据源的标记确定第一缓存区域;determining a first cache area according to the mark of the first data source;
根据所述数据游标从所述第一缓存区域中获取与所述数据游标对应的第一数据块。The first data block corresponding to the data cursor is acquired from the first cache area according to the data cursor.
在该实施例中,所述第一缓存区域包括第一数据源的标记,表示所述第一缓存区域中存储的为第一数据源所产生的数据,所述数据游标用于标记数据请求所要获取的数据,所述数据游标包括开始数据的标志或者所述第一数据块的时间戳。In this embodiment, the first cache area includes a mark of the first data source, indicating that the data stored in the first cache area is the data generated by the first data source, and the data cursor is used to mark the data requested by the data request. For the acquired data, the data cursor includes a flag of starting data or a timestamp of the first data block.
所述根据所述数据游标从所述第一缓存区域中获取与所述数据游标对应的第一数据块,包括:从所述第一缓存中查询具有所述开始数据的标志的第一数据块或者从所述第一缓存中查询具有所述第一数据块的时间戳的第一数据块。The obtaining the first data block corresponding to the data cursor from the first cache area according to the data cursor includes: querying the first data block with the flag of the start data from the first cache Or query the first data block with the timestamp of the first data block from the first cache.
当数据游标为开始数据的标志,通过所述第一数据源的标记查询存储有第一数据源的数据的第一缓存区域,之后通过开始数据的标志查询本次需要获取的第一数据块。如在直播场景中,每个消息均具有全局唯一的编号,可以将该消息的编号作为数据游标。在一个实施例中,所述数据游标为第一数据块中第一个数据的标志,该标志可以作为所述第一数据块的索引使用;或者,所述数据游标还可以是上次获取数据时所获取到的数据块中的最后一个数据的标识,通过该标识可以查询到上次获取的数据块,通过上次获取的数据块可以确定本次所需要获取的数据块,即上次获取的数据块之后的第一个数据块即为本次需要获取的第一数据块。When the data cursor is the mark of starting data, the first cache area storing the data of the first data source is queried through the mark of the first data source, and then the first data block to be acquired this time is queried through the mark of starting data. For example, in a live broadcast scenario, each message has a globally unique number, and the number of the message can be used as a data cursor. In one embodiment, the data cursor is a flag of the first data in the first data block, and the flag can be used as an index of the first data block; or, the data cursor can also be the last acquired data The identifier of the last data in the data block acquired at the time, through which the last acquired data block can be queried, and the last acquired data block can be used to determine the data block to be acquired this time, that is, the last acquisition The first data block after the data block is the first data block to be acquired this time.
当数据游标为第一数据块的时间戳,通过所述第一数据源的标记查询存储有第一数据源的数据的第一缓存区域,之后通过第一数据块的时间戳查询本次需要获取的第一数据块。如在直播场景中,服务端在消息代理实例在获取到直播间的消息时候,生成所述消息的数据块并给所述数据块打上时间戳;当消息代理实例接收到消息获取请求,根据所述消息获取请求中的数据块时间戳查询第一缓存中的数据块的时间戳,如果有数据块的时间戳 与所述消息获取请求中的时间戳相同,则消息代理实例获取所述数据块作为本地消息获取请求所对应的第一数据块。在一些实施例中,所述数据请求中的第一数据块的时间戳所对应的时间早于当前系统时间,如客户端每1秒发送一次数据获取请求,当前服务端的系统时间为10:00:00,则所述数据获取请求中的第一数据块的时间戳为09:59:59,此时服务端从第一缓存中将时间戳为09:59:59的第一数据块去读出来;而1秒后,即系统时间为10:00:01时,服务端接收到下一个数据获取请求,其中的第一数据块的时间戳为10:00:00,此时服务端从第一缓存中将时间戳为10:00:00的第一数据块去读出来。如果第一数据块的时间戳所对应的时间与当前系统时间相同,则可能出现当前时间的数据还未完整写入第一缓存,所得到的数据可能是不完整的,因此设置数据请求中的第一数据块的时间戳所对应的时间早于当前系统时间,能够保证当前时间所产生的新数据能够被完整的保存在第一缓存中,服务端所读取的数据也是完整的一个单位时间内所产生的数据。When the data cursor is the timestamp of the first data block, the first cache area storing the data of the first data source is queried through the mark of the first data source, and then the time stamp of the first data block is used to query the data that needs to be obtained this time. the first data block. For example, in the live broadcast scenario, when the message broker instance obtains the message in the live broadcast room, the server generates the data block of the message and stamps the data block with a timestamp; when the message broker instance receives the message acquisition request, according to the Query the timestamp of the data block in the first cache from the timestamp of the data block in the message acquisition request. If the timestamp of the data block is the same as the timestamp in the message acquisition request, the message broker instance acquires the data block. Obtain the first data block corresponding to the request as a local message. In some embodiments, the time corresponding to the timestamp of the first data block in the data request is earlier than the current system time. For example, if the client sends a data acquisition request every 1 second, the current system time of the server is 10:00 :00, the timestamp of the first data block in the data acquisition request is 09:59:59, and the server reads the first data block with a timestamp of 09:59:59 from the first cache After 1 second, that is, when the system time is 10:00:01, the server receives the next data acquisition request, and the timestamp of the first data block is 10:00:00. At this time, the server starts from the first data block. Read out the first data block with a timestamp of 10:00:00 in a cache. If the time corresponding to the timestamp of the first data block is the same as the current system time, it may happen that the data at the current time has not been completely written to the first cache, and the obtained data may be incomplete. Therefore, set the The time corresponding to the timestamp of the first data block is earlier than the current system time, which can ensure that the new data generated at the current time can be completely stored in the first cache, and the data read by the server is also a complete unit of time. data generated within.
在一些实施例中,所述步骤S104包括:若所述数据游标为默认游标,从所述第一缓存区域中获取最新的第一数据块;所述默认游标表示所述数据获取请求为所述客户端针对所述第一数据源的第一个数据获取请求。在该可选实施例中,如所述数据获取请求中的数据游标为默认游标,表示该数据获取请求为某个客户端发送的第一个数据获取请求,此时从所述第一缓存区域中获取其中最新的第一数据块。如在直播场景中,需要客户端与服务端的消息具有强实时性,因此当客户端连接到直播间并且开始获取直播间中其他客户端发送的消息时,服务端获取当前所存储的最新的消息。In some embodiments, the step S104 includes: if the data cursor is a default cursor, obtaining the latest first data block from the first cache area; the default cursor indicates that the data obtaining request is the The client makes a first data acquisition request for the first data source. In this optional embodiment, if the data cursor in the data acquisition request is the default cursor, it means that the data acquisition request is the first data acquisition request sent by a client, and at this time, the data is obtained from the first cache area. Get the latest first data block in it. For example, in the live broadcast scenario, the messages between the client and the server need to be highly real-time. Therefore, when the client connects to the live room and starts to obtain the messages sent by other clients in the live room, the server obtains the latest currently stored message. .
返回附图1,所述数据获取方法,还包括步骤S105:发送所述第一数据块至所述客户端。Returning to FIG. 1, the data acquisition method further includes step S105: sending the first data block to the client.
在该步骤中,服务端将获取到的第一数据块发送至发送所述数据请求的客户端。In this step, the server sends the acquired first data block to the client that sends the data request.
在一些实施例中,所述步骤S105包括:In some embodiments, the step S105 includes:
生成下一个数据游标;Generate the next data cursor;
将所述下一个数据游标以及所述第一数据块发送至所述客户端。The next data cursor and the first data block are sent to the client.
服务端在将第一数据块发送到客户端之前,可以生成所述客户端在下次发送数据请求时所要使用的数据游标作为上述下一个数据游标,如上所述,所述下一个数据游标也可包括下一开始数据的标志或者所述第一数据块的下一时间戳,其中所述下一开始数据的标志为服务端此次获取的第一数据块中最后一个数据的标志,服务端在下次接收到客户端的数据获取请求之后,根据所述数据的标志确定出需要获取的第一数据块;或者,下一时间 戳可以是此次获取的第一数据块的时间戳之后的且相隔特定间隔的时间戳,该特定间隔可以被适当的设定,例如可以是前述预设时间间隔、单位时间长度,任何其它适当设定值等等,这样通过所述第一数据块的下一时间戳查询第一缓存中与所述下一时间戳对应的第一数据块。Before sending the first data block to the client, the server may generate a data cursor to be used by the client when sending a data request next time as the above-mentioned next data cursor. As mentioned above, the next data cursor may also be used. Including the sign of the next start data or the next time stamp of the first data block, wherein the sign of the next start data is the sign of the last data in the first data block obtained by the server this time, and the server is in the next After receiving the data acquisition request of the client for the second time, determine the first data block to be acquired according to the data flag; or, the next timestamp may be after the timestamp of the first data block acquired this time and separated by a specific time The timestamp of the interval, the specific interval can be appropriately set, for example, it can be the aforementioned preset time interval, unit time length, any other suitable setting value, etc., so that the next timestamp of the first data block is passed The first data block corresponding to the next timestamp in the first cache is queried.
服务端在将所述第一数据块发送至所述客户端的同时,将所述下一个数据游标发送至所述客户端,使得所述客户端在下次发送数据获取请求时以使用所述数据游标。The server sends the next data cursor to the client while sending the first data block to the client, so that the client can use the data cursor when sending a data acquisition request next time .
通过上述步骤S101至步骤S105,服务端按照第一预设时间间隔异步的从数据存储区域中获取第一数据源所产生的数据,并缓存在第一缓存区域中,第一缓存区域中的数据以数据块的形式存储,这样每次有客户端发送数据获取请求之后,服务端所发送的数据块均为相同的数据块,即客户端得到的数据块的分段是相同的,而不像现有技术中每个客户端所得到的数据可能是不同的,这样服务端不用针对每个客户端单独从存储区域中获取数据,而是可以从缓存中获取到客户端所请求的数据,减少了从数据存储区域中获取数据的次数,提高了获取数据时的数据命中率以及CPU的使用效率。Through the above steps S101 to S105, the server asynchronously obtains the data generated by the first data source from the data storage area according to the first preset time interval, and caches the data in the first cache area. The data in the first cache area It is stored in the form of data blocks, so that every time a client sends a data acquisition request, the data blocks sent by the server are the same data blocks, that is, the segments of the data blocks obtained by the client are the same, unlike In the prior art, the data obtained by each client may be different, so that the server does not need to obtain data from the storage area separately for each client, but can obtain the data requested by the client from the cache. The number of times of fetching data from the data storage area is increased, and the data hit rate and CPU usage efficiency when fetching data are improved.
上述实施例公开了一种数据获取方法,该数据获取方法包括:获取第一数据源,其中所述第一数据源为满足预设条件的数据源;按照第一预设时间间隔从数据存储区域中获取所述第一数据源所产生的数据并将所述数据缓存到第一缓存区域中;其中,所述第一缓存区域中的数据以数据块的形式存储,所述数据块中包括在单位时间内所产生的数据;接收客户端发送的数据获取请求;从所述第一缓存区域中获取与所述数据获取请求对应的第一数据块;发送所述第一数据块至所述客户端。上述方法通过周期性的读取数据源的数据到缓存区域中,在接收到数据获取请求后从缓存区获取数据给客户端,解决了由于获取数据所带来的计算资源浪费的技术问题。The above embodiment discloses a data acquisition method, the data acquisition method includes: acquiring a first data source, wherein the first data source is a data source that satisfies a preset condition; Obtain the data generated by the first data source and cache the data in the first cache area; wherein, the data in the first cache area is stored in the form of data blocks, and the data blocks include data generated in a unit time; receive a data acquisition request sent by the client; acquire the first data block corresponding to the data acquisition request from the first cache area; send the first data block to the client end. The above method solves the technical problem of wasting computing resources caused by acquiring data by periodically reading the data of the data source into the cache area, and obtaining data from the cache area to the client after receiving the data acquisition request.
如图3所述为本公开实施例中所述的数据获取方法的应用场景示意图。如图3所示,为直播场景,其中301为直播服务器以及终端设备3021至302n;其中直播服务器301中安装有服务端,终端设备中安装有客户端,用户可以通过所述客户端创建直播间以播主的身份进行直播,或者通过客户端进入直播间,以观众的身份观看直播;直播期间,客户端发送消息给直播间中的其他客户端。客户端发送的消息均发送到服务器的数据存储区域中包括,之后客户端以1秒的时间间隔轮询服务器,获取直播间中其他客户端发送的消息。服务器301中安装有服务端,其中服务端包括负载均衡层和消息代理层,其中负载均衡层用于接收客户端通过轮询的方式发送的消息获取请求,即每秒会接收到同一个客户端发送的消息获取请求,之后随机的发送至消息代理层中的消息代理实例中;消息代理层中的消 息代理实例用于处理所述消息获取请求,获取与所述消息获取请求对应的消息。消息代理实例包括多个,每个消息代理实例都可以独立的执行上述数据获取方法,即消息代理实例获取高热直播间,如在线人数高于1000人的直播间,或者每分钟产生的消息的数量大于1000的直播间等等。在确定高热直播间之后,每个消息代理实例每秒中异步的从所述数据存储区域中获取上一秒钟该直播间中所产生的数据,并按照1秒钟的时间长度将数据分为数据块,存储在所述消息代理实例的缓存区域中,每个消息代理实例对应一个缓存区域,如图3中所述的缓存区域,为一个消息代理实例的缓存区域,其中包括了3秒钟的消息,其中10:00:00的数据块中包括消息0、1、2;10:10:01的数据块中包括消息3、4、5、6、7;10:10:02的数据块中包括消息8、9、10、11。在该应用场景中,客户端轮询的时间间隔、消息代理实例获取消息的时间间隔以及划分数据块的时间长度相同,这样所有的客户端每次获取的数据块的分段是一样的。当一个消息获取请求发送到消息代理实例上之后,消息代理实例解析出其中的数据游标,其中包括了本次需要获取的数据块的时间戳。为了消息读取的完整,数据游标中的数据块的时间戳为当前系统时间的前1秒,比如当前时间是10:10:01,接收到一个消息获取请求,从数据游标中解析出时间戳是10:10:00,此时消息代理实例从时间戳为10:10:00的缓存块中读取全部消息,即图3中的消息0、1、2,并在返回的数据游标中打上时间戳10:10:01;当下次消息获取请求再次到达服务端时,时间应该是10:10:01之后(因为客户端1秒轮询一次),则,此时把时间戳为10:10:01的缓存块中的消息全部返回给客户端,即图3中的消息3、4、5、6、7。FIG. 3 is a schematic diagram of an application scenario of the data acquisition method described in the embodiment of the present disclosure. As shown in FIG. 3, it is a live broadcast scene, wherein 301 is a live broadcast server and terminal devices 3021 to 302n; wherein a server is installed in the live broadcast server 301, and a client is installed in the terminal device, and a user can create a live broadcast room through the client Live broadcast as the host, or enter the live broadcast room through the client, and watch the live broadcast as a viewer; during the live broadcast, the client sends messages to other clients in the live broadcast room. The messages sent by the client are all sent to the data storage area of the server, and then the client polls the server at 1-second intervals to obtain messages sent by other clients in the live room. A server is installed in the server 301, wherein the server includes a load balancing layer and a message broker layer, wherein the load balancing layer is used to receive a message acquisition request sent by the client through polling, that is, the same client is received every second The sent message acquisition request is then randomly sent to a message broker instance in the message broker layer; the message broker instance in the message broker layer is used to process the message acquisition request and acquire a message corresponding to the message acquisition request. There are multiple message broker instances, and each message broker instance can independently execute the above data acquisition method, that is, the message broker instance obtains a high-volume live broadcast room, such as a live broadcast room with more than 1,000 people online, or the number of messages generated per minute. More than 1000 live broadcast rooms and so on. After determining the hot live broadcast room, each message broker instance asynchronously acquires the data generated in the live broadcast room in the last second from the data storage area every second, and divides the data into 1 second time length. The data block is stored in the cache area of the message broker instance. Each message broker instance corresponds to a cache area. The cache area described in Figure 3 is the cache area of a message broker instance, including 3 seconds. message, where the data block at 10:00:00 includes messages 0, 1, and 2; the data block at 10:10:01 includes messages 3, 4, 5, 6, and 7; the data block at 10:10:02 Contains messages 8, 9, 10, 11. In this application scenario, the time interval for client polling, the time interval for message broker instances to obtain messages, and the time length for dividing data blocks are the same, so that all clients obtain the same data block segmentation each time. After a message acquisition request is sent to the message broker instance, the message broker instance parses the data cursor, which includes the timestamp of the data block to be acquired this time. In order to complete the message reading, the timestamp of the data block in the data cursor is the first 1 second of the current system time, for example, the current time is 10:10:01. When a message acquisition request is received, the timestamp is parsed from the data cursor. It is 10:10:00. At this time, the message broker instance reads all messages from the cache block with a timestamp of 10:10:00, that is, messages 0, 1, and 2 in Figure 3, and marks it in the returned data cursor. The timestamp is 10:10:01; when the next message acquisition request arrives at the server again, the time should be after 10:10:01 (because the client polls every second), then the timestamp is 10:10 All messages in the cache block of :01 are returned to the client, namely messages 3, 4, 5, 6, and 7 in Figure 3.
由于上面的机制,每个客户端的消息获取请求中的数据游标都是每1秒(系统时间的前1秒)对应的数据块中的时间戳,也就将全部消息获取请求的数据游标都进行了对齐,返回的消息也都是按块来分隔,也就是说每个客户端得到的数据分段是一样的。将压缩后的消息进行缓存,能够大幅提高缓存命中率;并且由于每一份压缩的消息可以转发给多个客户端,不用针对每个消息获取请求都到数据存储区域获取消息并执行压缩操作,因此可以大大减少由于压缩所带来的CPU消耗。Due to the above mechanism, the data cursor in each client's message acquisition request is the timestamp in the corresponding data block every 1 second (the first 1 second of the system time), that is, the data cursors of all message acquisition requests are processed. In order to align, the returned messages are also separated by blocks, that is to say, the data segments obtained by each client are the same. Cache the compressed message, which can greatly improve the cache hit rate; and because each compressed message can be forwarded to multiple clients, it is not necessary to go to the data storage area to obtain the message and perform the compression operation for each message acquisition request. Therefore, the CPU consumption due to compression can be greatly reduced.
在上文中,虽然按照上述的顺序描述了上述方法实施例中的各个步骤,本领域技术人员应清楚,本公开实施例中的步骤并不必然按照上述顺序执行,其也可以倒序、并行、交叉等其他顺序执行,而且,在上述步骤的基础上,本领域技术人员也可以再加入其他步骤,这些明显变型或等同替换的方式也应包含在本公开的保护范围之内,在此不再赘述。In the above, although the steps in the above method embodiments are described in the above order, it should be clear to those skilled in the art that the steps in the embodiments of the present disclosure are not necessarily executed in the above order, and may also be performed in reverse order, parallel, interleaved and other steps are performed in other order, and, on the basis of the above steps, those skilled in the art can also add other steps, these obvious modifications or equivalent replacement modes should also be included within the protection scope of the present disclosure, and will not be repeated here. .
图4为本公开实施例提供的数据获取装置实施例的结构示意图。如图4所示,该装置400包括:数据源获取模块401、数据缓存模块402、请求接收模块403、数据块获取模块 404和数据块发送模块405。其中,FIG. 4 is a schematic structural diagram of an embodiment of a data acquisition apparatus according to an embodiment of the present disclosure. As shown in FIG. 4 , the apparatus 400 includes: a data source obtaining module 401, a data buffering module 402, a request receiving module 403, a data block obtaining module 404 and a data block sending module 405. in,
数据源获取模块401,用于获取第一数据源,其中所述第一数据源为满足预设条件的数据源;A data source acquisition module 401, configured to acquire a first data source, wherein the first data source is a data source that satisfies a preset condition;
数据缓存模块402,用于按照预设时间间隔从数据存储区域中获取所述第一数据源所产生的数据并将所述数据缓存到第一缓存区域中;其中,所述第一缓存区域中的数据以数据块的形式存储,所述数据块中包括在单位时间内所产生的数据;A data cache module 402, configured to acquire data generated by the first data source from a data storage area at preset time intervals and cache the data in the first cache area; wherein, the first cache area The data is stored in the form of data blocks, and the data blocks include the data generated in unit time;
请求接收模块403,用于接收客户端发送的数据获取请求;A request receiving module 403, configured to receive a data acquisition request sent by the client;
数据块获取模块404,用于从所述第一缓存区域中获取与所述数据获取请求对应的第一数据块;A data block obtaining module 404, configured to obtain the first data block corresponding to the data obtaining request from the first cache area;
数据块发送模块405,用于发送所述第一数据块至所述客户端。A data block sending module 405, configured to send the first data block to the client.
在一些实施例中,所述预设条件包括:连接到数据源上的客户端的数量大于第一阈值;或者,数据源在预设时间内所产生的数据的数量大于第二阈值。In some embodiments, the preset condition includes: the number of clients connected to the data source is greater than a first threshold; or, the amount of data generated by the data source within a preset time is greater than a second threshold.
在一些实施例中,所述数据缓存模块402,还用于:In some embodiments, the data caching module 402 is further configured to:
响应于经过第一预设时间间隔,从数据存储区中获取所述第一数据源在所述第一预设时间间隔的时长中所产生的数据;其中,所述数据包括数据时间戳;In response to the elapse of a first preset time interval, acquiring data generated by the first data source during the duration of the first preset time interval from the data storage area; wherein the data includes a data timestamp;
将数据时间戳在同一单位时间内的数据组织成数据块;Organize data with data timestamps within the same unit of time into data blocks;
将所述数据块缓存到第一缓存区域中。The data block is cached in the first cache area.
在一些实施例中,数据块获取模块404,还用于:In some embodiments, the data block obtaining module 404 is further configured to:
根据所述第一数据源的标记确定第一缓存区域;determining a first cache area according to the mark of the first data source;
根据所述数据游标从所述第一缓存区域中获取与所述数据游标对应的第一数据块。The first data block corresponding to the data cursor is acquired from the first cache area according to the data cursor.
在一些实施例中,所述数据游标包括开始数据的标志或者所述第一数据块的时间戳。In some embodiments, the data cursor includes a flag to start data or a timestamp of the first data block.
在一些实施例中,数据块获取模块404,还用于:In some embodiments, the data block obtaining module 404 is further configured to:
从所述第一缓存中查询具有所述开始数据的标志的第一数据块或者从所述第一缓存中查询具有所述第一数据块的时间戳的第一数据块。The first data block with the flag of the start data is queried from the first cache or the first data block with the timestamp of the first data block is queried from the first cache.
在一些实施例中,数据块获取模块404,还用于:In some embodiments, the data block obtaining module 404 is further configured to:
若所述数据游标为默认游标,从所述第一缓存区域中获取最新的第一数据块;所述默 认游标表示所述数据获取请求为所述客户端针对所述第一数据源的第一个数据获取请求。If the data cursor is the default cursor, acquire the latest first data block from the first cache area; the default cursor indicates that the data acquisition request is the first request by the client for the first data source data acquisition request.
在一些实施例中,所述数据缓存模块402,还用于:In some embodiments, the data caching module 402 is further configured to:
获取所述第一数据源所产生的数据;obtaining data generated by the first data source;
对所述数据进行压缩操作得到压缩数据;compressing the data to obtain compressed data;
将所述压缩数据缓存到第一缓存区域中。The compressed data is cached in the first cache area.
在一些实施例中,所述数据块发送模块405,还用于:In some embodiments, the data block sending module 405 is further configured to:
生成下一个数据游标;Generate the next data cursor;
将所述下一个数据游标以及所述第一数据块发送至所述客户端。The next data cursor and the first data block are sent to the client.
图4所示装置可以执行图1所示实施例的方法,本实施例未详细描述的部分,可参考对图1所示实施例的相关说明。该技术方案的执行过程和技术效果参见图1所示实施例中的描述,在此不再赘述。The apparatus shown in FIG. 4 may execute the method of the embodiment shown in FIG. 1 . For the parts not described in detail in this embodiment, reference may be made to the related description of the embodiment shown in FIG. 1 . For the execution process and technical effect of the technical solution, refer to the description in the embodiment shown in FIG. 1 , which will not be repeated here.
下面参考图5,其示出了适于用来实现本公开实施例的电子设备500的结构示意图。本公开实施例中的终端设备可以包括但不限于诸如移动电话、笔记本电脑、数字广播接收器、PDA(个人数字助理)、PAD(平板电脑)、PMP(便携式多媒体播放器)、车载终端(例如车载导航终端)等等的移动终端以及诸如数字TV、台式计算机等等的固定终端。图5示出的电子设备仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。Referring next to FIG. 5 , it shows a schematic structural diagram of an electronic device 500 suitable for implementing an embodiment of the present disclosure. Terminal devices in the embodiments of the present disclosure may include, but are not limited to, such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablets), PMPs (portable multimedia players), vehicle-mounted terminals (eg, mobile terminals such as in-vehicle navigation terminals), etc., and stationary terminals such as digital TVs, desktop computers, and the like. The electronic device shown in FIG. 5 is only an example, and should not impose any limitation on the function and scope of use of the embodiments of the present disclosure.
如图5所示,电子设备500可以包括处理装置(例如中央处理器、图形处理器等)501,其可以根据存储在只读存储器(ROM)502中的程序或者从存储装置508加载到随机访问存储器(RAM)503中的程序而执行各种适当的动作和处理。在RAM 503中,还存储有电子设备500操作所需的各种程序和数据。处理装置501、ROM 502以及RAM 503通过总线504彼此相连。输入/输出(I/O)接口505也连接至总线504。As shown in FIG. 5 , an electronic device 500 may include a processing device (eg, a central processing unit, a graphics processor, etc.) 501 that may be loaded into random access according to a program stored in a read only memory (ROM) 502 or from a storage device 508 Various appropriate actions and processes are executed by the programs in the memory (RAM) 503 . In the RAM 503, various programs and data required for the operation of the electronic device 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other through a bus 504. An input/output (I/O) interface 505 is also connected to bus 504 .
通常,以下装置可以连接至I/O接口505:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置506;包括例如液晶显示器(LCD)、扬声器、振动器等的输出装置507;包括例如磁带、硬盘等的存储装置508;以及通信装置509。通信装置509可以允许电子设备500与其他设备进行无线或有线通信以交换数据。虽然图5示出了具有各种装置的电子设备500,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。Typically, the following devices may be connected to the I/O interface 505: input devices 506 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; including, for example, a liquid crystal display (LCD), speakers, vibration An output device 507 such as a computer; a storage device 508 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 509 . Communication means 509 may allow electronic device 500 to communicate wirelessly or by wire with other devices to exchange data. While FIG. 5 shows electronic device 500 having various means, it should be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在非暂态计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置509从网络上被下载和安装,或者从存储装置508被安装,或者从ROM 502被安装。在该计算机程序被处理装置501执行时,执行本公开实施例的方法中限定的上述功能。In particular, according to embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated in the flowchart. In such an embodiment, the computer program may be downloaded and installed from the network via the communication device 509, or from the storage device 508, or from the ROM 502. When the computer program is executed by the processing apparatus 501, the above-mentioned functions defined in the methods of the embodiments of the present disclosure are executed.
需要说明的是,本公开上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the above two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or a combination of any of the above. More specific examples of computer readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable Programmable read only memory (EPROM or flash memory), fiber optics, portable compact disk read only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing. In this disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present disclosure, however, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave with computer-readable program code embodied thereon. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device . Program code embodied on a computer readable medium may be transmitted using any suitable medium including, but not limited to, electrical wire, optical fiber cable, RF (radio frequency), etc., or any suitable combination of the foregoing.
在一些实施方式中,客户端、服务器可以利用诸如HTTP(HyperText Transfer Protocol,超文本传输协议)之类的任何当前已知或未来研发的网络协议进行通信,并且可以与任意形式或介质的数字数据通信(例如,通信网络)互连。通信网络的示例包括局域网(“LAN”),广域网(“WAN”),网际网(例如,互联网)以及端对端网络(例如,ad hoc端对端网络),以及任何当前已知或未来研发的网络。In some embodiments, the client and server can use any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol) to communicate, and can communicate with digital data in any form or medium Communication (eg, a communication network) interconnects. Examples of communication networks include local area networks ("LAN"), wide area networks ("WAN"), the Internet (eg, the Internet), and peer-to-peer networks (eg, ad hoc peer-to-peer networks), as well as any currently known or future development network of.
上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。The above-mentioned computer-readable medium may be included in the above-mentioned electronic device; or may exist alone without being assembled into the electronic device.
上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备:执行上述实施例中的数据获取方法。The above computer readable medium carries one or more programs, when the one or more programs are executed by the electronic device, the electronic device causes the electronic device to: execute the data acquisition method in the above embodiment.
可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的计算机程序代码,上述程序设计语言包括但不限于面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。Computer program code for performing operations of the present disclosure may be written in one or more programming languages, including but not limited to object-oriented programming languages—such as Java, Smalltalk, C++, and This includes conventional procedural programming languages - such as the "C" language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (eg, using an Internet service provider through Internet connection).
附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code that contains one or more logical functions for implementing the specified functions executable instructions. It should also be noted that, in some alternative implementations, the functions noted in the blocks may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It is also noted that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented in dedicated hardware-based systems that perform the specified functions or operations , or can be implemented in a combination of dedicated hardware and computer instructions.
描述于本公开实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,单元的名称在某种情况下并不构成对该单元本身的限定。The units involved in the embodiments of the present disclosure may be implemented in a software manner, and may also be implemented in a hardware manner. Among them, the name of the unit does not constitute a limitation of the unit itself under certain circumstances.
本文中以上描述的功能可以至少部分地由一个或多个硬件逻辑部件来执行。例如,非限制性地,可以使用的示范类型的硬件逻辑部件包括:现场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、片上系统(SOC)、复杂可编程逻辑设备(CPLD)等等。The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), Systems on Chips (SOCs), Complex Programmable Logical Devices (CPLDs) and more.
在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光 学储存设备、磁储存设备、或上述内容的任何合适组合。In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in connection with the instruction execution system, apparatus or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media may include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media would include one or more wire-based electrical connections, portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), fiber optics, compact disk read only memory (CD-ROM), optical storage, magnetic storage, or any suitable combination of the foregoing.
根据本公开的一个或多个实施例,提供了一种电子设备,包括:至少一个处理器;以及,与所述至少一个处理器通信连接的存储器;其中,所述存储器存储有能被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行前述第一方面中的任一所述数据获取方法。According to one or more embodiments of the present disclosure, there is provided an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores data that can be accessed by the at least one processor Instructions executed by at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform any one of the data acquisition methods of the foregoing first aspect.
根据本公开的一个或多个实施例,提供了一种非暂态计算机可读存储介质,其特征在于,该非暂态计算机可读存储介质存储计算机指令,该计算机指令用于使计算机执行前述第一方面中的任一所述数据获取方法。According to one or more embodiments of the present disclosure, a non-transitory computer-readable storage medium is provided, wherein the non-transitory computer-readable storage medium stores computer instructions for causing a computer to execute the foregoing Any one of the data acquisition methods in the first aspect.
以上描述仅为本公开的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本公开中所涉及的公开范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述公开构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本公开中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of the disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, and should also cover, without departing from the above-mentioned disclosed concept, the technical solutions formed by the above-mentioned technical features or Other technical solutions formed by any combination of its equivalent features. For example, a technical solution is formed by replacing the above features with the technical features disclosed in the present disclosure (but not limited to) with similar functions.

Claims (14)

  1. 一种数据获取方法,包括:A data acquisition method, including:
    获取第一数据源,其中所述第一数据源为满足预设条件的数据源;acquiring a first data source, wherein the first data source is a data source that satisfies a preset condition;
    按照第一预设时间间隔从数据存储区域中获取所述第一数据源所产生的数据并将所述数据缓存到第一缓存区域中;其中,所述第一缓存区域中的数据以数据块的形式存储,所述数据块中包括在单位时间内所产生的数据;Acquire the data generated by the first data source from the data storage area according to the first preset time interval and cache the data in the first cache area; wherein, the data in the first cache area is divided into data blocks It is stored in the form of data block, and the data block includes the data generated in unit time;
    接收客户端发送的数据获取请求;Receive the data acquisition request sent by the client;
    从所述第一缓存区域中获取与所述数据获取请求对应的第一数据块;Acquire the first data block corresponding to the data acquisition request from the first cache area;
    发送所述第一数据块至所述客户端。Sending the first data block to the client.
  2. 如权利要求1所述的数据获取方法,其中,所述预设条件包括:连接到数据源上的客户端的数量大于第一阈值;或者,数据源在预设时间内所产生的数据的数量大于第二阈值。The data acquisition method according to claim 1, wherein the preset condition comprises: the number of clients connected to the data source is greater than the first threshold; or, the amount of data generated by the data source within the preset time is greater than second threshold.
  3. 如权利要求1所述的数据获取方法,其中,所述按照第一预设时间间隔从数据存储区域中获取所述第一数据源所产生的数据并将所述数据缓存到第一缓存区域中,包括:The data acquisition method according to claim 1, wherein the data generated by the first data source is acquired from a data storage area according to a first preset time interval and the data is cached in the first cache area ,include:
    响应于经过第一预设时间间隔,从数据存储区中获取所述第一数据源在所述第一预设时间间隔的时长中所产生的数据;其中,所述数据包括数据时间戳;In response to the elapse of a first preset time interval, acquiring data generated by the first data source during the duration of the first preset time interval from the data storage area; wherein the data includes a data timestamp;
    将数据时间戳在同一单位时间内的数据组织成数据块;Organize data with data timestamps within the same unit of time into data blocks;
    将所述数据块缓存到第一缓存区域中。The data block is cached in the first cache area.
  4. 如权利要求1所述的数据获取方法,其中,所述数据获取请求中包括所述第一数据源的标记以及数据游标,所述从所述第一缓存区域中获取与所述数据获取请求对应的第一数据块,包括:The data acquisition method according to claim 1, wherein the data acquisition request includes a mark of the first data source and a data cursor, and the acquisition from the first cache area corresponds to the data acquisition request The first block of data includes:
    根据所述第一数据源的标记确定第一缓存区域;determining a first cache area according to the mark of the first data source;
    根据所述数据游标从所述第一缓存区域中获取与所述数据游标对应的第一数据块。The first data block corresponding to the data cursor is acquired from the first cache area according to the data cursor.
  5. 如权利要求4所述的数据获取方法,其中,所述数据游标包括开始数据的标志或者所述第一数据块的时间戳。The data acquisition method of claim 4, wherein the data cursor includes a flag of starting data or a time stamp of the first data block.
  6. 如权利要求5所述的数据获取方法,其中,所述根据所述数据游标从所述第一缓存区域中获取与所述数据游标对应的第一数据块,包括:The data acquisition method according to claim 5, wherein the acquiring the first data block corresponding to the data cursor from the first cache area according to the data cursor comprises:
    从所述第一缓存中查询具有所述开始数据的标志的第一数据块或者从所述第一缓存中查询具有所述第一数据块的时间戳的第一数据块。The first data block with the flag of the start data is queried from the first cache or the first data block with the timestamp of the first data block is queried from the first cache.
  7. 如权利要求4所述的数据获取方法,其中,所述从所述第一缓存区域中获取与所述数据获取请求对应的第一数据块,包括:The data acquisition method according to claim 4, wherein the acquiring the first data block corresponding to the data acquisition request from the first cache area comprises:
    若所述数据游标为默认游标,从所述第一缓存区域中获取最新的第一数据块;所述默认游标表示所述数据获取请求为所述客户端针对所述第一数据源的第一个数据获取请求。If the data cursor is the default cursor, acquire the latest first data block from the first cache area; the default cursor indicates that the data acquisition request is the first request by the client for the first data source data acquisition request.
  8. 如权利要求1所述的数据获取方法,其中,所述获取所述第一数据源所产生的数据并将所述数据缓存到第一缓存区域中,包括:The data acquisition method according to claim 1, wherein the acquiring the data generated by the first data source and caching the data in the first cache area comprises:
    获取所述第一数据源所产生的数据;obtaining data generated by the first data source;
    对所述数据进行压缩操作得到压缩数据;compressing the data to obtain compressed data;
    将所述压缩数据缓存到第一缓存区域中。The compressed data is cached in the first cache area.
  9. 如权利要求1所述的数据获取方法,其中,所述发送所述第一数据块至所述客户端,包括:The data acquisition method of claim 1, wherein the sending the first data block to the client comprises:
    生成下一个数据游标;Generate the next data cursor;
    将所述下一个数据游标以及所述第一数据块发送至所述客户端。The next data cursor and the first data block are sent to the client.
  10. 一种数据获取装置,包括:A data acquisition device, comprising:
    数据源获取模块,用于获取第一数据源,其中所述第一数据源为满足预设条件的数据源;a data source acquisition module, configured to acquire a first data source, wherein the first data source is a data source that satisfies a preset condition;
    数据缓存模块,用于按照预设时间间隔从数据存储区域中获取所述第一数据源所产生的数据并将所述数据缓存到第一缓存区域中;其中,所述第一缓存区域中的数据以数据块的形式存储,所述数据块中包括在单位时间内所产生的数据;A data cache module, configured to acquire the data generated by the first data source from the data storage area at preset time intervals and cache the data in the first cache area; wherein, the data in the first cache area The data is stored in the form of data blocks, and the data blocks include data generated in a unit time;
    请求接收模块,用于接收客户端发送的数据获取请求;The request receiving module is used to receive the data acquisition request sent by the client;
    数据块获取模块,用于从所述第一缓存区域中获取与所述数据获取请求对应的第一数据块;a data block obtaining module, configured to obtain the first data block corresponding to the data obtaining request from the first cache area;
    数据块发送模块,用于发送所述第一数据块至所述客户端。A data block sending module, configured to send the first data block to the client.
  11. 一种电子设备,包括:An electronic device comprising:
    存储器,用于存储计算机可读指令;以及memory for storing computer-readable instructions; and
    处理器,用于运行所述计算机可读指令,使得所述电子设备实现根据权利要求1-9中任意一项所述的方法。A processor for executing the computer-readable instructions to cause the electronic device to implement the method according to any one of claims 1-9.
  12. 一种计算机可读存储介质,用于存储计算机可读指令,当所述计算机可读指令由计算机执行时,使得所述计算机实现权利要求1-9中任意一项所述的方法。A computer-readable storage medium for storing computer-readable instructions, which, when executed by a computer, cause the computer to implement the method of any one of claims 1-9.
  13. 一种计算机程序产品,承载有程序代码,所述程序代码包括的指令在由计算机执行时使得计算机执行如权利要求1-9中任一项所述的方法。A computer program product carrying program code comprising instructions, when executed by a computer, that cause the computer to perform the method of any of claims 1-9.
  14. 一种计算机程序,所述计算机程序包括的指令在由计算机执行时使得计算机执行如权利要求1-9中任一项的方法。A computer program comprising instructions which, when executed by a computer, cause the computer to perform the method of any of claims 1-9.
PCT/CN2022/082205 2021-03-30 2022-03-22 Data acquisition method and apparatus, electronic device, and computer-readable storage medium WO2022206474A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110337448.2A CN115145956A (en) 2021-03-30 2021-03-30 Data acquisition method and device, electronic equipment and computer readable storage medium
CN202110337448.2 2021-03-30

Publications (1)

Publication Number Publication Date
WO2022206474A1 true WO2022206474A1 (en) 2022-10-06

Family

ID=83403805

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/082205 WO2022206474A1 (en) 2021-03-30 2022-03-22 Data acquisition method and apparatus, electronic device, and computer-readable storage medium

Country Status (2)

Country Link
CN (1) CN115145956A (en)
WO (1) WO2022206474A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104850507A (en) * 2014-02-18 2015-08-19 腾讯科技(深圳)有限公司 Data caching method and data caching device
CN110543495A (en) * 2019-08-29 2019-12-06 北京东方国信科技股份有限公司 cursor traversal storage method and device
CN111737295A (en) * 2020-06-11 2020-10-02 上海达梦数据库有限公司 Database cursor query method, device, equipment and storage medium
CN112395260A (en) * 2020-11-11 2021-02-23 苏宁云计算有限公司 Data storage method and medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104850507A (en) * 2014-02-18 2015-08-19 腾讯科技(深圳)有限公司 Data caching method and data caching device
CN110543495A (en) * 2019-08-29 2019-12-06 北京东方国信科技股份有限公司 cursor traversal storage method and device
CN111737295A (en) * 2020-06-11 2020-10-02 上海达梦数据库有限公司 Database cursor query method, device, equipment and storage medium
CN112395260A (en) * 2020-11-11 2021-02-23 苏宁云计算有限公司 Data storage method and medium

Also Published As

Publication number Publication date
CN115145956A (en) 2022-10-04

Similar Documents

Publication Publication Date Title
CN110147398B (en) Data processing method, device, medium and electronic equipment
WO2022068488A1 (en) Message sending control method and apparatus, and electronic device and computer-readable storage medium
CN111314433B (en) Message transmission method and device and electronic equipment
US20220256226A1 (en) Video data processing method, electronic device and computer-readable medium
CN114205664B (en) Screen projection method, screen projection device, screen projection display device, screen projection system and medium
WO2023179505A1 (en) Scheduling method and apparatus for content delivery network, and storage medium and electronic device
CN112135169A (en) Media content loading method, device, equipment and medium
CN112256733A (en) Data caching method and device, electronic equipment and computer readable storage medium
CN111163336B (en) Video resource pushing method and device, electronic equipment and computer readable medium
CN111225255B (en) Target video push playing method and device, electronic equipment and storage medium
CN109951737B (en) Video processing method, video processing device, electronic equipment and computer-readable storage medium
WO2022206474A1 (en) Data acquisition method and apparatus, electronic device, and computer-readable storage medium
CN111274104B (en) Data processing method, device, electronic equipment and computer readable storage medium
WO2023273576A1 (en) Abnormal request processing method and apparatus, electronic device and storage medium
WO2022105682A1 (en) Paging data acquisition method and apparatus, electronic device, and computer readable storage medium
WO2022048490A1 (en) Data processing method and apparatus, and electronic device
CN112100211B (en) Data storage method, apparatus, electronic device, and computer readable medium
CN111625745B (en) Recommendation method, recommendation device, electronic equipment and computer readable medium
CN112163176A (en) Data storage method and device, electronic equipment and computer readable medium
CN111581556A (en) Page data processing method and device, electronic equipment and readable medium
CN117692672B (en) Snapshot-based video information sending method and device, electronic equipment and medium
CN111258670B (en) Method and device for managing component data, electronic equipment and storage medium
CN113342837B (en) Data transmission method, device, electronic equipment and computer readable medium
CN112948108B (en) Request processing method and device and electronic equipment
CN115225586B (en) Data packet transmitting method, device, equipment and computer readable storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22778657

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 130224)