CN113297203A - Data query and write-in method and device, computer storage medium and electronic equipment - Google Patents

Data query and write-in method and device, computer storage medium and electronic equipment Download PDF

Info

Publication number
CN113297203A
CN113297203A CN202010678385.2A CN202010678385A CN113297203A CN 113297203 A CN113297203 A CN 113297203A CN 202010678385 A CN202010678385 A CN 202010678385A CN 113297203 A CN113297203 A CN 113297203A
Authority
CN
China
Prior art keywords
data
identification information
write
written
request
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010678385.2A
Other languages
Chinese (zh)
Other versions
CN113297203B (en
Inventor
李辉
潘岳
胡进
肖孝云
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba Cloud Computing Ltd
Original Assignee
Alibaba Group Holding Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN202010678385.2A priority Critical patent/CN113297203B/en
Publication of CN113297203A publication Critical patent/CN113297203A/en
Application granted granted Critical
Publication of CN113297203B publication Critical patent/CN113297203B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/22Indexing; Data structures therefor; Storage structures
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本申请公开一种数据查询方法和装置,查询数据获取方法和装置,查询数据标识信息的发送方法和装置,数据写入方法和装置,数据写入请求的发送方法和装置,写入数据的读取方法和装置,分析型数据库系统,以及计算机存储介质和电子设备;查询方法包括:获取数据查询请求;根据数据查询请求,确定待查询目标数据的标识信息是否与存储的当前写入数据的标识信息相匹配;若不匹配,则获取与当前写入数据的标识信息相邻的、且写入顺序在当前写入数据之后的新写入数据及新写入数据的标识信息;确定新写入数据的标识信息与待查询目标数据的标识信息是否匹配;若是,则将新写入数据确定为待查询目标数据;避免由于延迟等因素而导致查询数据不准确或者有偏差。

Figure 202010678385

The present application discloses a data query method and device, query data acquisition method and device, query data identification information sending method and device, data writing method and device, data writing request sending method and device, writing data reading Obtaining method and device, analytical database system, and computer storage medium and electronic equipment; the query method includes: obtaining a data query request; according to the data query request, determining whether the identification information of the target data to be queried is the same as that of the stored currently written data. The information matches; if it does not match, obtain the identification information of the new written data and the newly written data adjacent to the identification information of the current written data and whose writing order is after the current written data; determine the new write Whether the identification information of the data matches the identification information of the target data to be queried; if so, the newly written data is determined as the target data to be queried; to avoid inaccurate or biased query data due to factors such as delays.

Figure 202010678385

Description

数据查询和写入方法和装置,计算机存储介质和电子设备Data query and writing method and apparatus, computer storage medium and electronic device

技术领域technical field

本申请涉及计算机应用领域,具体涉及一种数据查询方法和装置,查询数据的获取方法和装置,查询数据标识信息的发送方法和装置,数据写入方法和装置,数据写入请求的发送方法和装置,写入数据的读取方法和装置,分析型数据库系统,计算机存储介质以及电子设备。The present application relates to the field of computer applications, and in particular to a method and device for querying data, a method and device for acquiring query data, a method and device for sending identification information of query data, a method and device for writing data, a method and device for sending a data writing request, and a method and device for sending query data identification information. Apparatus, method and apparatus for reading written data, analytical database system, computer storage medium, and electronic equipment.

背景技术Background technique

传统数据库主要是用于数据的存储,以及针对数据进行读写等相关数据处理操作。随着计算机信息技术的发展,普遍存在的巨大变化就是大数据的产生,因为,从所收集的数据中提取出有用的信息,以此改善各行业的发展定位并促进经济的发展是至关重要的,因此,需要大量数据为后续数据信息的提取等相关操作提供服务基础。Traditional databases are mainly used for data storage and related data processing operations such as reading and writing data. With the development of computer information technology, the great change that prevails is the generation of big data, because it is crucial to extract useful information from the collected data to improve the development orientation of various industries and promote economic development Therefore, a large amount of data is required to provide a service basis for subsequent data information extraction and other related operations.

近几年随着大数据的不断发展,各行各业对数据价值的探索有了更高要求。传统的针对大数据的数据存储系统而言,离线读写计算等操作已然不能够满足数据在线统计、数据在线分析、即席查询等发掘信息数据价值的工作。故此,面对大数据(BigData)处理的传统数据库逐渐向能够提供时效性和处理速度更高要求的数据库发展。In recent years, with the continuous development of big data, all walks of life have higher requirements for the exploration of data value. For traditional data storage systems for big data, operations such as offline reading, writing and computing are no longer sufficient for online data statistics, online data analysis, ad hoc query and other work to explore the value of information and data. Therefore, the traditional database facing Big Data (BigData) processing gradually develops to the database that can provide higher requirements on timeliness and processing speed.

发明内容SUMMARY OF THE INVENTION

本申请提供一种数据查询方法,以解决现有技术中查询的数据实时可见性差的问题。The present application provides a data query method to solve the problem of poor real-time visibility of queried data in the prior art.

本申请提供一种数据查询方法,包括:The present application provides a data query method, including:

获取数据查询请求,所述数据查询请求中携带有待查询目标数据的标识信息,其中,所述标识信息用于标识写入数据写入顺序的信息,所述待查询目标数据的标识信息为按照写入顺序范围确定的最后写入的所述写入数据的标识信息;Obtain a data query request, where the data query request carries the identification information of the target data to be queried, wherein the identification information is used to identify the information of the writing sequence of the written data, and the identification information of the target data to be queried is according to the written The identification information of the last written written data determined by the sequence range;

根据所述数据查询请求,确定所述待查询目标数据的标识信息是否与存储的当前写入数据的标识信息相匹配;According to the data query request, determine whether the identification information of the target data to be queried matches the stored identification information of the currently written data;

若不匹配,则获取与所述当前写入数据的标识信息相邻的、且写入顺序在所述当前写入数据之后的新写入数据及新写入数据的标识信息;If it does not match, then acquire the identification information of the newly written data and the newly written data adjacent to the identification information of the current written data and whose writing order is after the current written data;

确定所述新写入数据的标识信息与所述待查询目标数据的标识信息是否匹配;Determine whether the identification information of the newly written data matches the identification information of the target data to be queried;

若是,则将所述新写入数据确定为所述待查询目标数据。If so, the newly written data is determined as the target data to be queried.

在一些实施例中,还包括:In some embodiments, it also includes:

读取写入数据信息;Read and write data information;

将读取的所述写入数据信息中的标识信息确定为所述当前写入数据的标识信息;Determine the identification information in the read write data information as the identification information of the current write data;

将与所述当前写入数据的标识信息对应的所述写入数据,以及所述当前写入数据的标识信息存储在本地;The write data corresponding to the identification information of the current write data and the identification information of the current write data are stored locally;

所述根据所述数据查询请求,确定所述待查询目标数据的标识信息是否与存储的当前写入数据的标识信息相匹配,包括:Determining, according to the data query request, whether the identification information of the target data to be queried matches the identification information of the stored currently written data, including:

确定所述待查询目标数据的标识信息是否与存储在本地的所述当前写入数据的标识信息相匹配。It is determined whether the identification information of the target data to be queried matches the identification information of the currently written data stored locally.

在一些实施例中,所述读取写入数据信息,包括:In some embodiments, the reading and writing data information includes:

通过异步方式,按照读取周期读取所述写入数据信息。In an asynchronous manner, the write data information is read according to the read cycle.

在一些实施例中,还包括:In some embodiments, it also includes:

当所述新写入数据的标识信息与所述待查询目标数据的标识信息匹配时,将所述当前写入数据更新为获取的所述新写入数据,以及将所述当前写入数据的标识信息更新为所述新写入数据的标识信息。When the identification information of the newly written data matches the identification information of the target data to be queried, update the current written data to the acquired new written data, and update the current written data The identification information is updated to the identification information of the newly written data.

在一些实施例中,所述根据所述数据查询请求,确定所述目标数据的标识信息是否与存储的当前写入数据的标识信息相匹配,包括:In some embodiments, determining whether the identification information of the target data matches the stored identification information of the currently written data according to the data query request includes:

将所述待查询目标数据的标识信息的识别码与所述当前写入数据的标识信息的识别码进行比较;Compare the identification code of the identification information of the target data to be queried with the identification code of the identification information of the currently written data;

若所述待查询目标数据的标识信息的识别码大于所述当前写入数据的标识信息的识别码,则确定所述待查询目标数据的标识信息的识别码与所述当前写入数据的标识信息的识别码不匹配。If the identification code of the identification information of the target data to be queried is greater than the identification code of the identification information of the currently written data, determine the identification code of the identification information of the target data to be queried and the identification of the currently written data The identifiers of the messages do not match.

在一些实施例中,还包括:In some embodiments, it also includes:

若所述待查询目标数据的标识信息的识别码小于或等于所述当前写入数据的标识信息的识别码,则确定所述待查询目标数据的标识信息的识别码与所述当前写入数据的标识信息的识别码匹配;If the identification code of the identification information of the target data to be queried is less than or equal to the identification code of the identification information of the currently written data, determine the identification code of the identification information of the target data to be queried and the current written data The identification code of the identification information matches;

将所述当前写入数据确定为所述待查询目标数据。The currently written data is determined as the target data to be queried.

在一些实施例中,所述确定所述新写入数据的标识信息与所述待查询目标数据的标识信息是否匹配,包括:In some embodiments, the determining whether the identification information of the newly written data matches the identification information of the target data to be queried includes:

将所述新写入数据的标识信息的识别码与所述待查询目标数据的标识信息的识别码进行比较;Compare the identification code of the identification information of the newly written data with the identification code of the identification information of the target data to be queried;

若所述新写入数据的标识信息的识别码大于或等于所述待查询目标数据的标识信息的识别码,则确定所述新写入数据的标识信息与所述目标数据的标识信息匹配。If the identification code of the identification information of the newly written data is greater than or equal to the identification code of the identification information of the target data to be queried, it is determined that the identification information of the newly written data matches the identification information of the target data.

在一些实施例中,所述将所述新写入数据的标识信息的识别码与所述待查询目标数据的标识信息的识别码进行比较,还包括:In some embodiments, comparing the identification code of the identification information of the newly written data with the identification code of the identification information of the target data to be queried further includes:

若所述新写入数据的标识信息的识别码小于所述待查询目标数据的标识信息的识别码时,则确定所述新写入数据的标识信息与所述目标数据的标识信息不匹配;If the identification code of the identification information of the newly written data is smaller than the identification code of the identification information of the target data to be queried, then it is determined that the identification information of the newly written data does not match the identification information of the target data;

返回到所述获取与所述当前写入数据的标识信息相邻的、且写入顺序在所述当前写入顺序之后的新写入数据及新写入数据的标识信息的步骤。Return to the step of acquiring the identification information of newly written data and the newly written data adjacent to the identification information of the current written data and whose writing order is after the current writing order.

在一些实施例中,还包括:In some embodiments, it also includes:

发送确定的所述待查询目标数据。The determined target data to be queried is sent.

本申请还提供一种数据查询装置,包括:The application also provides a data query device, comprising:

第一获取单元,用于获取数据查询请求,所述数据查询请求中携带有待查询目标数据的标识信息,其中,所述标识信息用于标识写入数据写入顺序的信息,所述待查询目标数据的标识信息为按照写入顺序范围确定的最后写入的所述写入数据的标识信息;a first obtaining unit, configured to obtain a data query request, where the data query request carries identification information of the target data to be queried, wherein the identification information is used to identify the information of the writing sequence of the written data, the target data to be queried The identification information of the data is the identification information of the last written written data determined according to the writing sequence range;

第一确定单元,用于根据所述数据查询请求,确定所述待查询目标数据的标识信息是否与存储的当前写入数据的标识信息相匹配;a first determining unit, configured to determine, according to the data query request, whether the identification information of the target data to be queried matches the stored identification information of the currently written data;

第二获取单元,用于基于所述第一确定单元的匹配结果为不匹配时,获取与所述当前写入数据的标识信息相邻的、且写入顺序在所述当前写入顺序之后的新写入数据及新写入数据的标识信息;a second obtaining unit, configured to obtain, when the matching result of the first determining unit is a mismatch, obtain the identification information adjacent to the currently written data and whose writing order is after the current writing order The newly written data and the identification information of the newly written data;

第二确定单元,用于确定所述新写入数据的标识信息与所述待查询目标数据的标识信息是否匹配;a second determining unit, configured to determine whether the identification information of the newly written data matches the identification information of the target data to be queried;

第三确定单元,用于基于所述第二确定单元中匹配结果为匹配时,将所述新写入数据确定为所述待查询目标数据。A third determining unit, configured to determine the newly written data as the target data to be queried based on the matching result in the second determining unit being a match.

本申请还提供一种查询数据的获取方法,包括:The present application also provides a method for acquiring query data, including:

接收数据查询请求;Receive data query requests;

根据所述数据查询请求,获取新写入数据的标识信息,所述新写入数据的标识信息为按照写入顺序范围确定的最后写入的写入数据的标识信息;According to the data query request, the identification information of the newly written data is obtained, and the identification information of the newly written data is the identification information of the last written write data determined according to the writing sequence range;

将所述标识信息封装到所述数据查询请求中并进行发送;Encapsulate the identification information into the data query request and send it;

获取响应于封装有所述标识信息的所述数据查询请求返回的目标数据。Obtain the target data returned in response to the data query request encapsulated with the identification information.

本申请还提供一种查询数据的获取装置,包括:The present application also provides a device for acquiring query data, including:

接收单元,用于接收数据查询请求;a receiving unit for receiving a data query request;

第一获取单元,用于根据所述数据查询请求,获取新写入数据的标识信息,所述新写入数据为按照写入顺序范围确定的最后写入的写入数据;a first obtaining unit, configured to obtain, according to the data query request, the identification information of newly written data, where the newly written data is the last written write data determined according to the writing sequence range;

封装发送单元,用于将所述标识信息封装到所述数据查询请求中并进行发送;an encapsulation sending unit, configured to encapsulate the identification information into the data query request and send it;

第二获取单元,用于获取响应于封装有所述标识信息的所述数据查询请求返回的目标数据。A second acquiring unit, configured to acquire target data returned in response to the data query request encapsulated with the identification information.

本申请还提供一种查询数据标识信息的发送方法,包括:The present application also provides a method for sending query data identification information, including:

接收针对新写入数据的标识信息的获取请求,其中,所述新写入数据的标识信息为按照写入顺序范围确定的最后写入的写入数据的标识信息;Receive an acquisition request for the identification information of the newly written data, wherein the identification information of the newly written data is the identification information of the last written write data determined according to the writing sequence range;

根据所述获取请求,将按照写入顺序范围确定的最后写入的写入数据的标识信息作为新写入数据的标识信息进行发送。According to the acquisition request, the identification information of the last written write data determined according to the write sequence range is sent as the identification information of the newly written data.

本申请还提供一种查询数据标识信息的发送装置,包括:The present application also provides a sending device for querying data identification information, including:

接收单元,用于接收针对新写入数据的标识信息的获取请求,其中,所述新写入数据的标识信息为按照写入顺序范围确定的最后写入的写入数据的标识信息;A receiving unit for receiving an acquisition request for the identification information of the newly written data, wherein the identification information of the newly written data is the identification information of the last written write data determined according to the writing sequence range;

发送单元,用于根据所述接收单元中的所述获取请求,根据所述获取请求,将按照写入顺序范围确定的最后写入的写入数据的标识信息作为新写入数据的标识信息进行发送。The sending unit is used for, according to the acquisition request in the receiving unit, according to the acquisition request, the identification information of the last written write data determined according to the writing sequence range is used as the identification information of the new write data. send.

本申请还提供一种数据写入方法,包括:The present application also provides a data writing method, comprising:

接收数据写入请求,其中,所述数据写入请求中携带有需要写入的写入数据;receiving a data write request, wherein the data write request carries write data that needs to be written;

根据所述数据写入请求,为所述写入数据配置标识信息;其中,所述标识信息用于标识所述写入数据写入顺序的信息;According to the data write request, configure identification information for the write data; wherein, the identification information is used to identify the information of the write data writing sequence;

根据所述写入数据以及所述写入数据的标识信息进行写入操作。The write operation is performed according to the write data and the identification information of the write data.

在一些实施例中,还包括:In some embodiments, it also includes:

接收用于描述所述写入数据写入状态的状态信息;receiving state information describing the write state of the write data;

发送所述状态信息。Send the status information.

在一些实施例中,所述接收数据写入请求,包括:In some embodiments, the receiving a data write request includes:

根据设置的接收数据写入请求范围,接收针对相同写入分区的不同写入数据的数据写入请求。According to the set receive data write request range, receive data write requests for different write data in the same write partition.

在一些实施例中,所述根据设置的接收数据写入请求范围,接收针对相同写入分区的不同写入数据的数据写入请求,包括:In some embodiments, the receiving data write requests for different write data of the same write partition according to the set range of the received data write request includes:

根据设置的接收所述数据写入请求的接收时间范围,接收针对相同写入分区的不同写入数据的数据写入请求;或者,Receive data write requests for different write data of the same write partition according to the set receiving time range for receiving the data write request; or,

根据设置的接收所述数据写入请求的接收容量范围,接收针对相同写入分区的不同写入数据的数据写入请求。According to the set receiving capacity range for receiving the data write request, data write requests for different write data of the same write partition are received.

在一些实施例中,所述根据所述数据写入请求,为所述写入数据配置标识信息,包括:In some embodiments, configuring identification information for the write data according to the data write request includes:

将所述数据写入请求中的所述不同写入数据,确定为写入数据集合;determining the different write data in the data write request as a write data set;

为所述写入数据集合配置所述标识信息。The identification information is configured for the write data set.

在一些实施例中,所述根据所述写入数据以及所述写入数据的标识信息进行写入操作,包括:In some embodiments, performing the write operation according to the write data and the identification information of the write data includes:

根据所述写入数据集合以及对应所述写入数据集合的标识信息,进行写入操作。The write operation is performed according to the write data set and the identification information corresponding to the write data set.

本申请还提供一种数据写入装置,包括:The application also provides a data writing device, comprising:

接收单元,用于接收数据写入请求;其中,所述数据写入请求中携带有需要写入的写入数据;a receiving unit, configured to receive a data write request; wherein, the data write request carries write data that needs to be written;

配置单元,用于根据所述数据写入请求,为所述写入数据配置标识信息;其中,所述标识信息用于标识所述写入数据写入顺序的信息;a configuration unit, configured to configure identification information for the write data according to the data write request; wherein the identification information is used to identify the information of the write order of the write data;

写入单元,用于根据所述写入数据以及所述写入数据的标识信息进行写入操作。The writing unit is configured to perform a writing operation according to the writing data and the identification information of the writing data.

本申请还提供一种数据写入请求的发送方法,包括:The present application also provides a method for sending a data write request, including:

发送数据写入请求,其中,所述数据写入请求中携带有需要写入的写入数据;Sending a data write request, wherein the data write request carries write data that needs to be written;

接收响应于所述数据写入请求返回的针对所述写入数据的写入状态信息。Receive write status information for the write data returned in response to the data write request.

在一些实施例中,所述发送所述数据写入请求,包括:In some embodiments, the sending the data write request includes:

根据所述数据写入请求中携带的用于描述所述写入数据的属性信息,确定与所述写入数据对应的缓存节点;determining a cache node corresponding to the write data according to the attribute information carried in the data write request and used to describe the write data;

将所述数据写入请求发送到对应的所述缓存节点。Send the data write request to the corresponding cache node.

在一些实施例中,所述根据所述数据写入请求中携带的用于描述所述写入数据的属性信息,确定与所述写入数据对应的缓存节点,包括:In some embodiments, determining the cache node corresponding to the write data according to the attribute information carried in the data write request and used to describe the write data includes:

根据所述属性信息中描述所述写入数据的写入数据库的标识和写入数据表的标识,建立针对所述写入数据的写入路径信息;According to the identifier of the write database and the identifier of the write data table describing the write data in the attribute information, establish write path information for the write data;

根据所述写入路径信息,获取所述写入数据表的分区信息;According to the write path information, obtain the partition information of the write data table;

根据所述分区信息,确定与所述写入数据对应的所述缓存节点。According to the partition information, the cache node corresponding to the write data is determined.

本申请还提供一种数据写入请求的发送装置,包括:The present application also provides a device for sending a data write request, including:

发送单元,用于发送数据写入请求,其中,所述数据写入请求中携带有需要写入的写入数据;a sending unit, configured to send a data write request, wherein the data write request carries write data that needs to be written;

接收单元,用于接收响应于所述数据写入请求返回的针对所述写入数据的写入状态信息。A receiving unit, configured to receive write status information for the write data returned in response to the data write request.

本申请还提供一种写入数据的读取方法,包括:The present application also provides a method for reading written data, comprising:

根据发送的读取写入数据信息的读取请求,读取写入数据以及所述写入数据的标识信息;According to the read request sent to read the write data information, read the write data and the identification information of the write data;

将所述写入数据确定为当前写入数据,将所述写入数据的标识信息确定为所述当前写入数据的标识信息;The write data is determined as the current write data, and the identification information of the write data is determined as the identification information of the current write data;

将所述当前写入数据以及所述当前写入数据的标识信息存储在本地。The currently written data and the identification information of the currently written data are stored locally.

在一些实施例中,所述根据发送的读取写入数据信息的读取请求,读取写入数据以及所述写入数据的标识信息,包括:In some embodiments, the reading of the write data and the identification information of the write data according to the sent read request to read the write data information includes:

通过异步方式,按照读取周期发送所述读取请求;sending the read request according to the read cycle in an asynchronous manner;

根据所述读取请求,读取所述写入数据以及所述写入数据的标识信息。According to the read request, the write data and the identification information of the write data are read.

本申请还提供一种写入数据的读取装置,包括:The application also provides a reading device for writing data, comprising:

读取单元,用于根据发送的读取写入数据信息的读取请求,读取写入数据以及所述写入数据的标识信息;a reading unit, configured to read the write data and the identification information of the write data according to the read request sent to read the write data information;

确定单元,用于将所述写入数据确定为当前写入数据,将所述写入数据的标识信息确定为所述当前写入数据的标识信息;a determining unit, configured to determine the write data as the current write data, and determine the identification information of the write data as the identification information of the current write data;

存储单元,用于将所述当前写入数据以及所述当前写入数据的标识信息存储在本地。A storage unit, configured to store the currently written data and the identification information of the currently written data locally.

本申请还提供一种分析型数据库系统,包括:前端节点、缓存节点和计算节点;The application also provides an analytical database system, including: a front-end node, a cache node and a computing node;

其中,所述前端节点用于发送数据操作请求到所述缓存节点,以及针对所述数据操作请求返回的操作状态或目标数据或新写入数据的标识信息;当所述前端节点接收的所述数据操作请求为数据写入请求时,将接收的所述数据写入请求发送到所述缓存节点,并接收所述缓存节点响应于所述数据写入请求返回的针对所述数据写入请求中,写入数据的写入状态信息;当所述前端节点接收的所述数据操作请求为数据查询请求时,将根据接收的所述数据查询请求,从所述缓存节点获取新写入数据的标识信息,所述新写入数据的标识信息为按照写入顺序范围确定的最后写入的写入数据的标识信息,将所述新写入数据的标识信息封装到所述数据查询请求中发送到所述计算节点,获取所述计算节点针对所述数据查询请求确定的目标数据;Wherein, the front-end node is used to send a data operation request to the cache node, and the operation status or target data or identification information of newly written data returned for the data operation request; when the front-end node receives the When the data operation request is a data write request, send the received data write request to the cache node, and receive the data write request returned by the cache node in response to the data write request. , the write status information of the written data; when the data operation request received by the front-end node is a data query request, the identifier of the newly written data will be obtained from the cache node according to the received data query request information, the identification information of the newly written data is the identification information of the last written written data determined according to the writing sequence range, and the identification information of the newly written data is encapsulated into the data query request and sent to The computing node obtains the target data determined by the computing node for the data query request;

所述缓存节点用于接收来自所述前端节点的所述数据操作请求,以及向所述前端节点发送响应于所述数据操作请求的信息;其中,当所述缓存节点接收的所述数据操作请求为所述数据写入请求时,根据所述数据写入请求,为所述数据写入请求中携带的写入数据配置标识信息;其中,所述标识信息用于标识所述写入数据写入顺序的信息,根据所述写入数据以及所述写入数据的标识信息进行写入操作;当所述缓存节点接收的所述数据操作请求为所述数据查询请求时,所述缓存节点接收来自所述前端节点的针对新写入数据的标识信息的获取请求,根据所述获取请求,将按照写入顺序范围确定的最后写入的写入数据的标识信息作为新写入数据的标识信息发送给所述前端节点;The cache node is configured to receive the data operation request from the front-end node, and send information in response to the data operation request to the front-end node; wherein, when the data operation request received by the cache node For the data write request, according to the data write request, configure identification information for the write data carried in the data write request; wherein, the identification information is used to identify the write data write sequence information, and perform the write operation according to the write data and the identification information of the write data; when the data operation request received by the cache node is the data query request, the cache node receives the request from The acquisition request of the front-end node for the identification information of the newly written data, according to the acquisition request, the identification information of the last written write data determined according to the writing sequence range is sent as the identification information of the newly written data to the front-end node;

所述计算节点用于获取来自所述前端节点的数据查询请求,所述数据查询请求中携带有待查询目标数据的标识信息,其中,所述标识信息用于标识写入数据写入顺序的信息,所述待查询目标数据的标识信息为按照写入顺序范围确定的最后写入的所述写入数据的标识信息;根据所述数据查询请求,确定所述待查询目标数据的标识信息是否与存储的当前写入数据的标识信息相匹配;若不匹配,则获取与所述当前写入数据的标识信息相邻的、且写入顺序在所述当前写入顺序之后的新写入数据及新写入数据的标识信息;确定所述新写入数据的标识信息与所述待查询目标数据的标识信息是否匹配;若是,则将所述新写入数据确定为所述待查询目标数据;或者,根据向所述缓存节点发送的读取写入数据信息的读取请求,读取写入数据以及所述写入数据的标识信息;将所述写入数据确定为当前写入数据,将所述写入数据的标识信息确定为所述当前写入数据的标识信息;将所述当前写入数据以及所述当前写入数据的标识信息存储在本地。The computing node is used to obtain a data query request from the front-end node, and the data query request carries the identification information of the target data to be queried, wherein the identification information is used to identify the information of the writing sequence of the written data, The identification information of the target data to be queried is the identification information of the last written written data determined according to the writing sequence range; according to the data query request, it is determined whether the identification information of the target data to be queried is the same as the stored data. The identification information of the current write data matches; if it does not match, then acquire the new write data and the new write data adjacent to the identification information of the current write data and whose writing order is after the current writing order. Identification information of the written data; determine whether the identification information of the newly written data matches the identification information of the target data to be queried; if so, determine the newly written data as the target data to be queried; or , according to the read request to read and write data information sent to the cache node, read the write data and the identification information of the write data; determine the write data as the current write data, The identification information of the written data is determined as the identification information of the currently written data; the current written data and the identification information of the currently written data are stored locally.

在一些实施例中,还包括:In some embodiments, it also includes:

服务协调节点,用于根据所述前端节点中的所述数据写入请求中写入数据的属性信息,提供与所述写入数据对应的所述缓存节点;a service coordination node, configured to provide the cache node corresponding to the written data according to the attribute information of the written data in the data write request in the front-end node;

所述前端节点根据所述服务协调节点提供的所述缓存节点,将所述数据写入请求发送到与所述位置信息对应的所述缓存节点。The front-end node sends the data write request to the cache node corresponding to the location information according to the cache node provided by the service coordination node.

在一些实施例中,所述服务协调节点,根据所述前端节点基于所述属性信息中用于描述所述写入数据的写入数据库的标识和写入数据表的标识,建立的针对所述写入数据的写入路径信息,提供所述写入数据表的分区信息;In some embodiments, the service coordination node, based on the identifier of the write database and the identifier of the write data table used to describe the write data in the attribute information, established by the front-end node for the Write path information of the write data, providing partition information of the write data table;

所述前端节点能够根据所述分区信息中的缓存节点的地址和端口,确定所述写入数据对应的所述缓存节点。The front-end node can determine the cache node corresponding to the write data according to the address and port of the cache node in the partition information.

在一些实施例中,还包括:存储节点,用于存储所述缓存节点接收的需要写入的写入数据,并针对所述写入数据返回写入状态信息。In some embodiments, the method further includes: a storage node, configured to store the write data received by the cache node and need to be written, and return write status information for the write data.

本申请还提供一种计算机存储介质,用于存储网络平台产生数据,以及对应所述网络平台产生数据进行处理的程序;The present application also provides a computer storage medium for storing data generated by a network platform and a program for processing the data generated by the network platform;

所述程序在被读取执行时,执行如下步骤:When the program is read and executed, the following steps are performed:

获取数据查询请求,所述数据查询请求中携带有待查询目标数据的标识信息,其中,所述标识信息用于标识写入数据写入顺序的信息,所述待查询目标数据的标识信息为按照写入顺序范围确定的最后写入的所述写入数据的标识信息;Obtain a data query request, where the data query request carries the identification information of the target data to be queried, wherein the identification information is used to identify the information of the writing sequence of the written data, and the identification information of the target data to be queried is according to the written The identification information of the last written written data determined by the sequence range;

根据所述数据查询请求,确定所述待查询目标数据的标识信息是否与存储的当前写入数据的标识信息相匹配;According to the data query request, determine whether the identification information of the target data to be queried matches the stored identification information of the currently written data;

若不匹配,则获取与所述当前写入数据的标识信息相邻的、且写入顺序在所述当前写入顺序之后的新写入数据及新写入数据的标识信息;If it does not match, then acquire the identification information of the newly written data and the newly written data adjacent to the identification information of the current written data and whose writing order is after the current writing order;

确定所述新写入数据的标识信息与所述待查询目标数据的标识信息是否匹配;Determine whether the identification information of the newly written data matches the identification information of the target data to be queried;

若是,则将所述新写入数据确定为所述待查询目标数据;If so, determine the newly written data as the target data to be queried;

或者,执行如下步骤:Alternatively, perform the following steps:

接收数据查询请求;Receive data query requests;

根据所述数据查询请求,获取新写入数据的标识信息,所述新写入数据的标识信息为按照写入顺序范围确定的最后写入的写入数据的标识信息;According to the data query request, the identification information of the newly written data is obtained, and the identification information of the newly written data is the identification information of the last written write data determined according to the writing sequence range;

将所述标识信息封装到所述数据查询请求中并进行发送;Encapsulate the identification information into the data query request and send it;

获取响应于封装有所述标识信息的所述数据查询请求返回的目标数据;obtaining target data returned in response to the data query request encapsulated with the identification information;

或者,执行如下步骤:Alternatively, perform the following steps:

接收针对新写入数据的标识信息的获取请求,其中,所述新写入数据的标识信息为按照写入顺序范围确定的最后写入的写入数据的标识信息;Receive an acquisition request for the identification information of the newly written data, wherein the identification information of the newly written data is the identification information of the last written write data determined according to the writing sequence range;

根据所述获取请求,将按照写入顺序范围确定的最后写入的写入数据的标识信息作为新写入数据的标识信息进行发送;According to the acquisition request, the identification information of the last written write data determined according to the writing sequence range is sent as the identification information of the newly written data;

或者,执行如下步骤:Alternatively, perform the following steps:

接收数据写入请求,其中,所述数据写入请求中携带有需要写入的写入数据;receiving a data write request, wherein the data write request carries write data that needs to be written;

根据所述数据写入请求,为所述写入数据配置标识信息;其中,所述标识信息用于标识所述写入数据写入顺序的信息;According to the data write request, configure identification information for the write data; wherein, the identification information is used to identify the information of the write data writing sequence;

根据所述写入数据以及所述写入数据的标识信息进行写入操作;Perform a write operation according to the write data and the identification information of the write data;

或者,执行如下步骤:Alternatively, perform the following steps:

发送数据写入请求,其中,所述数据写入请求中携带有需要写入的写入数据;Sending a data write request, wherein the data write request carries write data that needs to be written;

接收响应于所述数据写入请求返回的针对所述写入数据的写入状态信息;receiving write status information for the write data returned in response to the data write request;

或者,执行如下步骤:Alternatively, perform the following steps:

根据发送的读取写入数据信息的读取请求,读取写入数据以及所述写入数据的标识信息;According to the read request sent to read the write data information, read the write data and the identification information of the write data;

将所述写入数据确定为当前写入数据,将所述写入数据的标识信息确定为所述当前写入数据的标识信息;The write data is determined as the current write data, and the identification information of the write data is determined as the identification information of the current write data;

将所述当前写入数据以及所述当前写入数据的标识信息存储在本地。The currently written data and the identification information of the currently written data are stored locally.

本申请还提供一种电子设备,包括:The application also provides an electronic device, comprising:

处理器;processor;

存储器,用于存储对网络平台产生数据进行处理的程序,所述程序在被所述处理器读取执行时,执行如下步骤:The memory is used to store a program for processing data generated by the network platform. When the program is read and executed by the processor, the following steps are performed:

获取数据查询请求,所述数据查询请求中携带有待查询目标数据的标识信息,其中,所述标识信息用于标识写入数据写入顺序的信息,所述待查询目标数据的标识信息为按照写入顺序范围确定的最后写入的所述写入数据的标识信息;Obtain a data query request, where the data query request carries the identification information of the target data to be queried, wherein the identification information is used to identify the information of the writing sequence of the written data, and the identification information of the target data to be queried is according to the written The identification information of the last written written data determined by the sequence range;

根据所述数据查询请求,确定所述待查询目标数据的标识信息是否与存储的当前写入数据的标识信息相匹配;According to the data query request, determine whether the identification information of the target data to be queried matches the stored identification information of the currently written data;

若不匹配,则获取与所述当前写入数据的标识信息相邻的、且写入顺序在所述当前写入顺序之后的新写入数据及新写入数据的标识信息;If it does not match, then acquire the identification information of the newly written data and the newly written data adjacent to the identification information of the current written data and whose writing order is after the current writing order;

确定所述新写入数据的标识信息与所述待查询目标数据的标识信息是否匹配;Determine whether the identification information of the newly written data matches the identification information of the target data to be queried;

若是,则将所述新写入数据确定为所述待查询目标数据;If so, determine the newly written data as the target data to be queried;

或者,执行如下步骤:Alternatively, perform the following steps:

接收数据查询请求;Receive data query requests;

根据所述数据查询请求,获取新写入数据的标识信息,所述新写入数据的标识信息为按照写入顺序范围确定的最后写入的写入数据的标识信息;According to the data query request, the identification information of the newly written data is obtained, and the identification information of the newly written data is the identification information of the last written write data determined according to the writing sequence range;

将所述标识信息封装到所述数据查询请求中并进行发送;Encapsulate the identification information into the data query request and send it;

获取响应于封装有所述标识信息的所述数据查询请求返回的目标数据;obtaining target data returned in response to the data query request encapsulated with the identification information;

或者,执行如下步骤:Alternatively, perform the following steps:

接收针对新写入数据的标识信息的获取请求,其中,所述新写入数据的标识信息为按照写入顺序范围确定的最后写入的写入数据的标识信息;Receive an acquisition request for the identification information of the newly written data, wherein the identification information of the newly written data is the identification information of the last written write data determined according to the writing sequence range;

根据所述获取请求,将按照写入顺序范围确定的最后写入的写入数据的标识信息作为新写入数据的标识信息进行发送;According to the acquisition request, the identification information of the last written write data determined according to the writing sequence range is sent as the identification information of the newly written data;

或者,执行如下步骤:Alternatively, perform the following steps:

接收数据写入请求,其中,所述数据写入请求中携带有需要写入的写入数据;receiving a data write request, wherein the data write request carries write data that needs to be written;

根据所述数据写入请求,为所述写入数据配置标识信息;其中,所述标识信息用于标识所述写入数据写入顺序的信息;According to the data write request, configure identification information for the write data; wherein, the identification information is used to identify the information of the write data writing sequence;

根据所述写入数据以及所述写入数据的标识信息进行写入操作;Perform a write operation according to the write data and the identification information of the write data;

或者,执行如下步骤:Alternatively, perform the following steps:

发送数据写入请求,其中,所述数据写入请求中携带有需要写入的写入数据;Sending a data write request, wherein the data write request carries write data that needs to be written;

接收响应于所述数据写入请求返回的针对所述写入数据的写入状态信息;receiving write status information for the write data returned in response to the data write request;

或者,执行如下步骤:Alternatively, perform the following steps:

根据发送的读取写入数据信息的读取请求,读取写入数据以及所述写入数据的标识信息;According to the read request sent to read the write data information, read the write data and the identification information of the write data;

将所述写入数据确定为当前写入数据,将所述写入数据的标识信息确定为所述当前写入数据的标识信息;The write data is determined as the current write data, and the identification information of the write data is determined as the identification information of the current write data;

将所述当前写入数据以及所述当前写入数据的标识信息存储在本地。The currently written data and the identification information of the currently written data are stored locally.

与现有技术相比,本申请具有以下优点:Compared with the prior art, the present application has the following advantages:

本申请提供的一种数据查询方法,包括:获取数据查询请求,所述数据查询请求中携带有待查询目标数据的标识信息,其中,所述标识信息用于标识写入数据写入顺序的信息,所述待查询目标数据的标识信息为按照写入顺序范围确定的最后写入的所述写入数据的标识信息;根据所述数据查询请求,确定所述待查询目标数据的标识信息是否与存储的当前写入数据的标识信息相匹配;若不匹配,则获取与所述当前写入数据的标识信息相邻的、且写入顺序在所述当前写入数据之后的新写入数据及新写入数据的标识信息;确定所述新写入数据的标识信息与所述待查询目标数据的标识信息是否匹配;若是,则将所述新写入数据确定为所述待查询目标数据。能够通过对数据查询请求中标识信息的匹配,确定当前写入数据是否为写入分析型数据库系统的最新数据,从而能够保证查询到最新的实时数据,避免由于延迟等因素而导致查询数据不准确或者有偏差。A data query method provided by the present application includes: obtaining a data query request, wherein the data query request carries identification information of target data to be queried, wherein the identification information is used to identify the information of the writing sequence of the written data, The identification information of the target data to be queried is the identification information of the last written written data determined according to the writing sequence range; according to the data query request, it is determined whether the identification information of the target data to be queried is the same as the stored data. The identification information of the current written data matches; if it does not match, then acquire the new written data and the new written data adjacent to the identification information of the current written data and whose writing order is after the current written data. Identification information of the written data; determine whether the identification information of the newly written data matches the identification information of the target data to be queried; if so, determine the newly written data as the target data to be queried. It can determine whether the currently written data is the latest data written to the analytical database system by matching the identification information in the data query request, so as to ensure that the latest real-time data can be queried and avoid inaccurate query data due to factors such as delays. Or there is a deviation.

本申请提供的一种数据写入方法,包括:接收数据写入请求,其中,所述数据写入请求中携带有需要写入的写入数据;根据所述数据写入请求,为所述写入数据配置标识信息;其中,所述标识信息用于标识所述写入数据写入顺序的信息;根据所述写入数据以及所述写入数据的标识信息进行写入操作。从而能够在写入数据时为写入数据配置用于标识所述写入数据写入顺序的信息标识信息,保证数据查询时的实时性。A data writing method provided by the present application includes: receiving a data writing request, wherein the data writing request carries write data that needs to be written; input data configuration identification information; wherein, the identification information is used to identify the information of the writing sequence of the write data; the write operation is performed according to the write data and the identification information of the write data. Therefore, information identification information for identifying the writing sequence of the written data can be configured for the written data when the data is written, so as to ensure the real-time performance of the data query.

附图说明Description of drawings

图1是本申请提供的一种数据查询方法实施例的流程图;1 is a flowchart of an embodiment of a data query method provided by the present application;

图2是本申请提供的一种数据查询方法实施例的查询原理示意图;2 is a schematic diagram of a query principle according to an embodiment of a data query method provided by the present application;

图3是本申请提供的一种数据查询装置实施例的结构示意图;3 is a schematic structural diagram of an embodiment of a data query apparatus provided by the present application;

图4是本申请提供的一种查询数据的获取方法实施例的流程图;4 is a flowchart of an embodiment of a method for acquiring query data provided by the present application;

图5是本申请提供的一种查询数据的获取装置实施例的结构示意图;5 is a schematic structural diagram of an embodiment of an apparatus for acquiring query data provided by the present application;

图6是本申请提供的一种查询数据标识信息的发送方法实施例的流程图;6 is a flowchart of an embodiment of a method for sending query data identification information provided by the present application;

图7是本申请提供的一种查询数据标识信息的发送装置实施例的结构示意图;7 is a schematic structural diagram of an embodiment of a sending device for querying data identification information provided by the present application;

图8是本申请提供的一种数据写入方法实施例的流程图;8 is a flowchart of an embodiment of a data writing method provided by the present application;

图9是本申请提供的一种数据写入方法实施例的写入原理示意图;9 is a schematic diagram of a writing principle of an embodiment of a data writing method provided by the present application;

图10是本申请提供的一种数据写入装置实施例的结构示意图;10 is a schematic structural diagram of an embodiment of a data writing device provided by the present application;

图11是本申请提供的一种数据写入请求的发送方法实施例的流程图;11 is a flowchart of an embodiment of a method for sending a data write request provided by the present application;

图12是本申请提供的一种数据写入请求的发送装置实施例的结构示意图;12 is a schematic structural diagram of an embodiment of a device for sending a data write request provided by the present application;

图13是本申请提供的一种写入数据的读取方法实施例的流程图;13 is a flowchart of an embodiment of a method for reading written data provided by the present application;

图14是本申请提供的一种写入数据的读取装置实施例的结构示意图;14 is a schematic structural diagram of an embodiment of a reading device for writing data provided by the present application;

图15是本申请提供的一种分析型数据库系统实施例的结构示意图。FIG. 15 is a schematic structural diagram of an embodiment of an analytical database system provided by the present application.

具体实施方式Detailed ways

在下面的描述中阐述了很多具体细节以便于充分理解本申请。但是本申请能够以很多不同于在此描述的其它方式来实施,本领域技术人员可以在不违背本申请内涵的情况下做类似推广,因此本申请不受下面公开的具体实施的限制。In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. However, the present application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar promotions without violating the connotation of the present application. Therefore, the present application is not limited by the specific implementation disclosed below.

本申请中使用的术语是仅仅出于对特定实施例描述的目的,而非旨在限制本申请。在本申请中和所附权利要求书中所使用的描述方式例如:“一种”、“第一”、和“第二”等,并非对数量上的限定或先后顺序上的限定,而是用来将同一类型的信息彼此区分。The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to limit the application. The descriptions used in this application and the appended claims, such as "a", "first", and "second", etc., are not limitations on quantity or sequence, but Used to distinguish information of the same type from each other.

结合上述背景技术中的描述,随着大数据的发展,对大数据的分析面临较高的实时可见性要求,以提高数据分析的准确性。在面对海量数据分析场景下,不但需要保证海量数据的高效写入,也需要保证海量数据的实时查询,从而能够赋予用户探索实时数据价值的能力,满足对快数据(FastData)越来越强烈的需求,提升数据价值。然而,现有技术中提供的大数据分析技术,仅能做到近实时,甚至近实时都难以实现。所谓近实时是指,在人机交互中能感受的尺度(秒级),而不是机器自动处理的实时性量级(ns/us级)。In combination with the descriptions in the above background art, with the development of big data, the analysis of big data faces higher real-time visibility requirements, so as to improve the accuracy of data analysis. In the face of massive data analysis scenarios, it is not only necessary to ensure the efficient writing of massive data, but also to ensure the real-time query of massive data, so as to give users the ability to explore the value of real-time data and meet the increasingly strong demand for fast data (FastData). demand to enhance the value of data. However, the big data analysis technology provided in the prior art can only achieve near real-time, and even near real-time is difficult to achieve. The so-called near real-time refers to the scale (second level) that can be felt in human-computer interaction, rather than the real-time level (ns/us level) of automatic processing by machines.

目前针对大数据分析,现有技术提供如下两种大数据分析技术:At present, for big data analysis, the existing technology provides the following two big data analysis technologies:

一种是,Hive(数据仓库分析系统)基于Hadoop(分布式系统基础架构)构建,提供了丰富的SQL查询方式来实现对大数据的查询分析能力。Hive将存储在HDFS(HadoopDistributed File System:分布式文件系统)中的结构化数据文件,映射为一张张数据库表,并将用户提交的SQL转化为MapReduce(编程模型,用于大规模数据集(大于1TB)的并行运算)任务运行,实现通过SQL的方式进行大数据分析。Hive底层依赖的Hadoop能够解决大数据分析的大部分问题,但由于Hadoop上执行的是MapReduce任务,具体是用户将一批数据放到Hadoop中执行,获取分析后的结果,根据数据量的不同,执行的时间也会存在显著差异,通常执行时间的差异是几小时到几天不等,而在上述执行过程中新写入的数据不会参与相关的分析计算,所以Hive在采用Hadoop进行大数据分析时,不能保证时效性,故而Hive不具备数据实时可见的能力。One is that Hive (data warehouse analysis system) is based on Hadoop (distributed system infrastructure) and provides rich SQL query methods to realize the query and analysis capabilities of big data. Hive maps structured data files stored in HDFS (Hadoop Distributed File System: Distributed File System) into database tables, and converts SQL submitted by users into MapReduce (programming model for large-scale data sets ( More than 1TB) parallel operation) task operation, realize big data analysis through SQL. Hadoop, which Hive relies on at the bottom layer, can solve most of the problems of big data analysis. However, because Hadoop executes MapReduce tasks, specifically, users put a batch of data into Hadoop for execution, and obtain the results after analysis. Depending on the amount of data, There are also significant differences in the execution time. Usually, the difference in execution time ranges from a few hours to a few days. During the above execution process, the newly written data will not participate in the relevant analysis and calculation. Therefore, Hive uses Hadoop for big data. During analysis, timeliness cannot be guaranteed, so Hive does not have the ability to visualize data in real time.

另一种是,PALO(数据仓库分析系统),其是一款面向百TB-PB级别的大数据实时分析的并行数据库系统,具备低延时点查和高吞吐Ad-hoc(即席查询)查询能力。目前PALO支持两种数据导入方式,对象存储文件导入和本地文件导入,通过增加数据导入频次,可以做到上述的近实时数据可见。The other is PALO (Data Warehouse Analysis System), which is a parallel database system for real-time analysis of 100 TB-PB level big data, with low-latency point checking and high-throughput Ad-hoc (ad-hoc query) query ability. At present, PALO supports two data import methods, object storage file import and local file import. By increasing the frequency of data import, the above-mentioned near real-time data can be seen.

可见,上述不论哪种方案均不能实现数据分析的实时可见,相应的也就无法保证数据分析的准确性。It can be seen that none of the above solutions can realize real-time visibility of data analysis, and accordingly, the accuracy of data analysis cannot be guaranteed.

基于上述分析,本申请提供的一种数据查询方法,能够保证数据查询的实时可见,以提高数据分析的准确性。请参考图1和图2所示,图1是本申请提供的一种数据查询方法实施例的流程图,图2是本申请提供的一种数据查询方法实施例的查询原理示意图。本实施例的查询方法主要以分析型数据库系统中计算节点(ComputeNode)的角度进行的描述,具体包括:Based on the above analysis, a data query method provided by the present application can ensure the real-time visibility of data query, so as to improve the accuracy of data analysis. Please refer to FIG. 1 and FIG. 2 , FIG. 1 is a flowchart of an embodiment of a data query method provided by the present application, and FIG. 2 is a schematic diagram of a query principle of an embodiment of a data query method provided by the present application. The query method in this embodiment is mainly described from the perspective of a computing node (ComputeNode) in an analytical database system, and specifically includes:

步骤S101:获取数据查询请求,所述数据查询请求中携带有待查询目标数据的标识信息,其中,所述标识信息用于标识写入数据写入顺序的信息。Step S101: Obtain a data query request, where the data query request carries identification information of the target data to be queried, wherein the identification information is used to identify the information of the writing sequence of the written data.

在本实施例中,数据分析主要可以理解为对数据的查询操作,以及针对查询操作进行的相关数据处理。In this embodiment, data analysis can mainly be understood as a query operation on data and related data processing for the query operation.

所述数据查询请求中携带的待查询目标数据的标识信息可以是用于标识写入数据的写入顺序的信息,所述标识信息可以采用版本号的形式表示,对不同批次的写入数据以版本号的形式进行标识。对于此处主要涉及在写入数据时的操作,所以此处不做过多阐述,请参考后续写入数据部分的描述即可,此处需要明确说明的是,写入数据可以理解为包括:插入、修改、删除、等涉及数据更新的操作。The identification information of the target data to be queried carried in the data query request may be information used to identify the writing sequence of the written data, and the identification information may be expressed in the form of a version number. Identified in the form of a version number. The operation here mainly involves the operation when writing data, so I will not elaborate too much here. Please refer to the description of the subsequent part of writing data. It should be clearly stated here that the writing data can be understood as including: Insert, modify, delete, etc. operations involving data update.

在本实施例中,所述获取数据查询请求可以是接收来自前端节点(FrontNode)的数据查询请求,也就是,前端节点发送的数据查询请求中会携带待查询目标数据的版本号,所述待查询目标数据的标识信息为按照写入顺序范围确定的最后写入的所述写入数据的版本号,也就是,数据查询请求中携带的是最后写入的写入数据的版本号。如果版本号以数值作为标识类型,并且按照升序设置,那么为保证待查询数据的实时可见性,所述数据查询请求中携带的为写入数据版本号范围内最大的版本号,同样的,如果按照降序设置,则所述数据查询请求中携带的为写入数据版本号范围内最小的版本号。通常情况下,是将版本号最大确定为最新写入数据,在本实施例中亦是如此。In this embodiment, the query request for acquiring data may be a data query request received from a front-end node (FrontNode), that is, the data query request sent by the front-end node will carry the version number of the target data to be queried. The identification information of the query target data is the version number of the last written write data determined according to the write sequence range, that is, the data query request carries the version number of the last written write data. If the version number uses a numerical value as the identification type and is set in ascending order, in order to ensure the real-time visibility of the data to be queried, the data query request carries the largest version number within the range of the written data version number. Similarly, if According to the setting in descending order, the data query request carries the smallest version number within the version number range of the written data. Normally, the version number is determined to be the latest written data, which is also the case in this embodiment.

步骤S102:根据所述数据查询请求,确定所述待查询目标数据的标识信息是否与存储的当前写入数据的标识信息相匹配。Step S102: According to the data query request, determine whether the identification information of the target data to be queried matches the stored identification information of the currently written data.

所述步骤S102中的当前写入数据的标识信息可以是从缓存节点(BufferNode)中读取的写入数据并且存储在本地的数据。当然,在本实施例中,为了便于后续操作,因此当前写入数据是存储在本地,但并不代表当前写入数据仅能够存储在本地,能够以实现后续相关操作为目的,当前写入数据的存储位置并没有任何限制。The identification information of the currently written data in the step S102 may be the written data read from the buffer node (BufferNode) and stored locally. Of course, in this embodiment, in order to facilitate subsequent operations, the currently written data is stored locally, but this does not mean that the currently written data can only be stored locally. There are no restrictions on the storage location.

基于上述内容,可以理解,在获取到所述数据查询请求后,还需要将数据查询请求中的待查询目标数据的标识信息与所述当前写入数据的标识信息进行匹配操作,故此,需要获得所述当前写入数据的标识信息,因此,还包括:Based on the above, it can be understood that after obtaining the data query request, it is also necessary to perform a matching operation between the identification information of the target data to be queried in the data query request and the identification information of the currently written data. Therefore, it is necessary to obtain The identification information of the currently written data, therefore, also includes:

步骤S100+11:读取写入数据信息;Step S100+11: read and write data information;

步骤S100+12:将读取的所述写入数据信息中的标识信息确定为所述当前写入数据的标识信息;Step S100+12: determining the identification information in the read write data information as the identification information of the current write data;

步骤S100+13:将与所述当前写入数据的标识信息对应的所述写入数据,以及所述当前写入数据的标识信息存储在本地;Step S100+13: storing the write data corresponding to the identification information of the current write data and the identification information of the current write data locally;

步骤S100+14:确定所述待查询目标数据的标识信息是否与存储在本地的所述当前写入数据的标识信息相匹配。Step S100+14: Determine whether the identification information of the target data to be queried matches the identification information of the currently written data stored locally.

所述步骤S100+11中读取写入数据信息主要是向缓存节点读取写入数据信息。具体实现过程可以是,通过异步方式,按照读取周期读取所述写入数据信息,所述读取周期可以例如是1ms。1ms向缓存节点发送一次读取写入数据的读取请求,所述缓存节点根据读取请求向所述计算节点发送相应读取的写入数据信息,所述写入数据信息中包括:写入数据的标识信息和写入数据。The reading and writing data information in the step S100+11 is mainly to read and write data information to the cache node. A specific implementation process may be that, in an asynchronous manner, the write data information is read according to a read cycle, and the read cycle may be, for example, 1 ms. A read request to read and write data is sent to the cache node in 1ms, and the cache node sends the corresponding read write data information to the computing node according to the read request, and the write data information includes: write Data identification information and write data.

对于所述当前写入数据的读取可以按照设置的读取周期进行读取,也可以在根据获取的所述数据查询请求出发读取所述当前写入数据的读取操作。The reading of the currently written data may be performed according to a set read cycle, or a read operation of reading the currently written data may be initiated according to the acquired data query request.

在本实施例中,所述计算节点可以通过异步数据读取模块(AsyncIncDataReaderService)读取所述缓存节点中的写入数据,具体地,可以是通过异步数据读取模块(AsyncIncDataReaderService)从所述缓存节点中的数据服务模块(DataServer)读取写入数据;当然也可以通过计算节点中的同步数据读取模块(SyncIncDataReaderService)从所述缓存节点中的数据服务模块(DataServer)读取写入数据,需要说明的是,写入数据在本实施例中,主要是指增量数据。In this embodiment, the computing node can read the written data in the cache node through an asynchronous data reading module (AsyncIncDataReaderService), and specifically, can be read from the cache through an asynchronous data reading module (AsyncIncDataReaderService). The data service module (DataServer) in the node reads and writes data; of course, the data can also be read and written from the data service module (DataServer) in the cache node through the synchronous data read module (SyncIncDataReaderService) in the computing node, It should be noted that, in this embodiment, the write data mainly refers to incremental data.

对于步骤S102中如何将所述待查询目标数据的标识信息与存储的当前写入数据的标识信息进行匹配,可以包括如下步骤:How to match the identification information of the target data to be queried with the stored identification information of the currently written data in step S102 may include the following steps:

步骤S102-1:将所述待查询目标数据的标识信息的识别码与所述当前写入数据的标识信息的识别码进行比较;Step S102-1: Compare the identification code of the identification information of the target data to be queried with the identification code of the identification information of the currently written data;

根据上述步骤S101中的描述,如果所述标识信息为版本信息,那么识别码则为版本号,在本实施例中,版本号是以数值类型进行表示。所述步骤S102-1的具体实现则可以是将所述待查询目标数据版本号的数值与存储的当前写入数据版本号的数值进行比较,相同即为匹配,不同则为不匹配。According to the description in the above step S101, if the identification information is version information, the identification code is a version number, and in this embodiment, the version number is represented by a numeric type. The specific implementation of the step S102-1 may be to compare the value of the version number of the target data to be queried with the stored value of the currently written data version number, the same is a match, and the difference is a mismatch.

步骤S102-2:若所述待查询目标数据的标识信息的识别码大于所述当前写入数据的标识信息的识别码,则确定所述待查询目标数据的标识信息的识别码与所述当前写入数据的标识信息的识别码不匹配。Step S102-2: If the identification code of the identification information of the target data to be queried is greater than the identification code of the identification information of the currently written data, then determine that the identification code of the identification information of the target data to be queried is the same as the current identification code. The identification codes of the identification information of the written data do not match.

所述步骤S102-2中的待查询目标数据的标识信息的识别码大于所述当前写入数据的标识信息的识别码,说明计算节点中存储的当前写入数据的标识信息以及当前写入数据并非最新写入数据,因为,在本实施例中以上述版本号的排序,版本号越大则说明写入数据写入的时间越接近所述数据查询请求的请求时间,即,计算节点中存储的当前写入数据已不是分析型数据库系统中的最新写入数据。The identification code of the identification information of the target data to be queried in the step S102-2 is greater than the identification code of the identification information of the currently written data, indicating the identification information of the current written data stored in the computing node and the current written data. It is not the latest written data, because in this embodiment, in the order of the above version numbers, the larger the version number, the closer the time of writing the data to the request time of the data query request, that is, the data stored in the computing node. The current write data for is not the most recent write data in the Analytical Database system.

以上是不匹配的情况,还包括一种是匹配的情况,在本实施例中,当所述待查询目标数据的标识信息的识别码小于或等于所述当前写入数据的标识信息的识别码,则确定所述待查询目标数据的标识信息的识别码与所述当前写入数据的标识信息的识别码匹配。也就是,所述待查询目标数据的版本号的数值小于或等于所述当前写入数据的版本号的数值,说明待查询目标数据的版本号与所述当前写入数据的版本号是匹配的。即:当待查询目标数据的版本号的数值小于所述当前写入数据的版本号的数值,则说明需要查询的目标数据可以是近实时性的数据,当待查询目标数据的版本号的数值等于所述当前写入数据的版本号的数值,则说明需要查询的目标数据是实时性的数据,那么需要将所述当前写入数据确定为所述待查询目标数据。The above is the case of mismatch, and also includes a case of matching. In this embodiment, when the identification code of the identification information of the target data to be queried is less than or equal to the identification code of the identification information of the currently written data , it is determined that the identification code of the identification information of the target data to be queried matches the identification code of the identification information of the currently written data. That is, the value of the version number of the target data to be queried is less than or equal to the value of the version number of the currently written data, indicating that the version number of the target data to be queried matches the version number of the currently written data. . That is: when the numerical value of the version number of the target data to be queried is less than the numerical value of the version number of the currently written data, it means that the target data to be queried can be near real-time data, and when the numerical value of the version number of the target data to be queried is If the value is equal to the version number of the currently written data, it indicates that the target data to be queried is real-time data, and the currently written data needs to be determined as the target data to be queried.

在匹配的情况下,则会将所述当前写入数据确定为所述待查询目标数据。In the case of matching, the currently written data will be determined as the target data to be queried.

如果待查询目标数据的版本号的数值大于所述当前写入数据的版本号的数值,即不匹配的情况下,则执行如下步骤S103的内容。If the value of the version number of the target data to be queried is greater than the value of the version number of the currently written data, that is, in the case of no match, the following step S103 is executed.

步骤S103:若不匹配,则获取与所述当前写入数据的标识信息相邻的、且写入顺序在所述当前写入顺序之后的新写入数据及新写入数据的标识信息;Step S103: if it does not match, then acquire the identification information of the new write data and the new write data whose writing order is adjacent to the identification information of the current writing data and whose writing order is after the current writing order;

通常情况下,写入顺序表征数据写入分析型数据库系统的先后,也即表示新旧,所谓新旧,即先写入的为旧,后写入的为新。因为,后写入数据是针对先写入数据的增量数据,从数据总量上来看,后写入数据量加之前已有数据量的总量通常情况下会大于先写入数据量与之前已有数据量之和。在本实施例中,每次写入分析型数据库系统内的写入数据为数据增量。Usually, the writing order represents the order in which data is written into the analytical database system, that is, the new and the old. Because the post-written data is incremental data for the first-written data, from the perspective of the total amount of data, the total amount of the post-written data plus the previous data volume is usually greater than the first-written data volume and the previous data volume. The sum of the existing data volumes. In this embodiment, each time the data written into the analytical database system is written in increments of data.

所述步骤S103是基于步骤S102在所述待查询目标数据的标识信息与存储的当前写入数据的标识信息不匹配的情况下,需要向所述缓存节点读取新写入数据,与所述步骤S101中描述的相同,当待查询目标数据的标识信息与存储的当前写入数据的标识信息不匹配时,通过所述计算节点中的异步数据读取模块(AsyncIncDataReaderService)从所述缓存节点中的数据服务模块(DataServer)读取新写入数据,此处的新写入数据是指读取与所述计算节点当前存储的当前写入数据的标识信息相邻的,且写入顺序在所述当前写入数据之后的数据和相应的标识信息,也就是说,读取的新写入数据的版本号数值要与当前写入数据版本号数值相邻,且大于当前写入数据版本号数值,是因为,每写入一次数据均为一次增量数据,各个增量数据之间没有包含关系,因此为获得完整的数据,需要按照写入顺序依次进行读取,当然,此处所描述的按照写入顺序依次进行读取是基于当前写入数据的版本号小于待查询目标数据的版本号时而进行的。The step S103 is based on the step S102 that in the case where the identification information of the target data to be queried does not match the identification information of the stored currently written data, the newly written data needs to be read from the cache node, which is the same as the The same as described in step S101, when the identification information of the target data to be queried does not match the identification information of the stored current write data, the asynchronous data reading module (AsyncIncDataReaderService) in the computing node is used from the cache node. The data service module (DataServer) reads the newly written data, where the new written data refers to reading the identification information adjacent to the current written data currently stored by the computing node, and the writing sequence is Describe the data after the current write data and the corresponding identification information, that is, the version number value of the new write data read should be adjacent to the current write data version number value, and greater than the current write data version number value , because each time the data is written, it is an incremental data, and there is no inclusion relationship between each incremental data. Therefore, in order to obtain complete data, it is necessary to read in the order of writing. Of course, the The sequential reading in the writing sequence is performed based on the fact that the version number of the currently written data is smaller than the version number of the target data to be queried.

当读取到新写入数据后,则需要执行步骤S104。After the newly written data is read, step S104 needs to be executed.

步骤S104:确定所述新写入数据的标识信息与所述待查询目标数据的标识信息是否匹配。Step S104: Determine whether the identification information of the newly written data matches the identification information of the target data to be queried.

所述步骤S104中匹配的判断过程与上述相同,具体可以包括:The matching judgment process in the step S104 is the same as the above, and may specifically include:

步骤S104-1:将所述新写入数据的标识信息的识别码与所述待查询目标数据的标识信息的识别码进行比较;Step S104-1: Compare the identification code of the identification information of the newly written data with the identification code of the identification information of the target data to be queried;

所述步骤S104-1具体是将新写入数据的版本号与所述待查询目标数据的版本号进行比较。The step S104-1 specifically compares the version number of the newly written data with the version number of the target data to be queried.

步骤S104-2:若所述新写入数据的标识信息的识别码大于或等于所述待查询目标数据的标识信息的识别码,则确定所述新写入数据的标识信息与所述目标数据的标识信息匹配。Step S104-2: If the identification code of the identification information of the newly written data is greater than or equal to the identification code of the identification information of the target data to be queried, then determine the identification information of the newly written data and the target data. match the identification information.

此处匹配成功包括两种情况,一种是所述新写入数据的版本号大于所述待查询目标数据的版本号,另一种则是所述新写入数据的版本号等于待查询目标数据的版本号。There are two situations in which the matching is successful. One is that the version number of the newly written data is greater than the version number of the target data to be queried, and the other is that the version number of the newly written data is equal to the target data to be queried. The version number of the data.

对于大于的情况,说明从缓存节点读取的新写入数据为最新写入数据,所述计算节点中待查询目标数据的版本号表示该版本号对应待查询的目标数据在所述新写入数据之前已执行写入操作,因此,针对所述缓存节点中写入数据范围而言,新写入数据为最新写入的数据。For the case of greater than or equal to, the newly written data read from the cache node is the latest written data, and the version number of the target data to be queried in the computing node indicates that the version number corresponds to the target data to be queried in the new write data. The data has been written before, so for the range of data written in the cache node, the newly written data is the latest written data.

对于等于的情况,说明从缓存节点读取的新写入数据的版本号与所述计算节点中待查询目标数据的版本号恰好相同,表示目前分析型数据库系统中最新写入数据的版本号即为所述新写入数据的版本号,所述计算节点中的版本号也对应为新写入数据的版本号,进而保证计算节点能够根据新写入数据的版本号确定新写入数据,并进行相应的计算处理。For the case of equal, it means that the version number of the newly written data read from the cache node is exactly the same as the version number of the target data to be queried in the computing node, indicating that the version number of the latest written data in the current analytical database system is is the version number of the newly written data, and the version number in the computing node also corresponds to the version number of the newly written data, thereby ensuring that the computing node can determine the newly written data according to the version number of the newly written data, and Perform corresponding calculation processing.

可以理解的是,本实施例中,在确定所述新写入数据的标识信息与所述目标数据的标识信息匹配的情况下,还可以包括:It can be understood that, in this embodiment, when it is determined that the identification information of the newly written data matches the identification information of the target data, it may further include:

将所述当前写入数据更新为获取的所述新写入数据,以及将所述当前写入数据的标识信息更新为所述新写入数据的标识信息,从而,在计算节点下一个读取周期到来前即可先将当前写入数据更新为依据匹配结果确定的最新写入数据以及对应的最新标识信息。当然,由于计算节点会按照设置的读取周期进行写入数据的读取,因此,不进行更新也仍能能够保证计算节点中读取数据的更新。Update the current write data to the acquired new write data, and update the identification information of the current write data to the identification information of the new write data, so that the next read in the computing node Before the cycle comes, the current write data can be updated to the latest write data determined according to the matching result and the corresponding latest identification information. Of course, since the computing node will read the written data according to the set read cycle, the update of the read data in the computing node can still be guaranteed without updating.

需要说明的是,本实施例中所涉及的“最新”仅为阶段性的描述,例如:在匹配时的描述,并不意味着匹配操作以外,该匹配成功的写入数据仍然为最新写入数据,因为,在匹配进行时,仍然存在另一数据的写入情况,此次,相对整个分析型数据库系统而言,另一数据可以为最新的写入数据。It should be noted that the "latest" involved in this embodiment is only a phased description. For example, the description during matching does not mean that the write data that is successfully matched is still the latest write except for the matching operation. data, because when the matching is performed, there is still another data written, this time, relative to the entire analytical database system, the other data can be the latest written data.

以上是针对匹配情况下的描述,那么,所述步骤S104-1中的比较结果还有一种情况是,所述新写入数据的标识信息的识别码小于所述待查询目标数据的标识信息的识别码,此时,则说明新写入数据的标识信息与所述目标数据的标识信息不匹配,需要重新返回到步骤S103中继续进行写入数据的读取,直到从缓存节点中读取的新写入数据的版本号大于或等于待查询目标数据的版本号,方开始进行相应计算,此处的计算是指对待查询目标数据的选取之类的处理。The above is the description for the matching case. Then, the comparison result in the step S104-1 is another case where the identification code of the identification information of the newly written data is smaller than the identification information of the target data to be queried. identification code, at this time, it means that the identification information of the newly written data does not match the identification information of the target data, and it is necessary to return to step S103 to continue reading the written data until the data read from the cache node is Only when the version number of the newly written data is greater than or equal to the version number of the target data to be queried can start the corresponding calculation. The calculation here refers to processing such as the selection of the target data to be queried.

基于上述内容,当所述新写入数据的版本号与待查询目标数据的版本号匹配时,则按照步骤S105执行。Based on the above content, when the version number of the newly written data matches the version number of the target data to be queried, step S105 is performed.

步骤S105:若是,则将所述新写入数据确定为所述待查询目标数据。Step S105: If yes, determine the newly written data as the target data to be queried.

所述步骤S105则是基于所述步骤S104中匹配结果不论是大于还是等于,均可以将所述新写入数据的版本号对应的新写入数据确定为所述待查询目标数据。In step S105, based on whether the matching result in step S104 is greater than or equal to, the newly written data corresponding to the version number of the newly written data can be determined as the target data to be queried.

至此,则完成了数据查询,可见,在整个查询过程中,根据数据查询请求中携带的待查询目标数据的版本号,来确定最新写入数据,从而能够保证待查询的目标数据是最新写入系统的写入数据,进而计算节点能够对最新数据进行相应的处理,保证查询数据的时效性。So far, the data query is completed. It can be seen that in the entire query process, the latest written data is determined according to the version number of the target data to be queried carried in the data query request, so as to ensure that the target data to be queried is the latest written data. The system writes data, and then the computing node can process the latest data accordingly to ensure the timeliness of the query data.

以上是对本申请提供的一种数据查询方法实施例的具体描述,与前述提供的一种数据查询方法实施例相对应,本申请还公开一种数据查询装置实施例,请参看图3,由于装置实施例基本相似于方法实施例,所以描述得比较简单,相关之处参见方法实施例的部分说明即可。下述描述的装置实施例仅仅是示意性的。The above is a specific description of an embodiment of a data query method provided by the present application. Corresponding to the above-mentioned embodiment of a data query method, the present application also discloses an embodiment of a data query device. Please refer to FIG. 3. Since the device The embodiment is basically similar to the method embodiment, so the description is relatively simple, and for related parts, please refer to the partial description of the method embodiment. The apparatus embodiments described below are merely illustrative.

如图3所示,图3是本申请提供的一种数据查询装置实施例的结构示意图,该装置实施例包括:As shown in FIG. 3, FIG. 3 is a schematic structural diagram of an embodiment of a data query apparatus provided by the present application, and the apparatus embodiment includes:

第一获取单元301,用于获取数据查询请求,所述数据查询请求中携带有待查询目标数据的标识信息,其中,所述标识信息用于标识写入数据写入顺序的信息,所述待查询目标数据的标识信息为按照写入顺序范围确定的最后写入的所述写入数据的标识信息;The first obtaining unit 301 is configured to obtain a data query request, where the data query request carries identification information of the target data to be queried, wherein the identification information is used to identify the information of the writing sequence of the data to be queried. The identification information of the target data is the identification information of the last written written data determined according to the writing sequence range;

第一确定单元302,用于根据所述数据查询请求,确定所述待查询目标数据的标识信息是否与存储的当前写入数据的标识信息相匹配;a first determining unit 302, configured to determine, according to the data query request, whether the identification information of the target data to be queried matches the stored identification information of the currently written data;

所述第一确定单元302包括:比较子单元和第一匹配确定子单元。The first determination unit 302 includes: a comparison subunit and a first matching determination subunit.

所述比较子单元,用于将所述待查询目标数据的标识信息的识别码与所述当前写入数据的标识信息的识别码进行比较;The comparison subunit is used to compare the identification code of the identification information of the target data to be queried with the identification code of the identification information of the currently written data;

所述第一匹配确定子单元,用于若所述待查询目标数据的标识信息的识别码大于所述当前写入数据的标识信息的识别码,则确定所述待查询目标数据的标识信息的识别码与所述当前写入数据的标识信息的识别码不匹配。The first matching determination subunit is configured to determine the identity of the identification information of the target data to be queried if the identification code of the identification information of the target data to be queried is greater than the identification code of the identification information of the currently written data. The identification code does not match the identification code of the identification information of the currently written data.

还包括:第二匹配确定子单元和数据确定子单元;Also includes: a second matching determination subunit and a data determination subunit;

所述第二匹配确定子单元,用于若所述待查询目标数据的标识信息的识别码小于或等于所述当前写入数据的标识信息的识别码,则确定所述待查询目标数据的标识信息的识别码与所述当前写入数据的标识信息的识别码匹配;The second matching determination subunit is used to determine the identification of the target data to be queried if the identification code of the identification information of the target data to be queried is less than or equal to the identification code of the identification information of the currently written data The identification code of the information matches the identification code of the identification information of the currently written data;

所述数据确定子单元,用于将所述当前写入数据确定为所述待查询目标数据。The data determination subunit is configured to determine the currently written data as the target data to be queried.

还包括:Also includes:

读取单元,用于写入数据信息;A read unit for writing data information;

当前标识确定单元,用于将读取的所述写入数据信息中的标识信息确定为所述当前写入数据的标识信息;The current identification determination unit is used to determine the identification information in the read write data information as the identification information of the current write data;

存储单元,用于将与所述当前写入数据的标识信息对应的所述写入数据,以及所述当前写入数据的标识信息存储在本地;a storage unit for storing the write data corresponding to the identification information of the current write data and the identification information of the current write data locally;

所述第一确定单元302具体用于确定所述待查询目标数据的标识信息是否与存储在本地的所述当前写入数据的标识信息相匹配。The first determining unit 302 is specifically configured to determine whether the identification information of the target data to be queried matches the identification information of the currently written data stored locally.

所述读取单元具体可以是通过异步方式,按照读取周期读取所述写入数据信息。例如上述步骤S102中的描述,通过计算节点中的AsyncIncDataReaderService模块去读取缓存节点中的写入数据。Specifically, the read unit may read the write data information according to the read cycle in an asynchronous manner. For example, as described in step S102 above, the write data in the cache node is read through the AsyncIncDataReaderService module in the computing node.

第二获取单元303,用于基于所述第一确定单元302的匹配结果为不匹配时,获取与所述当前写入数据的标识信息相邻的、且写入顺序在所述当前写入顺序之后的新写入数据及新写入数据的标识信息。The second obtaining unit 303 is configured to obtain, when the matching result of the first determining unit 302 is a mismatch, obtain the identification information adjacent to the currently written data and whose writing order is in the current writing order The following new write data and the identification information of the new write data.

第二确定单元304,用于确定所述新写入数据的标识信息与所述待查询目标数据的标识信息是否匹配;A second determining unit 304, configured to determine whether the identification information of the newly written data matches the identification information of the target data to be queried;

所述第二确定单元304包括:比较子单元和第一匹配确定子单元。The second determination unit 304 includes: a comparison subunit and a first matching determination subunit.

所述比较子单元,用于将所述新写入数据的标识信息的识别码与所述待查询目标数据的标识信息的识别码进行比较;The comparison subunit is used to compare the identification code of the identification information of the newly written data with the identification code of the identification information of the target data to be queried;

所述第一匹配确定子单元,用于若所述新写入数据的标识信息的识别码大于或等于所述待查询目标数据的标识信息的识别码,则确定所述新写入数据的标识信息与所述目标数据的标识信息匹配。The first matching determination subunit is used to determine the identification of the newly written data if the identification code of the identification information of the newly written data is greater than or equal to the identification code of the identification information of the target data to be queried The information matches the identification information of the target data.

所述第二确定单元304还包括:第二匹配确定子单元和返回子单元;The second determining unit 304 further includes: a second matching determining subunit and a returning subunit;

所述第二匹配确定子单元,用于若所述新写入数据的标识信息的识别码小于所述待查询目标数据的标识信息的识别码时,则确定所述新写入数据的标识信息与所述目标数据的标识信息不匹配。The second matching determination subunit is used to determine the identification information of the newly written data if the identification code of the identification information of the newly written data is smaller than the identification code of the identification information of the target data to be queried Does not match the identification information of the target data.

所述返回子单元,用于返回到所述第二获取单元303执行。The returning subunit is used for returning to the second obtaining unit 303 for execution.

第三确定单元305,用于基于所述第二确定单元302中匹配结果为匹配时,将所述新写入数据确定为所述待查询目标数据。The third determining unit 305 is configured to determine the newly written data as the target data to be queried based on the matching result in the second determining unit 302 being a match.

在本实施例中,还可以包括:更新单元,用于在所述第二确定子单元的确定结果为匹配时,将所述当前写入数据更新为所述第二获取单元303中获取的所述新写入数据,以及将所述当前写入数据的标识信息更新为所述新写入数据的标识信息。In this embodiment, an update unit may be further included, configured to update the current write data to the data obtained in the second obtaining unit 303 when the determination result of the second determining subunit is a match. The newly written data is updated, and the identification information of the currently written data is updated to the identification information of the newly written data.

在本实施例中,还可以包括:发送单元,用于将确定的所述待查询目标数据进行发送,在本实施例中,可将确定的所述待查询目标数据发送到前端节点,即向所述计算节点发送数据查询请求的端侧。In this embodiment, it may further include: a sending unit, configured to send the determined target data to be queried. In this embodiment, the determined target data to be queried may be sent to the front-end node, that is, to the front-end node. The end side where the computing node sends the data query request.

以上为针对本申请提供的一种数据查询方法实施例而提供的一种数据查询装置实施例的描述,具体内容可以参考上述数据查询方法的实施例,不做过多重复性赘述。The above is a description of an embodiment of a data query apparatus provided for a data query method embodiment provided by the present application. For specific content, reference may be made to the above data query method embodiment, and repeated repetition is not repeated.

基于上述内容,本申请还提供一种查询数据的获取方法,该方法可以理解为查询数据如何获得,从而能够保证查询数据的实时可见性。在本实施例中,该获取方法主要以前端节点的角度进行描述。如图4所示,图4是本申请提供的一种查询数据的获取方法实施例的流程图,该获取方法实施例包括:Based on the above content, the present application further provides a method for acquiring query data, which can be understood as how to obtain the query data, so that the real-time visibility of the query data can be ensured. In this embodiment, the obtaining method is mainly described from the perspective of the front-end node. As shown in FIG. 4 , FIG. 4 is a flowchart of an embodiment of a method for obtaining query data provided by the present application, and the embodiment of the obtaining method includes:

步骤S401:接收数据查询请求;Step S401: receiving a data query request;

所述步骤S401具体为所述前端节点接收来自用户的数据查询请求。The step S401 is specifically that the front-end node receives a data query request from a user.

步骤S402:根据所述数据查询请求,获取新写入数据的标识信息,所述新写入数据的标识信息为按照写入顺序范围确定的最后写入的写入数据的标识信息;Step S402: according to the data query request, obtain the identification information of the newly written data, the identification information of the newly written data is the identification information of the last written write data determined according to the writing sequence range;

所述步骤S402具体实现过程可以是,当前端节点接收到所述数据查询请求后,为保证能够查询到最新数据,需要向缓存节点获取新写入数据的标识信息,,标识信息如上所述在本实施例中可以是版本号,以数值形式表示。此处的新写入数据的标识可以指,按照写入顺序范围确定的最后写入到分析型数据系统的数据的标识,即新版本号。The specific implementation process of step S402 may be that after the current end node receives the data query request, in order to ensure that the latest data can be queried, it needs to obtain the identification information of the newly written data from the cache node, and the identification information is as described above in the In this embodiment, it may be a version number, which is expressed in the form of a numerical value. The identifier of the newly written data here may refer to the identifier of the data last written to the analytical data system determined according to the writing sequence range, that is, the new version number.

步骤S403:将所述标识信息封装到所述数据查询请求中并进行发送;Step S403: encapsulate the identification information into the data query request and send it;

所述步骤S403具体可以包括:The step S403 may specifically include:

将从所述步骤S402中获取的标识信息封装到所述数据查询请求中,再将封装有标识信息的数据查询请求发送到所述计算节点。由计算节点进行相应数据的查询,查询过程如上述步骤S101-步骤S104所述。The identification information obtained from the step S402 is encapsulated into the data query request, and then the data query request encapsulated with the identification information is sent to the computing node. The corresponding data query is performed by the computing node, and the query process is as described in the above steps S101-S104.

步骤S404:获取响应于封装有所述标识信息的所述数据查询请求返回的目标数据。Step S404: Obtain the target data returned in response to the data query request encapsulated with the identification information.

所述前端节点,会接收到计算节点相对于数据查询请求而返回的目标数据,以便提供给用户。The front-end node will receive the target data returned by the computing node relative to the data query request, so as to provide it to the user.

至此,查询数据获取过程即完成,由于数据查询请求中携带有新写入数据的标识信息,故此可以保证进行查询时,获得的数据为实时数据。At this point, the query data acquisition process is completed. Since the data query request carries the identification information of the newly written data, it can be guaranteed that the obtained data is real-time data when querying.

以上是对本申请提供的一种查询数据的获取方法实施例的具体描述,与前述提供的一种查询数据的获取方法实施例相对应,本申请还公开一种查询数据的获取装置实施例,请参看图5,由于装置实施例基本相似于方法实施例,所以描述得比较简单,相关之处参见方法实施例的部分说明即可。下述描述的装置实施例仅仅是示意性的。The above is a detailed description of an embodiment of a method for acquiring query data provided by the present application. Corresponding to the embodiment of a method for acquiring query data provided above, the present application also discloses an embodiment of an apparatus for acquiring query data. Referring to FIG. 5 , since the apparatus embodiment is basically similar to the method embodiment, the description is relatively simple, and for related parts, please refer to the partial description of the method embodiment. The apparatus embodiments described below are merely illustrative.

如图5所示,图5是本申请提供的一种查询数据的获取装置实施例的结构示意图,该获取装置实施例包括:As shown in FIG. 5 , FIG. 5 is a schematic structural diagram of an embodiment of an apparatus for acquiring query data provided by the present application, and the embodiment of the acquiring apparatus includes:

接收单元501,用于接收数据查询请求;a receiving unit 501, configured to receive a data query request;

第一获取单元502,用于根据所述数据查询请求,获取新写入数据的标识信息,所述新写入数据为按照写入顺序范围确定的最后写入的写入数据;The first obtaining unit 502 is configured to obtain, according to the data query request, the identification information of newly written data, where the newly written data is the last written write data determined according to the writing sequence range;

封装发送单元503,用于将所述标识信息封装到所述数据查询请求中并进行发送;An encapsulation sending unit 503, configured to encapsulate the identification information into the data query request and send it;

第二获取单元504,用于获取响应于封装有所述标识信息的所述数据查询请求返回的目标数据。The second obtaining unit 504 is configured to obtain target data returned in response to the data query request encapsulated with the identification information.

关于上述获取装置实施例的描述可以参考上述获取方法实施例中的步骤S401-步骤S404,此处不再重复赘述。For the description of the foregoing obtaining apparatus embodiments, reference may be made to steps S401 to S404 in the foregoing obtaining method embodiments, which will not be repeated here.

基于上述内容,本申请还提供一种查询数据标识信息的发送方法实施例,该发送方法实施例是从缓存节点的角度进行查询数据的描述,如图6所示,该发送方法实施例包括:Based on the above content, the present application also provides an embodiment of a sending method for query data identification information. The sending method embodiment is to describe the query data from the perspective of a cache node. As shown in FIG. 6 , the sending method embodiment includes:

步骤S601:接收针对新写入数据的标识信息的获取请求,其中,所述新写入数据的标识信息为按照写入顺序范围确定的最后写入的写入数据的标识信息;Step S601: receiving an acquisition request for the identification information of the newly written data, wherein the identification information of the newly written data is the identification information of the last written write data determined according to the writing sequence range;

所述步骤S601中的所述获取请求可以是基于来自所述用户发送到所述前端节点的查询数据请求,而向所述缓存节点获取新写入数据的获取请求。The acquisition request in the step S601 may be an acquisition request for acquiring newly written data from the cache node based on a query data request sent from the user to the front-end node.

步骤S602:根据所述获取请求,将按照写入顺序范围确定的最后写入的写入数据的标识信息作为新写入数据的标识信息进行发送。Step S602: According to the acquisition request, send the identification information of the last written write data determined according to the writing sequence range as the identification information of the newly written data.

所述步骤S602具体可以是所述缓存节点在基于所述步骤S601接收的所述获取请求,相应的也能向所述前端节点提供新写入数据的标识信息;从而能够保证查询数据请求中携带请求发送时写入分析型数据库系统的新写入数据的标识信息,进而保证后续计算节点能够针对新写入数据进行相应的计算处理,以保证数据的实时性。The step S602 may specifically be that the cache node can also provide the front-end node with the identification information of the newly written data based on the acquisition request received in the step S601; thus, it can be ensured that the query data request carries The identification information of the newly written data written into the analytical database system when the request is sent, thereby ensuring that the subsequent computing nodes can perform corresponding calculation processing for the newly written data to ensure the real-time nature of the data.

至此,对数据查询过程中如何进行查询数据标识信息的发送进行的说明,关于此部分的内容可以结合上述步骤S101-S104,步骤S401-S404的描述。So far, the description of how to send the query data identification information in the data query process can be combined with the description of the above steps S101-S104 and S401-S404.

基于上述内容,本申请还提供一种与前述提供的查询数据标识信息的发送方法实施例相对应,查询数据标识信息的发送装置实施例,请参看图7,由于装置实施例基本相似于方法实施例,所以描述得比较简单,相关之处参见方法实施例的部分说明即可。下述描述的装置实施例仅仅是示意性的。Based on the above content, the present application also provides an embodiment of a sending apparatus for querying data identification information, corresponding to the above-mentioned embodiment of the method for sending query data identification information, please refer to FIG. 7 , because the apparatus embodiment is basically similar to the method implementation. For example, the description is relatively simple, and for related parts, please refer to the partial description of the method embodiment. The apparatus embodiments described below are merely illustrative.

如图7所示,本申请提供的查询数据标识信息的发送装置实施例,包括:As shown in FIG. 7 , the embodiment of the sending device for query data identification information provided by this application includes:

接收单元701,用于接收针对新写入数据的标识信息的获取请求,其中,所述新写入数据的标识信息为按照写入顺序范围确定的最后写入的写入数据的标识信息;The receiving unit 701 is used to receive an acquisition request for the identification information of the newly written data, wherein the identification information of the newly written data is the identification information of the last written write data determined according to the writing sequence range;

发送单元702,用于根据所述接收单元中的所述获取请求,根据所述获取请求,将按照写入顺序范围确定的最后写入的写入数据的标识信息作为新写入数据的标识信息进行发送。The sending unit 702 is configured to, according to the acquisition request in the receiving unit, according to the acquisition request, take the identification information of the last written write data determined according to the writing sequence range as the identification information of the newly written data to send.

以上,是对数据查询过程中涉及的各种处理方法进行的具体描述,为保证数据的实时可见性,本申请还提供一种数据写入方法,请参考图8和图9所示,图8是本申请提供的一种数据写入方法实施例的流程图,图9是本申请提供的一种数据写入方法实施例的写入原理示意图。该数据写入方法实施例主要是以缓存节点角度进行描述,该实施例可以包括:The above is a detailed description of various processing methods involved in the data query process. In order to ensure the real-time visibility of data, the present application also provides a data writing method. Please refer to FIG. 8 and FIG. 9 . FIG. 8 It is a flowchart of an embodiment of a data writing method provided by the present application, and FIG. 9 is a schematic diagram of a writing principle of an embodiment of a data writing method provided by the present application. This embodiment of the data writing method is mainly described from the perspective of a cache node, and the embodiment may include:

步骤S801:接收数据写入请求,其中,所述数据写入请求中携带有需要写入的写入数据;Step S801: Receive a data write request, wherein the data write request carries write data that needs to be written;

所述步骤S801的具体实现过程可以是接收来自所述前端节点发送的数据写入请求,该数据写入请求中携带有待写入的写入数据。The specific implementation process of the step S801 may be receiving a data write request sent from the front-end node, where the data write request carries the write data to be written.

在本实施例中,所述缓存节点可以是通过数据服务模块(DataServer)接收数据写入请求。接收可以是根据设置的接收数据写入请求范围,接收针对相同写入分区的不同写入数据的数据写入请求,即:可以对于写入相同分区的写入数据请求进行积攒,当积攒的写入数据请求到达设置的接收数据写入请求范围时,将积攒的该批数据写入请求进行提交,之后继续进行数据写入请求的积攒,每当达到接收数据写入请求范围,则进行提交。采用这种分批提交的方式一方面能够提高数据写入的吞吐量,另一方面也能够避免针对每次数据请求分别单独向存储节点进行数据写入时,造成存储节点的损伤。In this embodiment, the cache node may receive a data write request through a data service module (DataServer). Receiving can be receiving data write requests for different write data in the same write partition according to the set range of received data write requests, that is, it can accumulate write data requests written to the same partition. When the incoming data request reaches the set receive data write request range, submit the accumulated batch of data write requests, then continue to accumulate data write requests, and submit it whenever the receive data write request range is reached. Adopting this method of batch submission can on the one hand improve the throughput of data writing, and on the other hand can avoid damage to the storage node caused when data is written to the storage node separately for each data request.

在本实施例中,接收数据写入请求范围可以包括至少两种范围,一种是接收时间范围,另一种是接收容量范围。所谓接收时间范围可以理解为设置的接收时间的长度,例如:1分钟。所述接收容量范围可以理解为接收数据写入请求的大小,例如:1MB,即当接收的数据写入请求达到1MB则将该接收范围内的数据写入请求作为一批请求进行提交。In this embodiment, the received data write request range may include at least two ranges, one is the receiving time range, and the other is the receiving capacity range. The so-called receiving time range can be understood as the length of the set receiving time, for example: 1 minute. The receiving capacity range can be understood as the size of the received data write request, for example: 1MB, that is, when the received data write request reaches 1MB, the data write request within the receiving range is submitted as a batch of requests.

步骤S802:根据所述数据写入请求,为所述写入数据配置标识信息;其中,所述标识信息用于标识所述写入数据写入顺序的信息;Step S802: according to the data writing request, configure identification information for the written data; wherein, the identification information is used to identify the information of the writing sequence of the written data;

所述步骤S802的目的在于针对数据写入请求配置标识信息,在本实施例中,标识信息可以采用自增的版本号形式,那么标识信息可以理解为用于对写入数据写入顺序的标识,该写入顺序可以是写入的前后顺序,例如:写入时间的先后顺序等,即能够标识新写入数据和历史写入数据,在本实施例中,版本号可以采用升序的方式进行配置,即版本号越大则说明其对应的写入数据为最末写入的数据,反之,按照降序也可行,只不过版本号越小则说明其对应的写入数据为最末写入的数据,也即为最新写入数据。The purpose of the step S802 is to configure the identification information for the data write request. In the present embodiment, the identification information can be in the form of an auto-incremented version number, so the identification information can be understood as an identification for the writing sequence of the written data. , the writing order can be the order of writing, for example: the order of writing time, etc., that is, it can identify new written data and historical written data. In this embodiment, the version number can be in ascending order. Configuration, that is, a larger version number indicates that the corresponding written data is the last written data. On the contrary, it is also possible to follow the descending order, but a smaller version number indicates that the corresponding written data is the last written data. data, that is, the latest written data.

当然,对于标识信息的配置还可以采用其他方式进行标识,例如:按照写入时间直接进行标识,只要能够通过标识信息区分写入数据的先后顺序即可,并不限于诸如版本号之类的表示方式。Of course, the configuration of the identification information can also be identified in other ways, for example: direct identification according to the writing time, as long as the order of writing data can be distinguished by the identification information, and it is not limited to such expressions as version numbers. Way.

基于上述步骤S801中的描述当积攒的写入数据请求到达接收数据写入请求范围的上限后,则为积攒的该批写入数据请求中的写入数据配置标识信息。那么,所述步骤S802的具体实现过程可以包括:Based on the description in the above step S801, after the accumulated write data request reaches the upper limit of the received data write request range, the identification information is configured for the accumulated write data in the batch of write data requests. Then, the specific implementation process of the step S802 may include:

将所述数据写入请求中的所述不同写入数据,确定为写入数据集合;determining the different write data in the data write request as a write data set;

为所述写入数据集合配置所述标识信息。The identification information is configured for the write data set.

该种处理方式能够提高写入数据的吞吐量的同时,还能够避免在写入数据是对存储节点的造成的损伤。当然,也可以不采用积攒的方式,针对每次接收的数据写入请求中的写入数据分别进行标识信息配置,后续分别对每个写入数据一次进行写入操作。This processing method can improve the throughput of writing data, and can also avoid damage to the storage node caused by writing data. Of course, instead of using the accumulation method, the identification information can be configured separately for the write data in each received data write request, and subsequently each write data can be written once.

基于上述内容可以明确的是,步骤S802的目的在于:针对接收的数据写入请求中写入数据需要配置标识信息,以为后续确定新写入数据提供基础。Based on the above content, it is clear that the purpose of step S802 is to configure identification information for writing data in the received data writing request, so as to provide a basis for subsequent determination of newly written data.

步骤S803:根据所述写入数据以及所述写入数据的标识信息进行写入操作。Step S803: Perform a write operation according to the write data and the identification information of the write data.

基于上述步骤S802的描述,所述步骤S803的具体实现过程可以包括:Based on the description of the above step S802, the specific implementation process of the step S803 may include:

根据所述写入数据集合以及对应所述写入数据集合的标识信息,进行写入操作。The write operation is performed according to the write data set and the identification information corresponding to the write data set.

在本实施例中,可以将所述写入数据或者是所述写入数据集合连同对应的标识信息一起写入到底层的存储节点内,从而完成写入数据的写入操作。In this embodiment, the write data or the write data set together with the corresponding identification information may be written into the underlying storage node, so as to complete the write operation of the write data.

在基于写入操作完成后,还可以包括:After the write-based operation is complete, it can also include:

步骤S80+11:接收用于描述所述写入数据写入状态的状态信息;Step S80+11: Receive state information for describing the write state of the write data;

所述步骤S80+11目的在于基于写入数据写入底层存储节点后,接收针对写入数据写入状态的状态信息,该状态信息可以包括:写入成功的状态信息或者是写入失败的状态信息。The purpose of the step S80+11 is to receive the status information for the write status of the write data after the write data is written to the underlying storage node, and the status information may include: status information of successful writing or status of writing failure information.

步骤S80+12:发送所述状态信息。Step S80+12: Send the status information.

在本实施例中所述步骤S80+12中将状态信息发送到前端节点,以便前端节点针对写入状态进行相应的处理,例如:如果写入失败,则重新进行数据写入请求发送,可以理解的是,如果写入数据写入成功可以不返回写入状态,也可以返回写入状态。In the step S80+12 described in this embodiment, the status information is sent to the front-end node, so that the front-end node can perform corresponding processing on the write status, for example, if the write fails, the data write request will be sent again, which is understandable What's more, if the write data is successfully written, the write status may not be returned, or the write status may be returned.

以上是对本申请提供的一种数据写入方法实施例的具体描述,与前述提供的一种数据写入方法实施例相对应,本申请还公开一种数据写入装置实施例,请参看图10,由于装置实施例基本相似于方法实施例,所以描述得比较简单,相关之处参见方法实施例的部分说明即可。下述描述的装置实施例仅仅是示意性的。The above is a detailed description of an embodiment of a data writing method provided by the present application. Corresponding to the data writing method embodiment provided above, the present application also discloses an embodiment of a data writing device, please refer to FIG. 10 , since the apparatus embodiment is basically similar to the method embodiment, the description is relatively simple, and the relevant part may refer to the partial description of the method embodiment. The apparatus embodiments described below are merely illustrative.

如图10所示,所述数据写入装置实施例包括:As shown in FIG. 10, the embodiment of the data writing device includes:

接收单元1001,用于接收数据写入请求;其中,所述数据写入请求中携带有需要写入的写入数据;A receiving unit 1001, configured to receive a data write request; wherein, the data write request carries write data that needs to be written;

所述接收单元1001可以包括:范围设置子单元和接收子单元,所述范围设置子单元,用于设置接收数据写入请求范围。所述接收子单元,用于根据范围设置子单元中设置的接收数据写入请求范围,接收针对相同写入分区的不同写入数据的数据写入请求。The receiving unit 1001 may include: a range setting subunit and a receiving subunit, where the range setting subunit is used to set the range of the received data write request. The receiving subunit is configured to receive data write requests for different write data in the same write partition according to the range of the received data write request set in the range setting subunit.

所述范围设置子单元可以包括:时间范围设置子单元和容量范围设置子单元,其中,所述时间范围设置子单元用于设置接收所述数据写入请求的接收时间范围;所述容量范围设置子单元用于设置接收所述数据写入请求的接收容量范围。The range setting subunit may include: a time range setting subunit and a capacity range setting subunit, wherein the time range setting subunit is used to set a receiving time range for receiving the data write request; the capacity range setting The subunit is used to set a receiving capacity range for receiving the data write request.

所述接收子单元具体可以用于根据时间范围设置子单元中设置的接收所述数据写入请求的接收时间范围,接收针对相同写入分区的不同写入数据的数据写入请求;或者,用于根据所述容量范围设置子单元中设置的接收所述数据写入请求的接收容量范围,接收针对相同写入分区的不同写入数据的数据写入请求。The receiving subunit may be specifically configured to set the receiving time range for receiving the data write request set in the time range setting subunit, and receive data write requests for different write data in the same write partition; According to the receiving capacity range for receiving the data write request set in the capacity range setting subunit, data write requests for different write data of the same write partition are received.

配置单元1002,用于根据所述数据写入请求,为所述写入数据配置标识信息;其中,所述标识信息用于标识所述写入数据写入顺序的信息;A configuration unit 1002, configured to configure identification information for the write data according to the data write request; wherein, the identification information is used to identify the information of the write order of the write data;

所述配置单元1002包括:确定子单元和配置子单元;The configuration unit 1002 includes: a determination subunit and a configuration subunit;

所述确定子单元,用于将所述数据写入请求中的所述不同写入数据,确定为写入数据集合;the determining subunit, configured to determine the different write data in the data write request as a write data set;

所述配置子单元,用于为所述写入数据集合配置所述标识信息。The configuration subunit is configured to configure the identification information for the write data set.

写入单元1003,用于根据所述写入数据以及所述写入数据的标识信息进行写入操作。The writing unit 1003 is configured to perform a writing operation according to the writing data and the identification information of the writing data.

所述写入单元1003具体用于根据所述确定子单元中确定的所述写入数据集合,以及对应的所述写入数据集合的标识信息,进行写入操作。The writing unit 1003 is specifically configured to perform a writing operation according to the writing data set determined in the determining subunit and the corresponding identification information of the writing data set.

还包括:Also includes:

状态信息接收单元和发送单元;Status information receiving unit and sending unit;

所述状态信息接收单元,用于接收用于描述所述写入数据写入状态的状态信息;the state information receiving unit, configured to receive state information used to describe the write state of the write data;

所述发送单元,用于发送所述状态信息接收单元中接收的所述状态信息。The sending unit is configured to send the state information received in the state information receiving unit.

以上是对本申请提供的一种数据写入装置实施例的概要性描述,关于数据写入装置实施例的具体内容可以参考上述数据写入方法实施例的描述,此处不做过多赘述。The above is a general description of an embodiment of a data writing apparatus provided in the present application. For the specific content of the data writing apparatus embodiment, reference may be made to the description of the above data writing method embodiment, which will not be repeated here.

针对上述数据写入方法和装置的实施例主要以缓存节点为角度进行的描述,对于分析型数据库系统数据写入过程中还包括前端节点,前端节点在本实施例中,主要涉及的核心内容是数据写入请求的发送,故此,本申请还提供一种数据写入请求的发送方法,请参考图11所示,图11是本申请提供的一种数据写入请求的发送方法实施例的流程图。所述数据写入请求的发送方法实施例可以包括:The embodiments of the above-mentioned data writing method and apparatus are mainly described from the perspective of the cache node, and the data writing process of the analytical database system also includes a front-end node. In this embodiment, the core content of the front-end node is: Sending of a data write request, therefore, the present application also provides a method for sending a data write request, please refer to FIG. 11 , which is a flowchart of an embodiment of a method for sending a data write request provided by the present application picture. Embodiments of the method for sending the data write request may include:

步骤S1101:发送数据写入请求,其中,所述数据写入请求中携带有需要写入的写入数据;Step S1101: Send a data write request, wherein the data write request carries write data that needs to be written;

对于分析型数据库系统,数据写入请求是通过缓存节点进行写入操作,因此,所述步骤S1101前端节点将用户发送的数据写入请求发送到所述缓存节点,缓存节点会为数据写入请求中的写入数据配置标识信息,当然如上述步骤S801-S803所述,可以是为积攒以一批写入数据配置标识信息。For the analytical database system, the data write request is performed by the cache node. Therefore, in step S1101, the front-end node sends the data write request sent by the user to the cache node, and the cache node will write the data request for the data. The write data configuration identification information in , of course, as described in the above steps S801-S803, may be to accumulate a batch of write data configuration identification information.

对于分布式的分析型数据库系统,会存在大量的缓存节点,那么数据写入请求中的写入数据应该写到哪个缓存节点是需要考虑的问题,在本实施例中,所述步骤S1101的具体实现过程可以包括:For a distributed analytical database system, there will be a large number of cache nodes, so which cache node should the write data in the data write request be written to is a problem that needs to be considered. In this embodiment, the specific steps of step S1101 are Implementation can include:

步骤S1101-11:根据所述数据写入请求中携带的用于描述所述写入数据的属性信息,确定与所述写入数据对应的缓存节点;Step S1101-11: Determine a cache node corresponding to the write data according to the attribute information carried in the data write request and used to describe the write data;

所述步骤S1101-11中的属性信息可以是写入数据的写入数据库的标识和写入数据表的标识,例如:数据库名称(database name)和数据表名称(table name)。The attribute information in the step S1101-11 may be the identifier of the write database and the identifier of the data table in which the data is written, such as: database name (database name) and data table name (table name).

所述步骤S1101-11确定与所述写入数据对应的缓存节点可以是通过将数据库名称(database name)和数据表名称(table name)拼接为写入路径信息,之后到分析型数据库系统中的服务协调节点(Zookeeper)按照所述写入路径信息进行查找,获得写入数据对应的分区信息,在服务协调节点(Zookeeper)中的分区信息中会记录缓存节点的地址(ip)信息和端口(port)信息,通过地址信息和端口信息即可确定写入数据对应的缓存节点。The step S1101-11 determines that the cache node corresponding to the write data can be written by splicing the database name (database name) and the data table name (table name) into the write path information, and then to the analytical database system. The service coordination node (Zookeeper) searches according to the write path information, obtains the partition information corresponding to the written data, and records the address (ip) information and port ( port) information, the cache node corresponding to the written data can be determined through the address information and port information.

此处对于分区信息需要说明的是,在分析型数据库中,缓存节点可以包括多个,其中存在主缓存节点(Master),和多个从缓存节点(Slave),建立数据表的过程或者缓存节点重启,主缓存节点会根据数据表的表结构信息,决定表的各个分区在各缓存节点(包括主和从缓存节点)上的分布,并下发命令给对应缓存节点划分上线对应的表分区,缓存节点的表分区上线成功后会将表的分区信息注册到服务协调模块(Zookeeper)上,写入模块(Writer)写入数据时会从服务协调模块(Zookeeper)上获取分区所在的缓存节点的地址信息和端口信息,依据缓存节点的地址信息和端口信息向缓存节点发送数据写入请求,以便缓存节点完成数据写入。本实施例中,数据写入请求可以通过RPC(Remote ProcedureCall:远程过程调用)调用完成。It should be noted here for the partition information that in an analytical database, there may be multiple cache nodes, including a master cache node (Master) and multiple slave cache nodes (Slave), the process of establishing a data table or a cache node. After restarting, the main cache node will determine the distribution of each partition of the table on each cache node (including the master and slave cache nodes) according to the table structure information of the data table, and issue a command to the corresponding cache node to divide the table partition corresponding to the online. After the table partition of the cache node is successfully online, the partition information of the table will be registered in the service coordination module (Zookeeper). Based on the address information and port information, a data write request is sent to the cache node according to the address information and port information of the cache node, so that the cache node completes the data write. In this embodiment, the data writing request may be completed through an RPC (Remote Procedure Call: Remote Procedure Call).

在本实施例中,执行上述确定缓存节点可以通过所述前端节点中的写入模块(Writer)完成。In this embodiment, the above-mentioned determination of the cache node may be completed by a writing module (Writer) in the front-end node.

故此,所述步骤S1101-11可以包括:Therefore, the step S1101-11 may include:

步骤S1101-11-1:根据所述属性信息中描述所述写入数据的写入数据库的标识和写入数据表的标识,建立针对所述写入数据的写入路径信息,例如:/dbName/tableName/;Step S1101-11-1: According to the identifier of the write database describing the write data and the identifier of the write data table in the attribute information, establish write path information for the write data, for example: /dbName /tableName/;

步骤S1101-11-2:根据所述写入路径信息,获取所述写入数据表的分区信息;Step S1101-11-2: Obtain the partition information of the write data table according to the write path information;

步骤S1101-11-3:根据所述分区信息,确定与所述写入数据对应的所述缓存节点。Step S1101-11-3: Determine the cache node corresponding to the write data according to the partition information.

至此,将写入数据对应的缓存节点确定,进而进入步骤S1101-12。So far, the cache node corresponding to the write data is determined, and the process proceeds to step S1101-12.

步骤S1101-12:将所述数据写入请求发送到对应的所述缓存节点。Step S1101-12: Send the data write request to the corresponding cache node.

基于上述数据写入请求发送到对应的缓存节点进行后续写入操作。Based on the above data write request, it is sent to the corresponding cache node for subsequent write operations.

步骤S1102:接收响应于所述数据写入请求返回的针对所述写入数据的写入状态信息。Step S1102: Receive write status information for the write data returned in response to the data write request.

所述前端节点在发送写入数据请求时或者发送写入数据请求后或者发送写入数据请求前,均可以接收来自缓存节点返回的针对写入数据请求中写入数据的写入状态信息,该写入状态信息用于描述写入数据的写入成功或是失败的信息。The front-end node can receive the write status information for the write data in the write data request returned from the cache node when sending the write data request or after sending the write data request or before sending the write data request. The write status information is used to describe the success or failure of the writing of the write data.

以上是对本申请提供的一种数据写入请求的发送方法实施例的具体描述,与前述提供的一种数据写入请求的发送方法实施例相对应,本申请还公开一种数据写入请求的发送装置实施例,请参看图12,由于装置实施例基本相似于方法实施例,所以描述得比较简单,相关之处参见方法实施例的部分说明即可。下述描述的装置实施例仅仅是示意性的。The above is a detailed description of an embodiment of a method for sending a data write request provided by the present application. Corresponding to the foregoing embodiment of a method for sending a data write request, the present application also discloses a method for sending a data write request. Referring to FIG. 12 , for an embodiment of a sending apparatus, since the apparatus embodiment is basically similar to the method embodiment, the description is relatively simple, and for related parts, please refer to the partial description of the method embodiment. The apparatus embodiments described below are merely illustrative.

如图12所示,图12是本申请提供的一种数据写入请求的发送装置实施例的结构示意图,该发送装置实施例包括:As shown in FIG. 12, FIG. 12 is a schematic structural diagram of an embodiment of a sending apparatus for a data write request provided by the present application, and the sending apparatus embodiment includes:

发送单元1201,用于发送数据写入请求,其中,所述数据写入请求中携带有需要写入的写入数据;A sending unit 1201, configured to send a data write request, wherein the data write request carries write data that needs to be written;

所述发送单元1201包括:确定子单元和发送子单元;The sending unit 1201 includes: a determining subunit and a sending subunit;

所述确定子单元,用于根据所述数据写入请求中携带的用于描述所述写入数据的属性信息,确定与所述写入数据对应的缓存节点;The determining subunit is configured to determine a cache node corresponding to the write data according to the attribute information carried in the data write request and used to describe the write data;

所述发送子单元,用于将所述数据写入请求发送到所述确定子单元中确定的对应的所述缓存节点。The sending subunit is configured to send the data write request to the corresponding cache node determined in the determining subunit.

所述确定子单元包括:建立子单元和获取子单元;The determining subunits include: establishing subunits and acquiring subunits;

所述建立子单元,用于根据所述属性信息中描述所述写入数据的写入数据库的标识和写入数据表的标识,建立针对所述写入数据的写入路径信息;The establishment subunit is used to establish the write path information for the write data according to the identifier of the write database and the identifier of the write data table describing the write data in the attribute information;

所述获取子单元,用于根据所述建立子单元中建立的所述写入路径信息,获取所述写入数据表的分区信息;The acquisition subunit is configured to acquire the partition information of the write data table according to the write path information established in the establishment subunit;

所述确定子单元具体用于根据所述获取子单元中获取的所述分区信息,确定与所述写入数据对应的所述缓存节点。The determining subunit is specifically configured to determine the cache node corresponding to the write data according to the partition information acquired in the acquiring subunit.

接收单元1202,用于接收响应于所述数据写入请求返回的针对所述写入数据的写入状态信息。The receiving unit 1202 is configured to receive write status information for the write data returned in response to the data write request.

基于上述内容,本申请还提供一种写入数据的读取方法,该读取方法是以计算节点为角度进行描述。如图13所示,图13是本申请提供的一种写入数据的读取方法实施例的流程图,该读取方法实施例包括:Based on the above content, the present application further provides a method for reading written data, and the method for reading is described from the perspective of a computing node. As shown in FIG. 13 , FIG. 13 is a flowchart of an embodiment of a method for reading written data provided by the present application, and the embodiment of the reading method includes:

步骤S1301:根据发送的读取写入数据信息的读取请求,读取写入数据以及所述写入数据的标识信息;Step S1301: according to the sent read request to read and write data information, read the write data and the identification information of the write data;

所述步骤S1301目的在于:不论是在写入数据的操作过程中还是查询数据的操作过程中,需要计算节点能够读取到缓存节点中的写入数据。因此,计算节点需要向缓存节点发送读取请求,以便计算节点从缓存节点读取写入数据。The purpose of the step S1301 is: whether in the operation process of writing data or the operation process of querying data, the computing node needs to be able to read the write data in the cache node. Therefore, the computing node needs to send a read request to the cache node so that the computing node can read and write data from the cache node.

如上所述,在本实施例中,所述步骤1301的具体实现过程可以包括:As described above, in this embodiment, the specific implementation process of step 1301 may include:

步骤S1301-1:通过异步方式,按照读取周期发送所述读取请求;Step S1301-1: Send the read request according to the read cycle in an asynchronous manner;

步骤S1301-2:根据所述读取请求,读取所述写入数据以及所述写入数据的标识信息。Step S1301-2: Read the write data and the identification information of the write data according to the read request.

关于此处可以参考上述数据查询方法中关于步骤S100+11的相关描述,此处不再重复赘述。For details, please refer to the relevant description of step S100+11 in the above data query method, which will not be repeated here.

步骤S1302:将所述写入数据确定为当前写入数据,将所述写入数据的标识信息确定为所述当前写入数据的标识信息;Step S1302: determining the write data as the current write data, and determining the identification information of the write data as the identification information of the current write data;

步骤S1303:将所述当前写入数据以及所述当前写入数据的标识信息存储在本地。Step S1303: Store the currently written data and the identification information of the currently written data locally.

关于步骤S1302和步骤S1303也可以参考上述数据查询方法中步骤S102到步骤S103的描述,此处不再赘述。Regarding steps S1302 and S1303, reference may also be made to the descriptions of steps S102 to S103 in the above data query method, which will not be repeated here.

以上是对本申请提供的一种写入数据的读取方法实施例的具体描述,与前述提供的一种写入数据的读取方法实施例相对应,本申请还公开一种写入数据的读取装置实施例,请参看图14,由于装置实施例基本相似于方法实施例,所以描述得比较简单,相关之处参见方法实施例的部分说明即可。下述描述的装置实施例仅仅是示意性的。The above is a detailed description of an embodiment of a method for reading written data provided by the present application. Corresponding to the embodiment of a method for reading written data provided in the foregoing, the present application also discloses a method for reading written data. For an apparatus embodiment, please refer to FIG. 14 . Since the apparatus embodiment is basically similar to the method embodiment, the description is relatively simple, and for related parts, please refer to the partial description of the method embodiment. The device embodiments described below are merely illustrative.

如图14所示,本申请提供的写入数据的读取装置实施例包括:As shown in FIG. 14 , an embodiment of a reading device for writing data provided by the present application includes:

读取单元1401,用于根据发送的读取写入数据信息的读取请求,读取写入数据以及所述写入数据的标识信息;a reading unit 1401, configured to read the write data and the identification information of the write data according to the sent read request to read the write data information;

所述读取单元1401包括:发送子单元和读取子单元;The reading unit 1401 includes: a sending subunit and a reading subunit;

所述发送子单元,用于通过异步方式,按照读取周期发送所述读取请求;The sending subunit is configured to send the read request according to the read cycle in an asynchronous manner;

所述读取子单元,用于根据所述读取请求,读取所述写入数据以及所述写入数据的标识信息。The read subunit is configured to read the write data and the identification information of the write data according to the read request.

确定单元1402,用于将所述写入数据确定为当前写入数据,将所述写入数据的标识信息确定为所述当前写入数据的标识信息;A determination unit 1402, configured to determine the write data as the current write data, and determine the identification information of the write data as the identification information of the current write data;

存储单元1403,用于将所述当前写入数据以及所述当前写入数据的标识信息存储在本地。The storage unit 1403 is configured to store the currently written data and the identification information of the currently written data locally.

以上对针对本申请提供的一种写入数据的读取装置实施例的概要性描述,具体内容请参考上述关于数据查询方法、数据写入方法等实施例的相关描述。The above is a general description of an embodiment of a reading device for writing data provided by the present application. For specific content, please refer to the above-mentioned relevant descriptions about the data query method, data writing method and other embodiments.

基于上述内容,本申请还提供一种分析型数据库系统,如图15所示,该图15是分析型数据库系统的结构示意图,该分析型数据库包括:Based on the above content, the present application also provides an analytical database system, as shown in FIG. 15 , which is a schematic structural diagram of the analytical database system, and the analytical database includes:

前端节点(FrontNode)、缓存节点(BufferNode)和计算节点(ComputeNode),其中,所述前端节点用于发送数据操作请求到所述缓存节点,以及针对所述数据操作请求返回的操作状态或目标数据或新写入数据的标识信息;当所述前端节点接收的所述数据操作请求为数据写入请求时,将接收的所述数据写入请求发送到所述缓存节点,并接收所述缓存节点响应于所述数据写入请求返回的针对所述数据写入请求中,写入数据的写入状态信息;当所述前端节点接收的所述数据操作请求为数据查询请求时,将根据接收的所述数据查询请求,从所述缓存节点获取新写入数据的标识信息,所述新写入数据的标识信息为按照写入顺序范围确定的最后写入的写入数据的标识信息,将所述新写入数据的标识信息封装到所述数据查询请求中发送到所述计算节点,获取所述计算节点针对所述数据查询请求确定的目标数据;A front-end node (FrontNode), a buffer node (BufferNode), and a computing node (ComputeNode), wherein the front-end node is used to send a data operation request to the cache node, and the operation status or target data returned for the data operation request or the identification information of newly written data; when the data operation request received by the front-end node is a data write request, send the received data write request to the cache node, and receive the data write request from the cache node In response to the data write request returned by the data write request, write data write status information; when the data operation request received by the front-end node is a data query request, the data will be In the data query request, the identification information of the newly written data is obtained from the cache node, and the identification information of the newly written data is the identification information of the last written written data determined according to the writing sequence range, and the The identification information of the newly written data is encapsulated into the data query request and sent to the computing node, and the target data determined by the computing node for the data query request is obtained;

所述缓存节点用于接收来自所述前端节点的所述数据操作请求,以及向所述前端节点发送响应于所述数据操作请求的信息;其中,当所述缓存节点接收的所述数据操作请求为所述数据写入请求时,根据所述数据写入请求,为所述数据写入请求中携带的写入数据配置标识信息;其中,所述标识信息用于标识所述写入数据写入顺序的信息,根据所述写入数据以及所述写入数据的标识信息进行写入操作;当所述缓存节点接收的所述数据操作请求为所述数据查询请求时,所述缓存节点接收来自所述前端节点的针对新写入数据的标识信息的获取请求,根据所述获取请求,将按照写入顺序范围确定的最后写入的写入数据的标识信息作为新写入数据的标识信息发送给所述前端节点;The cache node is configured to receive the data operation request from the front-end node, and send information in response to the data operation request to the front-end node; wherein, when the data operation request received by the cache node For the data write request, according to the data write request, configure identification information for the write data carried in the data write request; wherein, the identification information is used to identify the write data write sequence information, and perform the write operation according to the write data and the identification information of the write data; when the data operation request received by the cache node is the data query request, the cache node receives the request from The acquisition request of the front-end node for the identification information of the newly written data, according to the acquisition request, the identification information of the last written write data determined according to the writing sequence range is sent as the identification information of the newly written data to the front-end node;

所述计算节点用于获取来自所述前端节点的数据查询请求,所述数据查询请求中携带有待查询目标数据的标识信息,其中,所述标识信息用于标识写入数据写入顺序的信息,所述待查询目标数据的标识信息为按照写入顺序范围确定的最后写入的所述写入数据的标识信息;根据所述数据查询请求,确定所述待查询目标数据的标识信息是否与存储的当前写入数据的标识信息相匹配;若不匹配,则获取与所述当前写入数据的标识信息相邻的、且写入顺序在所述当前写入顺序之后的新写入数据及新写入数据的标识信息;确定所述新写入数据的标识信息与所述待查询目标数据的标识信息是否匹配;若是,则将所述新写入数据确定为所述待查询目标数据;或者,根据向所述缓存节点发送的读取写入数据信息的读取请求,读取写入数据以及所述写入数据的标识信息;将所述写入数据确定为当前写入数据,将所述写入数据的标识信息确定为所述当前写入数据的标识信息;将所述当前写入数据以及所述当前写入数据的标识信息存储在本地。The computing node is used to obtain a data query request from the front-end node, and the data query request carries identification information of the target data to be queried, wherein the identification information is used to identify the information of the writing sequence of the written data, The identification information of the target data to be queried is the identification information of the last written written data determined according to the writing sequence range; according to the data query request, it is determined whether the identification information of the target data to be queried is the same as the stored data. The identification information of the current write data matches; if it does not match, then acquire the new write data and the new write data adjacent to the identification information of the current write data and whose writing order is after the current writing order. identification information of the written data; determine whether the identification information of the newly written data matches the identification information of the target data to be queried; if so, determine the newly written data as the target data to be queried; or , according to the read request to read and write data information sent to the cache node, read the write data and the identification information of the write data; determine the write data as the current write data, The identification information of the written data is determined as the identification information of the currently written data; the current written data and the identification information of the currently written data are stored locally.

关于上述前端节点、缓存节点以及计算节点可以结合上述数据查询方法实施例、查询数据的获取方法实施例、查询数据标识信息的发送方法实施例,数据写入方法实施例、数据写入请求的发送方法实施例以及写入数据的读取方法实施例中的描述,此处不再做重复性赘述。Regarding the foregoing front-end nodes, cache nodes, and computing nodes, the foregoing data query method embodiments, query data acquisition method embodiments, query data identification information sending method embodiments, data writing method embodiments, and data writing request sending embodiments may be combined The descriptions in the method embodiments and the method embodiments for reading written data will not be repeated here.

需要说明的是,本实施例中可以根据不同的使用场景对前端节点、缓存节点以及计算节点中的任意一个节点的节点数目进行扩充和缩减,以满足不同的写入流量需求或查询流量需求。It should be noted that, in this embodiment, the number of nodes of any one of the front-end node, the cache node, and the computing node can be expanded or reduced according to different usage scenarios to meet different write traffic requirements or query traffic requirements.

本实施例中,还可以包括:服务协调节点,用于根据所述前端节点中的所述数据写入请求中写入数据的属性信息,提供与所述写入数据对应的所述缓存节点;所述前端节点根据所述服务协调节点提供的所述缓存节点,将所述数据写入请求发送到与所述位置信息对应的所述缓存节点。关于服务协调节点也可以参考上述步骤S1101-11的描述。In this embodiment, it may further include: a service coordination node, configured to provide the cache node corresponding to the written data according to the attribute information of the written data in the data write request in the front-end node; The front-end node sends the data write request to the cache node corresponding to the location information according to the cache node provided by the service coordination node. Regarding the service coordination node, reference may also be made to the description of the above step S1101-11.

所述缓存节点需要对写入数据进行写入操作,因此,还可以包括:The cache node needs to perform a write operation on the write data, therefore, it may also include:

存储节点,用于存储所述缓存节点接收的需要写入的写入数据,并针对所述写入数据返回写入状态信息。The storage node is configured to store the write data received by the cache node and need to be written, and return write status information for the write data.

基于上述内容,本申请还提供一种计算机存储介质,用于存储网络平台产生数据,以及对应所述网络平台产生数据进行处理的程序;Based on the above content, the present application also provides a computer storage medium for storing data generated by a network platform and a program for processing the data generated by the network platform;

所述程序在被读取执行时,执行如下步骤:When the program is read and executed, the following steps are performed:

获取数据查询请求,所述数据查询请求中携带有待查询目标数据的标识信息,其中,所述标识信息用于标识写入数据写入顺序的信息,所述待查询目标数据的标识信息为按照写入顺序范围确定的最后写入的所述写入数据的标识信息;Obtain a data query request, where the data query request carries the identification information of the target data to be queried, wherein the identification information is used to identify the information of the writing sequence of the written data, and the identification information of the target data to be queried is according to the written The identification information of the last written written data determined by the sequence range;

根据所述数据查询请求,确定所述待查询目标数据的标识信息是否与存储的当前写入数据的标识信息相匹配;According to the data query request, determine whether the identification information of the target data to be queried matches the stored identification information of the currently written data;

若不匹配,则获取与所述当前写入数据的标识信息相邻的、且写入顺序在所述当前写入顺序之后的新写入数据及新写入数据的标识信息;If it does not match, then acquire the identification information of the newly written data and the newly written data adjacent to the identification information of the current written data and whose writing order is after the current writing order;

确定所述新写入数据的标识信息与所述待查询目标数据的标识信息是否匹配;Determine whether the identification information of the newly written data matches the identification information of the target data to be queried;

若是,则将所述新写入数据确定为所述待查询目标数据;If so, determine the newly written data as the target data to be queried;

或者,执行如下步骤:Alternatively, perform the following steps:

接收数据查询请求;Receive data query requests;

根据所述数据查询请求,获取新写入数据的标识信息,所述新写入数据的标识信息为按照写入顺序范围确定的最后写入的写入数据的标识信息;According to the data query request, the identification information of the newly written data is obtained, and the identification information of the newly written data is the identification information of the last written write data determined according to the writing sequence range;

将所述标识信息封装到所述数据查询请求中并进行发送;Encapsulate the identification information into the data query request and send it;

获取响应于封装有所述标识信息的所述数据查询请求返回的目标数据;obtaining target data returned in response to the data query request encapsulated with the identification information;

或者,执行如下步骤:Alternatively, perform the following steps:

接收针对新写入数据的标识信息的获取请求,其中,所述新写入数据的标识信息为按照写入顺序范围确定的最后写入的写入数据的标识信息;Receive an acquisition request for the identification information of the newly written data, wherein the identification information of the newly written data is the identification information of the last written write data determined according to the writing sequence range;

根据所述获取请求,将按照写入顺序范围确定的最后写入的写入数据的标识信息作为新写入数据的标识信息进行发送;According to the acquisition request, the identification information of the last written write data determined according to the writing sequence range is sent as the identification information of the newly written data;

或者,执行如下步骤:Alternatively, perform the following steps:

接收数据写入请求,其中,所述数据写入请求中携带有需要写入的写入数据;receiving a data write request, wherein the data write request carries write data that needs to be written;

根据所述数据写入请求,为所述写入数据配置标识信息;其中,所述标识信息用于标识所述写入数据写入顺序的信息;According to the data write request, configure identification information for the write data; wherein, the identification information is used to identify the information of the write data writing sequence;

根据所述写入数据以及所述写入数据的标识信息进行写入操作;Perform a write operation according to the write data and the identification information of the write data;

或者,执行如下步骤:Alternatively, perform the following steps:

发送数据写入请求,其中,所述数据写入请求中携带有需要写入的写入数据;Sending a data write request, wherein the data write request carries write data that needs to be written;

接收响应于所述数据写入请求返回的针对所述写入数据的写入状态信息;receiving write status information for the write data returned in response to the data write request;

或者,执行如下步骤:Alternatively, perform the following steps:

根据发送的读取写入数据信息的读取请求,读取写入数据以及所述写入数据的标识信息;According to the read request sent to read the write data information, read the write data and the identification information of the write data;

将所述写入数据确定为当前写入数据,将所述写入数据的标识信息确定为所述当前写入数据的标识信息;The write data is determined as the current write data, and the identification information of the write data is determined as the identification information of the current write data;

将所述当前写入数据以及所述当前写入数据的标识信息存储在本地。The currently written data and the identification information of the currently written data are stored locally.

基于上述内容,本申请还提供一种电子设备,包括:Based on the above content, the present application also provides an electronic device, comprising:

处理器;processor;

存储器,用于存储对网络平台产生数据进行处理的程序,所述程序在被所述处理器读取执行时,执行如下步骤:The memory is used to store a program for processing data generated by the network platform. When the program is read and executed by the processor, the following steps are performed:

获取数据查询请求,所述数据查询请求中携带有待查询目标数据的标识信息,其中,所述标识信息用于标识写入数据写入顺序的信息,所述待查询目标数据的标识信息为按照写入顺序范围确定的最后写入的所述写入数据的标识信息;Obtain a data query request, where the data query request carries the identification information of the target data to be queried, wherein the identification information is used to identify the information of the writing sequence of the written data, and the identification information of the target data to be queried is according to the written The identification information of the last written written data determined by the sequence range;

根据所述数据查询请求,确定所述待查询目标数据的标识信息是否与存储的当前写入数据的标识信息相匹配;According to the data query request, determine whether the identification information of the target data to be queried matches the stored identification information of the currently written data;

若不匹配,则获取与所述当前写入数据的标识信息相邻的、且写入顺序在所述当前写入顺序之后的新写入数据及新写入数据的标识信息;If it does not match, then acquire the identification information of the newly written data and the newly written data adjacent to the identification information of the current written data and whose writing order is after the current writing order;

确定所述新写入数据的标识信息与所述待查询目标数据的标识信息是否匹配;Determine whether the identification information of the newly written data matches the identification information of the target data to be queried;

若是,则将所述新写入数据确定为所述待查询目标数据;If so, determine the newly written data as the target data to be queried;

或者,执行如下步骤:Alternatively, perform the following steps:

接收数据查询请求;Receive data query requests;

根据所述数据查询请求,获取新写入数据的标识信息,所述新写入数据的标识信息为按照写入顺序范围确定的最后写入的写入数据的标识信息;According to the data query request, the identification information of the newly written data is obtained, and the identification information of the newly written data is the identification information of the last written write data determined according to the writing sequence range;

将所述标识信息封装到所述数据查询请求中并进行发送;Encapsulate the identification information into the data query request and send it;

获取响应于封装有所述标识信息的所述数据查询请求返回的目标数据;obtaining target data returned in response to the data query request encapsulated with the identification information;

或者,执行如下步骤:Alternatively, perform the following steps:

接收针对新写入数据的标识信息的获取请求,其中,所述新写入数据的标识信息为按照写入顺序范围确定的最后写入的写入数据的标识信息;Receive an acquisition request for the identification information of the newly written data, wherein the identification information of the newly written data is the identification information of the last written write data determined according to the writing sequence range;

根据所述获取请求,将按照写入顺序范围确定的最后写入的写入数据的标识信息作为新写入数据的标识信息进行发送;According to the acquisition request, the identification information of the last written write data determined according to the writing sequence range is sent as the identification information of the newly written data;

或者,执行如下步骤:Alternatively, perform the following steps:

接收数据写入请求,其中,所述数据写入请求中携带有需要写入的写入数据;receiving a data write request, wherein the data write request carries write data that needs to be written;

根据所述数据写入请求,为所述写入数据配置标识信息;其中,所述标识信息用于标识所述写入数据写入顺序的信息;According to the data write request, configure identification information for the write data; wherein, the identification information is used to identify the information of the write data writing sequence;

根据所述写入数据以及所述写入数据的标识信息进行写入操作;Perform a write operation according to the write data and the identification information of the write data;

或者,执行如下步骤:Alternatively, perform the following steps:

发送数据写入请求,其中,所述数据写入请求中携带有需要写入的写入数据;Sending a data write request, wherein the data write request carries write data that needs to be written;

接收响应于所述数据写入请求返回的针对所述写入数据的写入状态信息;receiving write status information for the write data returned in response to the data write request;

或者,执行如下步骤:Alternatively, perform the following steps:

根据发送的读取写入数据信息的读取请求,读取写入数据以及所述写入数据的标识信息;According to the read request sent to read the write data information, read the write data and the identification information of the write data;

将所述写入数据确定为当前写入数据,将所述写入数据的标识信息确定为所述当前写入数据的标识信息;The write data is determined as the current write data, and the identification information of the write data is determined as the identification information of the current write data;

将所述当前写入数据以及所述当前写入数据的标识信息存储在本地。The currently written data and the identification information of the currently written data are stored locally.

在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.

内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。Memory may include non-persistent memory in computer readable media, random access memory (RAM) and/or non-volatile memory in the form of, for example, read only memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.

1、计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括非暂存电脑可读媒体(transitory media),如调制的数据信号和载波。1. Computer readable media includes both persistent and non-permanent, removable and non-removable media. Information storage can be implemented by any method or technology. Information may be computer readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), Flash Memory or other memory technology, Compact Disc Read Only Memory (CD-ROM), Digital Versatile Disc (DVD) or other optical storage, Magnetic tape cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission medium that can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, excludes non-transitory computer-readable media, such as modulated data signals and carrier waves.

2、本领域技术人员应明白,本申请的实施例可提供为方法、系统或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。2. Those skilled in the art should understand that the embodiments of the present application may be provided as methods, systems or computer program products. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.

本申请虽然以较佳实施例公开如上,但其并不是用来限定本申请,任何本领域技术人员在不脱离本申请的精神和范围内,都可以做出可能的变动和修改,因此本申请的保护范围应当以本申请权利要求所界定的范围为准。Although the present application is disclosed above with preferred embodiments, it is not intended to limit the present application. Any person skilled in the art can make possible changes and modifications without departing from the spirit and scope of the present application. Therefore, the present application The scope of protection shall be subject to the scope defined by the claims of this application.

Claims (34)

1. A method for querying data, comprising:
acquiring a data query request, wherein the data query request carries identification information of target data to be queried, the identification information is used for identifying information of a write-in data write-in sequence, and the identification information of the target data to be queried is the identification information of the write-in data written last determined according to a write-in sequence range;
determining whether the identification information of the target data to be inquired is matched with the stored identification information of the current written data or not according to the data inquiry request;
if not, acquiring new written data which is adjacent to the identification information of the current written data and has a writing sequence after the current written data and the identification information of the new written data;
determining whether the identification information of the newly written data is matched with the identification information of the target data to be inquired;
and if so, determining the new write-in data as the target data to be queried.
2. The data query method of claim 1, further comprising:
reading the written data information;
determining the identification information in the read write data information as the identification information of the current write data;
storing the written data corresponding to the identification information of the current written data and the identification information of the current written data locally;
the determining whether the identification information of the target data to be queried matches with the stored identification information of the current written data according to the data query request includes:
and determining whether the identification information of the target data to be inquired is matched with the identification information of the current write data stored locally.
3. The data query method of claim 2, wherein the reading the written data information comprises:
and reading the written data information according to a reading period in an asynchronous mode.
4. The data query method of claim 1, further comprising:
and when the identification information of the newly written data is matched with the identification information of the target data to be inquired, updating the currently written data into the acquired newly written data, and updating the identification information of the currently written data into the identification information of the newly written data.
5. The data query method of claim 1, wherein the determining whether the identification information of the target data matches the identification information of the stored current write data according to the data query request comprises:
comparing the identification code of the identification information of the target data to be inquired with the identification code of the identification information of the currently written data;
and if the identification code of the identification information of the target data to be queried is larger than the identification code of the identification information of the currently written data, determining that the identification code of the identification information of the target data to be queried is not matched with the identification code of the identification information of the currently written data.
6. The data query method of claim 5, further comprising:
if the identification code of the identification information of the target data to be queried is less than or equal to the identification code of the identification information of the current written data, determining that the identification code of the identification information of the target data to be queried is matched with the identification code of the identification information of the current written data;
and determining the current write data as the target data to be queried.
7. The data query method according to claim 1, wherein the determining whether the identification information of the newly written data matches the identification information of the target data to be queried comprises:
comparing the identification code of the identification information of the newly written data with the identification code of the identification information of the target data to be inquired;
and if the identification code of the identification information of the newly written data is greater than or equal to the identification code of the identification information of the target data to be inquired, determining that the identification information of the newly written data is matched with the identification information of the target data.
8. The data query method according to claim 7, wherein the comparing the identification code of the identification information of the newly written data with the identification code of the identification information of the target data to be queried further comprises:
if the identification code of the identification information of the newly written data is smaller than the identification code of the identification information of the target data to be inquired, determining that the identification information of the newly written data is not matched with the identification information of the target data;
and returning to the step of acquiring the new write data which is adjacent to the identification information of the current write data and has the write sequence after the current write sequence and the identification information of the new write data.
9. The data query method of claim 1, further comprising:
and sending the determined target data to be inquired.
10. A data query apparatus, comprising:
the device comprises a first acquisition unit, a second acquisition unit and a third acquisition unit, wherein the first acquisition unit is used for acquiring a data query request, and the data query request carries identification information of target data to be queried, the identification information is used for identifying information of a write-in data write-in sequence, and the identification information of the target data to be queried is identification information of the write-in data which is written last and is determined according to a write-in sequence range;
a first determining unit, configured to determine, according to the data query request, whether the identification information of the target data to be queried matches with the identification information of the stored current write data;
a second obtaining unit, configured to obtain, when the matching result of the first determining unit is not matched, new write data and identification information of the new write data that are adjacent to the identification information of the current write data and have a write order that is subsequent to the current write order;
a second determining unit, configured to determine whether the identification information of the newly written data matches the identification information of the target data to be queried;
and the third determining unit is used for determining the new written data as the target data to be inquired when the matching result in the second determining unit is matching.
11. A query data acquisition method is characterized by comprising the following steps:
receiving a data query request;
acquiring identification information of newly written data according to the data query request, wherein the identification information of the newly written data is the identification information of the last written data determined according to the writing sequence range;
packaging the identification information into the data query request and sending the data query request;
and acquiring target data returned in response to the data query request encapsulated with the identification information.
12. An apparatus for acquiring query data, comprising:
a receiving unit, configured to receive a data query request;
a first obtaining unit, configured to obtain, according to the data query request, identification information of newly written data, where the newly written data is last written data determined according to a writing sequence range;
the packaging sending unit is used for packaging the identification information into the data query request and sending the data query request;
and the second acquisition unit is used for acquiring target data returned in response to the data query request encapsulated with the identification information.
13. A method for sending query data identification information is characterized by comprising the following steps:
receiving an acquisition request aiming at identification information of newly written data, wherein the identification information of the newly written data is the identification information of the last written data determined according to a writing sequence range;
and according to the acquisition request, sending the identification information of the last written data determined according to the writing sequence range as the identification information of the new written data.
14. A transmission apparatus for inquiring data identification information, comprising:
a receiving unit, configured to receive an acquisition request for identification information of newly written data, where the identification information of the newly written data is identification information of last written data determined according to a writing sequence range;
and the sending unit is used for sending the identification information of the last written data determined according to the writing sequence range as the identification information of the new written data according to the acquisition request in the receiving unit and the acquisition request.
15. A method of writing data, comprising:
receiving a data writing request, wherein the data writing request carries writing data needing to be written;
configuring identification information for the written data according to the data writing request; wherein the identification information is used for identifying the information of the writing sequence of the written data;
and performing writing operation according to the written data and the identification information of the written data.
16. The data writing method according to claim 15, further comprising:
receiving state information for describing a write state of the write data;
and sending the state information.
17. The data writing method according to claim 15, wherein the receiving a data writing request comprises:
and receiving data write requests of different write data aiming at the same write partition according to the set received data write request range.
18. The data writing method according to claim 17, wherein the receiving of the data writing request for different writing data of the same writing partition according to the set received data writing request range includes:
receiving data writing requests of different writing data aiming at the same writing subarea according to the set receiving time range for receiving the data writing requests; or,
and receiving data writing requests of different writing data aiming at the same writing subarea according to the set receiving capacity range for receiving the data writing requests.
19. The data writing method according to claim 17, wherein the configuring identification information for the written data according to the data writing request includes:
determining the different write data in the data write request as a write data set;
configuring the identification information for the write data set.
20. The data writing method according to claim 19, wherein the performing the writing operation according to the writing data and the identification information of the writing data includes:
and performing writing operation according to the written data set and the identification information corresponding to the written data set.
21. A data writing apparatus, comprising:
a receiving unit configured to receive a data write request; the data writing request carries writing data needing to be written;
the configuration unit is used for configuring identification information for the written data according to the data writing request; wherein the identification information is used for identifying the information of the writing sequence of the written data;
and the writing unit is used for performing writing operation according to the written data and the identification information of the written data.
22. A method for sending a data write request, comprising:
sending a data writing request, wherein the data writing request carries writing data needing to be written;
receiving write status information for the write data returned in response to the data write request.
23. The method according to claim 22, wherein the sending the data write request comprises:
determining a cache node corresponding to the written data according to attribute information which is carried in the data writing request and used for describing the written data;
and sending the data write request to the corresponding cache node.
24. The method according to claim 23, wherein the determining, according to attribute information that is carried in the data write request and used for describing the write data, a cache node corresponding to the write data includes:
establishing write-in path information aiming at the write-in data according to the identifier of the write-in database and the identifier of the write-in data table which describe the write-in data in the attribute information;
acquiring partition information of the write data table according to the write path information;
and determining the cache node corresponding to the written data according to the partition information.
25. A data write request transmitting apparatus, comprising:
the data writing device comprises a sending unit, a writing unit and a writing unit, wherein the sending unit is used for sending a data writing request, and the data writing request carries writing data needing to be written;
a receiving unit, configured to receive write status information for the write data returned in response to the data write request.
26. A method of reading write data, comprising:
reading the written data and the identification information of the written data according to the sent reading request for reading the written data information;
determining the written data as current written data, and determining the identification information of the written data as the identification information of the current written data;
and storing the current written data and the identification information of the current written data locally.
27. The method for reading data to be written according to claim 26, wherein the reading the write data and the identification information of the write data according to the transmitted read request for reading the write data information comprises:
sending the reading request according to a reading period in an asynchronous mode;
and reading the written data and the identification information of the written data according to the reading request.
28. A reading apparatus for writing data, comprising:
the reading unit is used for reading the written data and the identification information of the written data according to the sent reading request for reading the written data information;
a determining unit, configured to determine the write data as current write data, and determine identification information of the write data as identification information of the current write data;
and the storage unit is used for locally storing the current written data and the identification information of the current written data.
29. An analytical database system, comprising: the system comprises a front-end node, a cache node and a computing node;
the front-end node is used for sending a data operation request to the cache node, and returning operation state or target data or identification information of newly written data aiming at the data operation request; when the data operation request received by the front-end node is a data write request, sending the received data write request to the cache node, and receiving write state information, which is returned by the cache node in response to the data write request and aims at the data write request, of write data; when the data operation request received by the front-end node is a data query request, acquiring identification information of newly written data from the cache node according to the received data query request, wherein the identification information of the newly written data is the identification information of the last written data determined according to a writing sequence range, packaging the identification information of the newly written data into the data query request, and sending the data query request to the computing node to acquire target data determined by the computing node for the data query request;
the cache node is used for receiving the data operation request from the front-end node and sending information responding to the data operation request to the front-end node; when the data operation request received by the cache node is the data writing request, configuring identification information for written data carried in the data writing request according to the data writing request; the identification information is used for identifying the information of the writing sequence of the written data, and writing operation is carried out according to the written data and the identification information of the written data; when the data operation request received by the cache node is the data query request, the cache node receives an acquisition request for identification information of new write data from the front-end node, and according to the acquisition request, the identification information of the last write data determined according to the write sequence range is sent to the front-end node as the identification information of the new write data;
the computing node is configured to obtain a data query request from the front-end node, where the data query request carries identification information of target data to be queried, where the identification information is used to identify information of a write sequence of write data, and the identification information of the target data to be queried is identification information of the write data written last determined according to a write sequence range; determining whether the identification information of the target data to be inquired is matched with the stored identification information of the current written data or not according to the data inquiry request; if not, acquiring new write data which is adjacent to the identification information of the current write data and has a write sequence behind the current write sequence and the identification information of the new write data; determining whether the identification information of the newly written data is matched with the identification information of the target data to be inquired; if yes, determining the newly written data as the target data to be queried; or, reading the written data and the identification information of the written data according to a read request for reading the written data information sent to the cache node; determining the written data as current written data, and determining the identification information of the written data as the identification information of the current written data; and storing the current written data and the identification information of the current written data locally.
30. The analytical database system of claim 29, further comprising:
the service coordination node is used for providing the cache node corresponding to the written data according to the attribute information of the written data in the data writing request in the front-end node;
and the front-end node sends the data write request to the cache node corresponding to the position information according to the cache node provided by the service coordination node.
31. The analytical database system of claim 30, wherein the service coordinator node provides partition information for a write data table according to write path information for the write data established by the front-end node based on an identification of a write database and an identification of the write data table in the attribute information for describing the write data;
the front-end node can determine the cache node corresponding to the write-in data according to the address and the port of the cache node in the partition information.
32. The analytical database system of claim 30, further comprising: and the storage node is used for storing the write-in data which is received by the cache node and needs to be written in, and returning write-in state information aiming at the write-in data.
33. A computer storage medium for storing network platform generated data and a program for processing the network platform generated data;
when the program is read and executed, the following steps are executed:
acquiring a data query request, wherein the data query request carries identification information of target data to be queried, the identification information is used for identifying information of a write-in data write-in sequence, and the identification information of the target data to be queried is the identification information of the write-in data written last determined according to a write-in sequence range;
determining whether the identification information of the target data to be inquired is matched with the stored identification information of the current written data or not according to the data inquiry request;
if not, acquiring new write data which is adjacent to the identification information of the current write data and has a write sequence behind the current write sequence and the identification information of the new write data;
determining whether the identification information of the newly written data is matched with the identification information of the target data to be inquired;
if yes, determining the newly written data as the target data to be queried;
or, the following steps are executed:
receiving a data query request;
acquiring identification information of newly written data according to the data query request, wherein the identification information of the newly written data is the identification information of the last written data determined according to the writing sequence range;
packaging the identification information into the data query request and sending the data query request;
acquiring target data returned in response to the data query request encapsulated with the identification information;
or, the following steps are executed:
receiving an acquisition request aiming at identification information of newly written data, wherein the identification information of the newly written data is the identification information of the last written data determined according to a writing sequence range;
according to the acquisition request, sending the identification information of the last written data determined according to the writing sequence range as the identification information of the new written data;
or, the following steps are executed:
receiving a data writing request, wherein the data writing request carries writing data needing to be written;
configuring identification information for the written data according to the data writing request; wherein the identification information is used for identifying the information of the writing sequence of the written data;
performing writing operation according to the written data and the identification information of the written data;
or, the following steps are executed:
sending a data writing request, wherein the data writing request carries writing data needing to be written;
receiving write status information for the write data returned in response to the data write request;
or, the following steps are executed:
reading the written data and the identification information of the written data according to the sent reading request for reading the written data information;
determining the written data as current written data, and determining the identification information of the written data as the identification information of the current written data;
and storing the current written data and the identification information of the current written data locally.
34. An electronic device, comprising:
a processor;
a memory for storing a program for processing network platform generated data, said program when read and executed by said processor performing the steps of:
acquiring a data query request, wherein the data query request carries identification information of target data to be queried, the identification information is used for identifying information of a write-in data write-in sequence, and the identification information of the target data to be queried is the identification information of the write-in data written last determined according to a write-in sequence range;
determining whether the identification information of the target data to be inquired is matched with the stored identification information of the current written data or not according to the data inquiry request;
if not, acquiring new write data which is adjacent to the identification information of the current write data and has a write sequence behind the current write sequence and the identification information of the new write data;
determining whether the identification information of the newly written data is matched with the identification information of the target data to be inquired;
if yes, determining the newly written data as the target data to be queried;
or, the following steps are executed:
receiving a data query request;
acquiring identification information of newly written data according to the data query request, wherein the identification information of the newly written data is the identification information of the last written data determined according to the writing sequence range;
packaging the identification information into the data query request and sending the data query request;
acquiring target data returned in response to the data query request encapsulated with the identification information;
or, the following steps are executed:
receiving an acquisition request aiming at identification information of newly written data, wherein the identification information of the newly written data is the identification information of the last written data determined according to a writing sequence range;
according to the acquisition request, sending the identification information of the last written data determined according to the writing sequence range as the identification information of the new written data;
or, the following steps are executed:
receiving a data writing request, wherein the data writing request carries writing data needing to be written;
configuring identification information for the written data according to the data writing request; wherein the identification information is used for identifying the information of the writing sequence of the written data;
performing writing operation according to the written data and the identification information of the written data;
or, the following steps are executed:
sending a data writing request, wherein the data writing request carries writing data needing to be written;
receiving write status information for the write data returned in response to the data write request;
or, the following steps are executed:
reading the written data and the identification information of the written data according to the sent reading request for reading the written data information;
determining the written data as current written data, and determining the identification information of the written data as the identification information of the current written data;
and storing the current written data and the identification information of the current written data locally.
CN202010678385.2A 2020-07-15 2020-07-15 Data query and writing method and device, computer storage medium and electronic device Active CN113297203B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010678385.2A CN113297203B (en) 2020-07-15 2020-07-15 Data query and writing method and device, computer storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010678385.2A CN113297203B (en) 2020-07-15 2020-07-15 Data query and writing method and device, computer storage medium and electronic device

Publications (2)

Publication Number Publication Date
CN113297203A true CN113297203A (en) 2021-08-24
CN113297203B CN113297203B (en) 2024-07-02

Family

ID=77318129

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010678385.2A Active CN113297203B (en) 2020-07-15 2020-07-15 Data query and writing method and device, computer storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN113297203B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113901273A (en) * 2021-09-07 2022-01-07 联想(北京)有限公司 Data processing method and device
CN114676166A (en) * 2022-05-26 2022-06-28 阿里巴巴(中国)有限公司 Data processing method and device
WO2023241350A1 (en) * 2022-06-17 2023-12-21 重庆紫光华山智安科技有限公司 Data processing method and device, data access end, and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104317926A (en) * 2014-10-31 2015-01-28 北京思特奇信息技术股份有限公司 Persistent data storage method, persistent data query method, persistent data storage device and persistent data query system
US9250811B1 (en) * 2012-08-08 2016-02-02 Amazon Technologies, Inc. Data write caching for sequentially written media
WO2017101701A1 (en) * 2015-12-15 2017-06-22 阿里巴巴集团控股有限公司 Method and device for querying task status
CN110147413A (en) * 2019-04-26 2019-08-20 平安科技(深圳)有限公司 Date storage method, data query method, apparatus, equipment and storage medium
CN110162543A (en) * 2019-05-29 2019-08-23 北京奇艺世纪科技有限公司 A kind of information query method and device
WO2019178979A1 (en) * 2018-03-21 2019-09-26 平安科技(深圳)有限公司 Method for querying report data, apparatus, storage medium and server
CN110727698A (en) * 2019-09-09 2020-01-24 上海陆家嘴国际金融资产交易市场股份有限公司 Database access method and device, computer equipment and storage medium
WO2020034729A1 (en) * 2018-08-17 2020-02-20 华为技术有限公司 Data processing method, related device, and computer storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9250811B1 (en) * 2012-08-08 2016-02-02 Amazon Technologies, Inc. Data write caching for sequentially written media
CN104317926A (en) * 2014-10-31 2015-01-28 北京思特奇信息技术股份有限公司 Persistent data storage method, persistent data query method, persistent data storage device and persistent data query system
WO2017101701A1 (en) * 2015-12-15 2017-06-22 阿里巴巴集团控股有限公司 Method and device for querying task status
WO2019178979A1 (en) * 2018-03-21 2019-09-26 平安科技(深圳)有限公司 Method for querying report data, apparatus, storage medium and server
WO2020034729A1 (en) * 2018-08-17 2020-02-20 华为技术有限公司 Data processing method, related device, and computer storage medium
CN110147413A (en) * 2019-04-26 2019-08-20 平安科技(深圳)有限公司 Date storage method, data query method, apparatus, equipment and storage medium
CN110162543A (en) * 2019-05-29 2019-08-23 北京奇艺世纪科技有限公司 A kind of information query method and device
CN110727698A (en) * 2019-09-09 2020-01-24 上海陆家嘴国际金融资产交易市场股份有限公司 Database access method and device, computer equipment and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113901273A (en) * 2021-09-07 2022-01-07 联想(北京)有限公司 Data processing method and device
CN114676166A (en) * 2022-05-26 2022-06-28 阿里巴巴(中国)有限公司 Data processing method and device
WO2023241350A1 (en) * 2022-06-17 2023-12-21 重庆紫光华山智安科技有限公司 Data processing method and device, data access end, and storage medium

Also Published As

Publication number Publication date
CN113297203B (en) 2024-07-02

Similar Documents

Publication Publication Date Title
CN106815218B (en) Database access method, device and database system
US20200327107A1 (en) Data Processing Method, Apparatus, and System
US10997137B1 (en) Two-dimensional partition splitting in a time-series database
CN112162846B (en) Transaction processing method, device and computer readable storage medium
CN113297203B (en) Data query and writing method and device, computer storage medium and electronic device
US8380663B2 (en) Data integrity in a database environment through background synchronization
CN108121782A (en) Distribution method, database middleware system and the electronic equipment of inquiry request
CN111723161B (en) A data processing method, device and equipment
CN112328700B (en) A distributed database
CN107861691B (en) A load balancing method and device for a multi-controller storage system
CN106934048A (en) Online data moving method, agent node
CN105095489A (en) Distributed file deletion method, device and system
CN115129782A (en) A partition-level connection method and device for a distributed database
CN114185991A (en) Method and related device for realizing data synchronization based on distributed database
TW201727517A (en) Data storage and service processing method and device
US10331627B2 (en) Method and system for unified technological stack management for relational databases
CN107493309B (en) File writing method and device in distributed system
CN111274004A (en) Process instance management method and device and computer storage medium
CN102724301B (en) Cloud database system and method and equipment for reading and writing cloud data
CN107908713B (en) Distributed dynamic rhododendron filtering system based on Redis cluster and filtering method thereof
Pankowski Consistency and availability of Data in replicated NoSQL databases
CN114942953A (en) Cross-system data updating and querying method and related equipment
HK40058610A (en) Data query and writing method and device, computer storage medium and electronic equipment
CN112685557A (en) Visualized information resource management method and device
EP4521260A1 (en) Data processing method and related apparatus

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40058610

Country of ref document: HK

GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20250611

Address after: Room 1-2-A06, Yungu Park, No. 1008 Dengcai Street, Sandun Town, Xihu District, Hangzhou City, Zhejiang Province, 310030

Patentee after: Aliyun Computing Co.,Ltd.

Country or region after: China

Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands

Patentee before: ALIBABA GROUP HOLDING Ltd.

Country or region before: Cayman Islands