Data Processing Method and Apparatus
By receiving data acquisition requests, the data set identification and target data identification are determined, and the data set is updated as a data sequence based on the data sorting rules, solving the problem of low data sorting efficiency and achieving efficient data reading and real-time performance.
Patent Information
- Application Number
- CN202210260213.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-16
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2042-03-16
AI Technical Summary
In the case of large amount of data, the data sorting efficiency in the prior art is low, which affects the data reading efficiency, and the cache technology has insufficient data real-timeness.
By receiving data acquisition requests, the data set identification and target data identification are determined, the target data set is updated to a target data sequence based on the data sorting rules, and the target data is obtained based on the target data identification, and forward or reverse data sorting rules are used to improve sorting efficiency.
It improves the acquisition efficiency of the target data sequence, improves the data reading efficiency, and ensures the real-time and user experience of the data.
Smart Images

Figure CN114661774B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and particularly to a data processing method. This application also relates to a data processing device, a computing device, and a computer-readable storage medium. Background Art
[0002] With the continuous development of Internet technology, data is usually stored in a database to achieve subsequent data sharing and centralized control of data.
[0003] When reading data from a database, the data can be sorted in a certain direction, and data can be obtained based on business requirements in the sorted data sequence; specifically, the sorting method can be sorting according to a certain characteristic value of the data, such as sorting the data based on the size of the data number.
[0004] However, in the case of a large amount of data, it takes a long time to sort the data, and the system does not automatically select a sorting direction that consumes less time to sort the data, which affects the data sorting efficiency and further affects the subsequent data reading efficiency; to solve the above problems, the data is usually sorted in advance, and the sorted data sequence is cached using a caching technology, and re-sorted every preset time period to update the data sequence; but this method has poor data real-time performance, that is, in the case where the data in the database is updated in real time, the data obtained in the cached data sequence may not be the latest data, that is, it affects the real-time performance of the data.
[0005] Therefore, how to improve the data sorting efficiency and further improve the data reading efficiency has become a technical problem that needs to be solved urgently by those skilled in the art. Summary of the Invention
[0006] In view of this, embodiments of this application provide a data processing method to solve the technical defects existing in the prior art. Embodiments of this application also provide a data processing device, a computing device, and a computer-readable storage medium.
[0007] According to the first aspect of the embodiments of this application, a data processing method is provided, including:
[0008] [[ID=(28)]]Receiving a data acquisition request, where the data acquisition request carries a dataset identifier and a target data identifier;
[0009] Determining a target dataset based on the dataset identifier, and determining a data sorting rule for the target dataset;
[0010] Updating the target dataset to a target data sequence according to the data sorting rule, and obtaining target data in the target data sequence based on the target data identifier.
[0011] Optionally, updating the target data set to a target data sequence according to the data sorting rule includes:
[0012] Determining the data identifier of each data in the target data set;
[0013] Sorting each data in the target data set based on the data sorting rule and each data identifier to obtain a target data sequence.
[0014] Optionally, obtaining target data from the target data sequence based on the target data identifier includes:
[0015] Determining the data fetching and sorting rule of the target data according to the data fetching request;
[0016] Obtaining target data from the target data sequence based on the data fetching and sorting rule and the target data identifier.
[0017] Optionally, obtaining target data from the target data sequence based on the data fetching and sorting rule and the target data identifier includes:
[0018] When the data fetching and sorting rule is consistent with the data sorting rule, determining the fetching length and the target offset based on the target data identifier;
[0019] Obtaining target data from the target data sequence based on the fetching length and the target offset. [[ID=*]]
[0020] Optionally, obtaining target data from the target data sequence based on the data fetching and sorting rule and the target data identifier includes:
[0021] When the data fetching and sorting rule is inconsistent with the data sorting rule, determining the fetching length and the reverse offset based on the target data identifier, and determining the total number of data in the target data set; <*
[0022] Determining the target offset according to the reverse offset, the fetching length and the total number of data;
[0023] Obtaining target data from the target data sequence based on the fetching length and the target offset.
[0024] Optionally, obtaining target data from the target data sequence based on the fetching length and the target offset includes:
[0025] Obtaining the target data to be processed from the target data sequence based on the fetching length and the target offset;
[0026] Perform a negation operation on the target data to be processed to obtain the target data.
[0027] Optionally, before determining the target data set based on the data set identifier and determining the data sorting rule of the target data set, it further includes:
[0028] Update the target data set to a forward data sequence based on the forward data sorting rule, and record the first time value for obtaining the forward data sequence;
[0029] Update the target data set to a reverse data sequence based on the reverse data sorting rule, and record the second time value for obtaining the reverse data sequence;
[0030] In the case where the first time value is greater than the second time value, use the reverse data sorting rule as the data sorting rule of the target data set;
[0031] In the case where the first time value is less than the second time value, use the forward data sorting rule as the data sorting rule of the target data set.
[0032] Optionally, before receiving the data acquisition request, it further includes:
[0033] Receive a data storage request, where the data storage request contains a data set identifier;
[0034] Respond to the data storage request to determine the data to be stored, and determine the target data set based on the data set identifier;
[0035] Store the data to be stored in the target data set.
[0036] According to the second aspect of the embodiments of the present application, another data processing method is provided, including:
[0037] Receive a data acquisition request, where the data acquisition request carries a data set identifier and a target data identifier;
[0038] Determine the target data set based on the data set identifier;
[0039] Obtain the target data from the target data set according to the target data identifier.
[0040] According to the third aspect of the embodiments of the present application, a data processing device is provided, including:
[0041] A receiving module, configured to receive a data acquisition request, where the data acquisition request carries a data set identifier and a target data identifier;
[0042] A determination module, configured to determine a target data set based on the determination of the data set identifier, and determine a data sorting rule for the target data set;
[0043] An acquisition module, configured to update the target data set to a target data sequence according to the data sorting rule, and acquire target data in the target data sequence based on the target data identifier.
[0044] According to a fourth aspect of the embodiments of the present application, there is provided a computing device, including:
[0045] A memory and a processor;
[0046] The memory is used to store computer-executable instructions, and when the processor executes the computer-executable instructions, the steps of the data processing method are implemented.
[0047] According to a fifth aspect of the embodiments of the present application, there is provided a computer-readable storage medium, which stores computer-executable instructions, and when the instructions are executed by a processor, the steps of the data processing method are implemented.
[0048] According to a sixth aspect of the embodiments of the present application, there is provided a chip, which stores a computer program, and when the computer program is executed by the chip, the steps of the data processing method are implemented.
[0049] The data processing method provided by the present application determines a data set identifier by receiving a data acquisition request, determines a target data set based on the data set identifier, and determines a data sorting rule for the target data set; updates the target data set to a target data sequence based on the determined data sorting rule, and acquires target data based on the target data identifier in the data acquisition request. By obtaining a target data sequence based on the data sorting rule of the target data set, the efficiency of obtaining the target data sequence is improved, and further the efficiency of obtaining target data in the target data sequence is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 is a flowchart of a data processing method provided by an embodiment of the present application;
[0051] Figure 2 is a schematic diagram of sorting time consumption provided by an embodiment of the present application;
[0052] Figure 3 is a processing flowchart of a data processing method applied to a target data set Q provided by an embodiment of the present application;
[0053] Figure 4 is a processing flowchart of a data processing method applied to a data set M provided by an embodiment of the present application;
[0054] Figure 5It is a schematic diagram of a target offset calculation method provided by an embodiment of the present application;
[0055] Figure 6 It is a flowchart of another data processing method provided by an embodiment of the present application;
[0056] Figure 7 It is a schematic structural diagram of a data processing device provided by an embodiment of the present application;
[0057] Figure 8 It is a structural block diagram of a computing device provided by an embodiment of the present application. Detailed implementation manners
[0058] In the following description, many 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 extensions without departing from the connotation of the present application. Therefore, the present application is not limited by the specific implementations disclosed below.
[0059] The terms used in one or more embodiments of the present application are for the purpose of describing specific embodiments only and are not intended to limit one or more embodiments of the present application. The singular forms "a", "the", and "said" used in one or more embodiments of the present application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used in one or more embodiments of the present application refers to and includes any or all possible combinations of one or more of the associated listed items.
[0060] It should be understood that although the terms first, second, etc. may be used in one or more embodiments of the present application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of the present application, the first may also be referred to as the second, and similarly, the second may also be referred to as the first.
[0061] First, the noun terms related to one or more embodiments of the present invention are explained.
[0062] Data sorting: It refers to arranging data in a certain order so that researchers can discover some obvious features or trends by browsing the data and find clues to solve problems. And sorting is also helpful for checking and correcting data, as well as facilitating reclassification or grouping, etc.
[0063] Data set: It refers to a set composed of data.
[0064] Currently, it is a common operation to arrange data according to data identifiers to obtain a data sequence and extract a certain segment of data from the data sequence. When the scale of the data set is large, in many cases, sorting and calculating the data in a certain direction (forward) may take a long time, but sorting in the opposite direction (backward) has obvious performance advantages. The current method of extracting data is to directly sort according to the business requirements regardless of the original arrangement of the data, and then directly extract the content data. Using this method, the efficiency is relatively low when the amount of data is large. To improve efficiency, technicians use caching technologies such as redis to cache the data sequence obtained after sorting for data sorting. Since the cached data sequence needs to be updated every preset time, it wastes computing resources. And in the case of real-time data updates, reading data from the cached data sequence will inevitably result in a significant discount in data timeliness.
[0065] In this application, a data processing method is provided. This application also relates to a data processing device, a computing device, and a computer-readable storage medium, which will be described in detail one by one in the following embodiments.
[0066] Figure 1 The flowchart of a data processing method provided by an embodiment of the present application is shown, which specifically includes the following steps:
[0067] Step S102: Receive a data acquisition request. Among them, the data acquisition request carries a data set identifier and a target data identifier.
[0068] Specifically, a data acquisition request refers to a request for obtaining target data in a target data set. For example, obtaining target data with an age of 15 - 20 in data set A; the data acquisition request includes a data set identifier and a target data identifier. Among them, the data set identifier is a field that can uniquely represent the target data set, such as the data set name, data set number, etc. of the target data set, and the target data set is a data set that contains the target data; the target data identifier is a value that can represent the target data, such as the data number of the target data, the age value included in the target data, the score value included in the target data, etc.
[0069] For example, terminal A receives a data acquisition request, where the data acquisition request includes the data set number "26" and the target data identifiers "1, 2, 3".
[0070] In practical applications, a data acquisition request can be generated based on the user's data acquisition requirements, that is, the dataset identifier and the target data identifier are determined according to the user's data acquisition requirements, and then a data acquisition request is generated based on the dataset identifier and the target data identifier. For example, the user's data acquisition requirement is: "Obtain the profile data of students aged 12 - 14 in the student management dataset"; then after determining the user's requirement, the dataset name "student management" of the student management dataset and the target data identifier "12, 13, 14" can be determined based on the user's data acquisition requirement, and a data acquisition request is generated based on the dataset name "student management" and the target data identifier "12, 13, 14".
[0071] Receive a data acquisition request carrying the dataset identifier and the target data identifier, so as to subsequently determine the target dataset based on the dataset identifier, and then realize obtaining the target data in the target dataset based on the target data identifier.
[0072] In practical applications, in order to facilitate obtaining the target data in the target dataset subsequently, before receiving the data acquisition request, it is necessary to store the target data in the target dataset, that is, before receiving the data acquisition request, it also includes:
[0073] Receive a data storage request, where the data storage request contains a dataset identifier;
[0074] Respond to the data storage request to determine the data to be stored, and determine the target dataset based on the dataset identifier;
[0075] Store the data to be stored in the target dataset.
[0076] Among them, the data storage request refers to a request to store the target data in the target dataset; the data to be stored refers to the target data that needs to be stored in the target dataset; the dataset identifier is included in the data storage request, and based on the dataset identifier, it can be determined which target dataset the target dataset is to be stored in.
[0077] In practical applications, responding to the data storage request to determine the data to be stored may include the situation where the data storage request contains the identifier of the data to be stored or the target data; in the case where the identifier of the data to be stored is included in the data storage request, the data to be stored can be obtained in a preset database or dataset based on the identifier of the data to be stored; in the case where the target data is included in the data storage request, the data storage request can be parsed to obtain the data to be stored. After obtaining the data to be stored, the data to be stored can be stored in the target dataset.
[0078] For example, receive a data storage request A, parse the data storage request A, obtain the dataset number "3" and the data identifier "a" to be stored; determine the target dataset 3 according to the dataset number "3", and obtain the data to be stored in the preset data table w based on the data identifier "a" to be stored; store the data to be stored in the target dataset 3.
[0079] Again, receive a data acquisition request B, parse the data storage request B, obtain the dataset name "Student Grades" and the data to be stored "Zhang San's Chinese grade is 80"; determine the student grade dataset according to the dataset name "Student Grades", and store the data to be stored "Zhang San's Chinese grade is 80" in the student grade dataset.
[0080] By storing the data to be stored in the target dataset before receiving the data acquisition request, so as to obtain the target data in the target dataset based on the subsequent requirements.
[0081] Step S104: Determine the target dataset based on the dataset identifier, and determine the data sorting rule of the target dataset.
[0082] After receiving the data acquisition request, parse the data acquisition request to obtain the dataset identifier; in practical applications, the target dataset can be determined in the dataset list based on the dataset identifier, where the dataset list contains the dataset identifier and the dataset corresponding to each dataset identifier; or directly determine the target dataset based on the dataset identifier.
[0083] After determining the target dataset, obtain the data sorting rule of the target dataset. The data sorting rule refers to the data sorting rule preset for the target dataset. Taking sorting the data based on the data number as an example, the data sorting rule can be sorting from large to small based on the size of the data number, sorting from small to large based on the size of the data number, etc.
[0084] In order to obtain the data sorting rule of the target dataset, it is necessary to preset the corresponding data sorting rule for the target dataset before determining the data sorting rule of the target dataset. The methods for setting the data sorting rule include:
[0085] Update the target dataset to a forward data sequence based on the forward data sorting rule, and record the first time value for obtaining the forward data sequence;
[0086] Update the target dataset to a reverse data sequence based on the reverse data sorting rule, and record the second time value for obtaining the reverse data sequence;
[0087] When the first time value is greater than the second time value, use the reverse data sorting rule as the data sorting rule for the target data set;
[0088] When the first time value is less than the second time value, use the forward data sorting rule as the data sorting rule for the target data set.
[0089] Specifically, the forward data sorting rule refers to the rule of sorting the data in the target data set in the forward direction, where the forward direction is a direction opposite to the reverse direction set based on actual needs. For example, the direction of arranging from large to small by numerical value can be used as the forward direction, or the direction of arranging from small to large by numerical value can be used as the forward direction, etc., as long as it is opposite to the reverse direction; the reverse data sorting rule refers to the rule of sorting the data in the target data set in the reverse direction, where the reverse direction is a direction opposite to the forward direction set based on actual needs. For example, the direction of arranging from large to small by numerical value can be used as the reverse direction, or the direction of arranging from small to large by numerical value can be used as the reverse direction, etc., as long as it is opposite to the forward direction.
[0090] For example, if the direction of sorting students' ages from large to small is taken as the forward direction, that is, the forward data sorting rule, then the direction of sorting students' ages from small to large can be taken as the reverse direction, that is, the reverse data sorting rule.
[0091] [[ID=1P2]]The first time value refers to the time required to sort the data in the target data set in the forward direction; the second time value refers to the time required to sort the data in the target data set in the reverse direction.
[0092] In practical applications, the time used when sorting data in the forward direction and in the reverse direction may be different, that is, the first time value and the second time value are inconsistent, resulting in different data fetching efficiencies. For example, as Figure 2 shown, where Figure 2 (a) part is a schematic diagram of sorting the data in the data set using the forward data sorting rule and the reverse data sorting rule respectively based on the quicksort algorithm to obtain a data sequence, and obtaining the target data in the data sequence, as well as the time-consuming corresponding to forward data fetching and reverse data fetching; another example is Figure 2 (b) part is a schematic diagram of sorting the data in the data set using the forward data sorting rule and the reverse data sorting rule respectively based on the bubble sort algorithm to obtain a data sequence, and obtaining the target data in the data sequence, as well as the time-consuming corresponding to forward data fetching and reverse data fetching.
[0093] Specifically, taking the data set s as an example, in the data set s, "1, 2, 3, 4, 5" is stored in the data s in the order of "5, 4, 3, 1, 2". The direction of sorting "1, 2, 3, 4, 5" in the order of "1, 2, 3, 4, 5" is set as the forward direction, and the direction of sorting "1, 2, 3, 4, 5" in the order of "5, 4, 3, 2, 1" is set as the reverse direction. Based on a preset sorting algorithm, "5, 4, 3, 1, 2" in the data set s is sorted in the forward and reverse directions respectively. Since there are more numbers arranged in the reverse order in the data set s, the time used for sorting the data set s in the reverse direction is shorter than that in the forward direction. That is, when sorting the data in the data set s in the reverse direction, the sorting efficiency is higher.
[0094] In the case where the first time value is inconsistent with the second time value, determine the smaller time threshold between the first time value and the second time value, and use the data sorting rule corresponding to the smaller time threshold as the data sorting rule for the target data set. That is, in the case where the first time value is greater than the second time value, if it is determined that the reverse data sorting rule corresponding to the second time value has a higher sorting efficiency, then use the reverse data sorting rule as the sorting rule for the target data set; in the case where the first time value is less than the second time value, if it is determined that the forward data sorting rule corresponding to the second time value has a higher sorting efficiency, then use the forward sorting rule as the sorting rule for the target data set.
[0095] In the case where the data update content in the target data set is small, that is, when local data changes occur, the above method can be used to preset the data sorting rule for the target data set. After the data in the target data set is updated, it is ensured that the data sorting rule preset for the target data set still has a higher sorting efficiency.
[0096] By presetting the data sorting rule for the target data set, when obtaining data in the target data set subsequently, the data in the target data set is sorted using the preset data sorting rule, thereby improving the data sorting efficiency.
[0097] Step S106: Update the target data set to a target data sequence according to the data sorting rule, and obtain the target data in the target data sequence based on the target data identifier.
[0098] After determining the data sorting rule of the target data set, sort the data in the target data set based on the data sorting rule to obtain a target data sequence; obtain the target data corresponding to the target data identifier in the target data set according to the target data identifier in the data acquisition request.
[0099] Among them, the target data sequence refers to the sequence obtained by sorting the data in the target data set based on the data sorting rule. For example, Table 1 below is the target data set, and Table 2 below is the target data sequence obtained by arranging each data based on the age information in each data.
[0100] Table 1
[0101] Name Age Place of Birth A 15 A1 B 14 A3 C 14 A4 D 16 A3
[0102] Table 2
[0103] Name Age Place of Birth B 14 A3 C 14 A4 A 15 A1 D 16 A3
[0104] In practical applications, the specific method for updating the target data set to the target data sequence according to the data sorting rule includes:
[0105] Determine the data identifier of each data in the target data set;
[0106] Sort each data in the target data set based on the data sorting rule and each data identifier to obtain the target data sequence.
[0107] Among them, the data identifier of each data can be an identifier determined based on the sorting requirement. For example, if the data is sorted based on the data number, the data identifier is the data number of each data; again, if the data is sorted based on the age information included in the data, the data identifier is the age value in each data. After determining the data identifier of each data, determine the data sorting direction according to the data sorting rule, and sort the data based on the data identifier in the determined data sorting direction to obtain the target data sequence; the specific algorithm for sorting the data can be the bubble sort algorithm, the quick sort algorithm, etc., and any method that can realize sorting the data in the target data set according to the requirement is acceptable, and the present application does not make specific limitations.
[0108] For example, determine the data number of each data in the target data, and determine that the data numbers are arranged from large to small according to the data sorting rule of the target data set; then sort each data in the target data set based on the data sorting rule and the data number to obtain the target data sequence.
[0109] By updating the target data set to the target data sequence based on the data sorting rule of the target data set, the efficiency of obtaining the target data sequence is improved, and further the efficiency of obtaining the target data in the target data sequence is improved.
[0110] After obtaining the target data sequence, the method for obtaining the target data in the target data sequence based on the target data identifier in the data acquisition request includes:
[0111] Determine the data fetching and sorting rule of the target data according to the data acquisition request;
[0112] Obtain the target data from the target data sequence based on the data fetching and sorting rule and the target data identifier.
[0113] Among them, the data fetching and sorting rule refers to the data sorting direction of the target data. For example, the data fetching and sorting rule is to read "4, 6, 5" in the order of "4, 5, 6" from the target data sequence; in practical applications, the data fetching and sorting rule and the target data identifier can be determined based on the data acquisition request. For example, if the data acquisition request is to obtain the information of students aged 14 to 16, the data fetching and sorting rule can be to obtain the rule that conforms to the age sorting from 14 to 16, and the ages 14, 15, and 16 are the target data identifiers.
[0114] After determining the data fetching and sorting rule and the target data identifier, the target data can be obtained from the target data sequence according to the fetching direction corresponding to the data fetching and sorting rule based on the target data identifier. In practical applications, since there are two situations where the fetching direction corresponding to the data fetching and sorting rule is the same as or different from the sorting direction corresponding to the target data sorting rule, and the methods of obtaining the target data from the target data sequence are different in the two situations, specifically:
[0115] In the case where the fetching direction is the same as the sorting direction, the method of obtaining the target data from the target data sequence based on the data fetching and sorting rule and the target data identifier includes:
[0116] In the case where the data fetching and sorting rule is the same as the data sorting rule, determine the fetching length and the target offset based on the target data identifier;
[0117] Obtain the target data from the target data sequence based on the fetching length and the target offset.
[0118] Among them, the fetching length refers to the total number of data that needs to be obtained from the target data sequence. For example, if the data acquisition requirement is to obtain 5 data with data numbers 12 - 16 from the target data set, the fetching length is 5; the target offset refers to the distance between the starting position of the sequence in the target data sequence and the target data position. For example, if the target data sequence is "1, 2, 3, 4, 5", and "3, 4, 5" is obtained from the target data sequence, the target offset can be determined to be 2 according to the fact that there are two numbers "1, 2" before "3".
[0119] Specifically, the fetching starting position when obtaining the target data from the target data sequence can be determined based on the target offset; start fetching data from the fetching starting position in the target data sequence, and read the data with the fetching length to obtain the target data.
[0120] For example, it is determined that the data extraction and sorting rule is consistent with the data sorting rule of dataset A, specifically: the data extraction and sorting rule of the data acquisition request is to obtain the numbers "5, 6, 7", and the data sorting rule is to arrange the numbers in ascending order; the data in dataset A is sorted according to the data sorting rule to obtain the data sequence "1, 2, 3, 4, 5, 6, 7, 8, 9". According to the data identifier, the extraction length is determined to be 3, and the target offset is 4. Then, starting from the fourth digit according to the target offset, 3 digits are read as the target data.
[0121] In the case where the data extraction direction is inconsistent with the sorting direction, obtaining target data in the target data sequence based on the data extraction and sorting rule and the target data identifier includes:
[0122] In the case where the data extraction and sorting rule is inconsistent with the data sorting rule, determine the extraction length and the reverse offset based on the target data identifier, and determine the total number of data in the target dataset;
[0123] Determine the target offset according to the reverse offset, the extraction length, and the total number of data;
[0124] Obtain the target data in the target data sequence based on the extraction length and the target offset.
[0125] Among them, the reverse offset refers to the offset when obtaining target data in the data sequence opposite to the target data sequence. For example, if the data sequence is "1, 2, 3, 4, 5" and the data acquisition requirement is 4, 3, then the reverse offset is the offset 1 when obtaining "4, 3" in the data sequence opposite to the data sequence "5, 4, 3, 2, 1"; the total number of data in the target dataset refers to the total number of data contained in the target dataset. For example, if dataset b contains 15 data, then the total number of data in dataset b is 15.
[0126] Specifically, since the data extraction and sorting rule is inconsistent with the data sorting rule, it is impossible to directly obtain the data sequence that conforms to the data extraction and sorting rule in the target data sequence. Therefore, it is necessary to calculate the target offset during data extraction by determining the reverse offset and the total number of data. That is, after determining the extraction length, the reverse offset, and the total number of data, the target offset is obtained by subtracting the extraction length and the reverse offset from the total number of data; based on the target offset and the extraction length, the target data can be obtained in the target data sequence.
[0127] For example, it is determined that the data fetching and sorting rule is consistent with the data sorting rule of dataset B. Specifically: the data fetching rule of the data request is to obtain the data with the data number "2-3" in dataset B, and the data sorting rule is to sort in descending order; sorting the data numbers in dataset B according to the data sorting rule gives the data sequence "5, 4, 3, 3, 2, 2, 1", then the fetching length is determined to be 4 according to the data identifier, the reverse offset is 1, and the total number of data in dataset B is 7; subtracting the fetching length and the reverse offset from the total number of data calculates the target offset to be 2; according to the target offset, 4 data with the fetching length are obtained from after the second data number in the data sequence as the target data.
[0128] Further, when the data fetching direction is inconsistent with the sorting direction, that is, when the data fetching and sorting rule is inconsistent with the data sorting rule, the sorting direction of the target data directly obtained according to the fetching length and the target offset is inconsistent with the data fetching direction in the data acquisition requirement. Therefore, it is necessary to perform an inversion operation on the data obtained in the target data sequence. Specifically, obtaining target data in the target data sequence based on the fetching length and the target offset includes:
[0129] Obtaining the target data to be processed in the target data sequence based on the fetching length and the target offset;
[0130] Performing an inversion operation on the target data to be processed to obtain the target data.
[0131] Among them, the target data to be processed refers to the target data obtained that is inconsistent with the data fetching direction in the data fetching and sorting rule; the inversion operation refers to sorting the target data to be processed in the direction opposite to the data fetching direction in the data fetching and sorting rule.
[0132] Specifically, after obtaining the target data to be processed in the target data sequence based on the fetching length and the target offset, performing an inversion operation on the target data to be processed to obtain the target data that meets the data acquisition requirement.
[0133] For example, based on the fetching length 3 and the target offset 3, the target data to be processed "7, 6, 5" is obtained in the data sequence; performing an inversion operation on the target data to be processed gives the target data "5, 6, 7".
[0134] The data processing method of this application determines the dataset identifier by receiving a data acquisition request, determines the target dataset based on the dataset identifier, and determines the data sorting rule of the target dataset; updates the target dataset to a target data sequence based on the determined data sorting rule, and obtains the target data based on the target data identifier in the data acquisition request. By obtaining the target data sequence based on the data sorting rule of the target dataset, the efficiency of obtaining the target data sequence is improved, and further the efficiency of obtaining the target data in the target data sequence is improved, enabling the user to read the target data from the dataset faster and enhancing the user experience.
[0135] The following, in combination with the attached Figure 3 Taking the application of the data processing method provided by this application to the target dataset Q as an example, the data processing method will be further described. Among them, Figure 3 FIG. shows a processing flow chart of a data processing method applied to the target dataset Q provided by an embodiment of this application, which specifically includes the following steps:
[0136] Step S302: Receive a data storage request, and determine the data to be stored and the dataset identifier in the data storage request.
[0137] Specifically, receive the data storage request; parse the received data storage request to obtain the data to be stored and the dataset identifier, so as to subsequently store the data to be stored into the dataset corresponding to the dataset identifier.
[0138] Step S304: Determine the target dataset Q based on the dataset identifier, and store the data to be stored into the target dataset Q.
[0139] Specifically, determine the target dataset Q based on the dataset identifier Q, and store the data to be stored parsed from the data storage request into the target dataset Q.
[0140] Step S306: Obtain the forward sorting rule and the reverse sorting rule, and sort the data in the target dataset Q based on the forward sorting rule and the reverse sorting rule respectively to obtain a forward data sequence and a reverse data sequence.
[0141] Specifically, the forward sorting rule is to sort the data numbers from small to large, and the reverse sorting rule is to sort the data numbers from large to small; sort the data in the target dataset Q in the forward direction based on the preset sorting algorithm and the forward sorting rule to obtain the forward data sequence; sort the data in the target dataset Q in the reverse direction based on the preset sorting algorithm and the reverse sorting rule to obtain the reverse data sequence.
[0142] Step S308: Record the first time value for obtaining the forward data sequence and the second time value for obtaining the reverse data sequence, and determine the data sorting rule for the target data set Q based on the first time value and the second time value.
[0143] Specifically, obtain the first time value and the second time value, and determine the magnitudes of the first time value and the second time value; if it is determined that the second time value is greater than the first time value, that is, the time used for sorting using the forward sorting rule is shorter, then use the forward sorting rule as the data sorting rule for the target data set Q.
[0144] Step S310: Receive a data acquisition request, and determine the data set identifier and the target data identifier in the data acquisition request.
[0145] Specifically, receive a data acquisition request, where the data acquisition request is to obtain user data with user ages between 55 and 57 in the data set Q; parse and determine the data set identifier Q and the target data identifiers 55, 56, and 57 in the data acquisition request.
[0146] Step S312: Determine the target data set Q based on the data set identifier, and determine the data sorting rule for the target data set Q.
[0147] Specifically, determine the target data set Q based on the data set identifier Q, and determine that the data sorting rule for the target data set Q is the forward sorting rule, that is, the data sorting rule for sorting the data from smallest to largest.
[0148] Step S314: Determine the data identifier of each data in the target data set Q, and sort the data in the target data set Q based on the data sorting rule and each data identifier to obtain the target data sequence Q1.
[0149] Specifically, determine the data identifier of each data in the target data set Q. Since in this embodiment, sorting needs to be performed based on the user age, it is determined that the age of each data in the target data set is used as the data identifier; sort each data in the target data set based on the data identifier and the forward sorting rule to obtain the target data sequence Q1.
[0150] Step S316: Determine the data fetching sorting rule for the target data according to the data acquisition request, and obtain the target data in the target data sequence Q1 based on the data fetching sorting rule and the data identifier.
[0151] Specifically, according to the data acquisition request "obtain user data with user age between 55 and 57 in dataset Q", the data extraction rule for the target data is determined to be sorted in ascending order of age; it is determined that the extraction sorting rule is consistent with the data sorting rule of the target dataset Q, then the extraction length 5 and the target offset 4 are determined according to the data identifier, and it is determined that after 4 user data in the target data sequence Q1, 5 pieces of data are obtained as the target data.
[0152] The data processing method of this embodiment determines the dataset identifier by receiving a data acquisition request, determines the target dataset based on the dataset identifier, and determines the data sorting rule of the target dataset; updates the target dataset to the target data sequence based on the determined data sorting rule, and obtains the target data based on the target data identifier in the data acquisition request. By obtaining the target data sequence based on the data sorting rule of the target dataset, the efficiency of obtaining the target data sequence is improved, and further the efficiency of obtaining the target data in the target data sequence is improved, enabling the user to read the target data from the dataset faster and improving the user experience.
[0153] The following combines the attached Figure 4 Taking the application of the data processing method provided in this application to dataset M as an example, the data processing method will be further described. Among them, Figure 4 FIG. shows a processing flow chart of a data processing method applied to dataset M provided by an embodiment of this application, which specifically includes the following steps:
[0154] Step S402: Obtain the forward sorting rule and the reverse sorting rule, and sort the data in dataset M based on the forward sorting rule and the reverse sorting rule respectively to determine the data sorting rule of dataset M.
[0155] Specifically, determine dataset M {9, 8, 7, 6, 5, 1, 2, 3, 4}; sort the data in dataset M based on the forward sorting rule to obtain the forward data sequence {1, 2, 3, 4, 5, 6, 7, 8, 9}; sort the data in dataset M based on the reverse data sorting rule to obtain the reverse data sequence; obtain the time t1 for obtaining the forward data sequence and the time t2 for obtaining the reverse data sequence; determine that t1 is greater than t2, then use the reverse sorting rule as the data sorting rule of dataset M.
[0156] Step S404: Receive a data update request for dataset M, and update dataset M based on the data update request.
[0157] Specifically, receive the data update request; parse the data update request to determine the dataset identifier M and the data to be stored 10; store the data to be stored 10 in dataset M to obtain the updated dataset M {9, 10, 8, 7, 6, 5, 1, 2, 3, 4}.
[0158] Step S406: Receive a data acquisition request, and determine the dataset identifier M and the target data identifier in the data acquisition request.
[0159] Specifically, the data acquisition request is to obtain the numbers "5, 6, 7" from dataset M; parse the data acquisition request to determine the dataset identifier M and the dataset identifiers as 5, 6, and 7.
[0160] Step S408: Determine dataset M according to the dataset identifier M, and determine the data sorting rule of dataset M.
[0161] Specifically, dataset M was updated in step S404, but at this time the data sorting rule of dataset M was not updated, that is, the data sorting rule of dataset M at this time is the reverse sorting rule.
[0162] Step S410: Sort the data in dataset M based on the data sorting rule to obtain data sequence M1.
[0163] Specifically, sort the data in dataset M based on the reverse sorting rule to obtain data sequence M1 {10, 9, 8, 7, 6, 5, 4, 3, 2, 1}.
[0164] Step S412: Determine the fetching sorting rule of the target data according to the data acquisition request, and obtain the target data in data sequence M1 based on the fetching sorting rule and the data identifier.
[0165] Specifically, based on the data acquisition request "5, 6, 7", determine the fetching sorting rule to be sorted from small to large; determine that the fetching sorting rule is inconsistent with the data sorting rule of dataset M, then obtain the total number of data T in dataset M as 10, determine the reverse offset N as 4, and determine the fetching length L as 3. Among them, as Figure 5 shown in part (a) below, the reverse offset refers to the offset N corresponding to obtaining the target data "5, 6, 7" in the forward data sequence.
[0166] As Figure 5 shown in part (b) below, use the total number of data T minus the reverse offset N and the fetching length L to obtain the target offset NN as 3, that is, NN = T - N - L = 3; obtain the to-be-processed target data "7, 6, 5" in data sequence M1 according to the target offset NN and the fetching length L, and perform a negation operation on the to-be-processed target data to obtain the target data "5, 6, 7".
[0167] The data processing method of this embodiment determines the dataset identifier by receiving a data acquisition request, determines the target dataset based on the dataset identifier, and determines the data sorting rule of the target dataset; updates the target dataset to a target data sequence based on the determined data sorting rule, and obtains the target data based on the target data identifier in the data acquisition request. After setting the data sorting rule for the target dataset, the target dataset can be updated. When the target dataset is partially updated, there is no need to re-determine the data sorting rule of the target dataset. Instead, the data can be sorted directly based on the existing data sorting rule to obtain the target data, which can improve the data sorting efficiency and thus the data fetching efficiency; that is, there is no need to cache the sorted data and update the cache in real time. Instead, sorting can be performed based on the data sorting rule each time data is read, thereby ensuring the real-time nature of the data while guaranteeing the data fetching efficiency.
[0168] In practical applications, if the sorting of the target dataset is consistent with the sorting in the data sorting rule, there is no need to sort the target data sequence based on the data sorting rule. Instead, the target data can be directly obtained from the target dataset based on the target data identifier. Specifically, Figure 6 The flowchart of another data processing method provided by an embodiment of the present application is shown, which specifically includes the following steps:
[0169] Step S602: Receive a data acquisition request, where the data acquisition request carries a dataset identifier and a target data identifier.
[0170] Specifically, the data acquisition request refers to a request to obtain target data from the target dataset; the data acquisition request contains a dataset identifier and a target data identifier. Among them, the dataset identifier is a field that can uniquely represent the target dataset, such as the dataset name or dataset number of the target dataset. The target dataset is a data set that contains the target data; the target data identifier is a value that can represent the target data.
[0171] Step S604: Determine the target dataset based on the dataset identifier.
[0172] Specifically, when it is determined that the data sorting rule corresponding to the target dataset is consistent with the data sorting in the target dataset, the target dataset is used as the target data sequence, that is, there is no need to sort the target dataset according to the data sorting rule. For example, the data sorting rule of the target dataset is to arrange in descending order of age, that is, "55, 54, 53, 52"; and the data sorting direction in the target dataset is consistent with the data sorting rule, that is, also "55, 54, 53, 52", then the target dataset can be used as the target data sequence without sorting the target dataset.
[0173] Step S606: Obtain target data from the target data set according to the target data identifier.
[0174] Specifically, determine whether the data extraction direction is consistent with the sorting direction of the target data set, that is, determine whether the data extraction direction is consistent with the data sorting rule.
[0175] When the data extraction sorting rule is consistent with the data sorting rule, determine the extraction length and the target offset based on the target data identifier; obtain the target data from the target data sequence based on the extraction length and the target offset.
[0176] When the data extraction sorting rule is inconsistent with the data sorting rule, determine the extraction length and the reverse offset based on the target data identifier, and determine the total number of data in the target data set; determine the target offset according to the reverse offset, the extraction length, and the total number of data; obtain the target data to be processed from the target data sequence based on the extraction length and the target offset; perform an inversion operation on the target data to be processed to obtain the target data.
[0177] In the data processing method of this embodiment, when the sorting direction of the target data set is consistent with the corresponding data sorting rule of the target data set, directly use the target data set as the target data sequence, and obtain the target data from the target data set according to the target data identifier, thereby improving the data sorting efficiency and further improving the data acquisition efficiency.
[0178] Corresponding to the above method embodiment, the present application also provides an embodiment of a data processing device. Figure 7 The structural schematic diagram of a data processing device provided by an embodiment of the present application is shown. As Figure 7 shown, the device includes:
[0179] A receiving module 702, configured to receive a data acquisition request, where the data acquisition request carries a data set identifier and a target data identifier;
[0180] A determining module 704, configured to determine a target data set based on the data set identifier and determine the data sorting rule of the target data set;
[0181] An obtaining module 706, configured to update the target data set to a target data sequence according to the data sorting rule and obtain target data from the target data sequence based on the target data identifier.
[0182] Optionally, the obtaining module 706 is further configured to:
[0183] Determine the data identifier of each data in the target data set;
[0184] Sort each data in the target data set based on the data sorting rule and each data identifier to obtain a target data sequence.
[0185] Optionally, the obtaining module 706 is further configured to:
[0186] Determine the fetching and sorting rule of the target data according to the data acquisition request;
[0187] Obtain the target data in the target data sequence based on the fetching and sorting rule and the target data identifier.
[0188] Optionally, the obtaining module 706 is further configured to:
[0189] When the fetching and sorting rule is consistent with the data sorting rule, determine the fetching length and the target offset based on the target data identifier;
[0190] Obtain the target data in the target data sequence based on the fetching length and the target offset.
[0191] Optionally, the obtaining module 706 is further configured to:
[0192] When the fetching and sorting rule is inconsistent with the data sorting rule, determine the fetching length and the reverse offset based on the target data identifier, and determine the total number of data in the target data set;
[0193] Determine the target offset according to the reverse offset, the fetching length and the total number of data;
[0194] Obtain the target data in the target data sequence based on the fetching length and the target offset.
[0195] Optionally, the obtaining module 706 is further configured to:
[0196] Obtain the target data to be processed in the target data sequence based on the fetching length and the target offset;
[0197] Perform an inversion operation on the target data to be processed to obtain the target data.
[0198] Optionally, the device further includes an updating module, configured to:
[0199] Update the target data set to a forward data sequence based on the forward data sorting rule, and record the first time value for obtaining the forward data sequence;
[0200] Update the target data set to a reverse data sequence based on the reverse data sorting rule, and record a second time value for obtaining the reverse data sequence;
[0201] In the case where the first time value is greater than the second time value, use the reverse data sorting rule as the data sorting rule for the target data set;
[0202] In the case where the first time value is less than the second time value, use the forward data sorting rule as the data sorting rule for the target data set.
[0203] Optionally, the device further includes a receiving sub-module configured to:
[0204] Receive a data storage request, where the data storage request contains a data set identifier;
[0205] Determine the data to be stored in response to the data storage request, and determine the target data set based on the data set identifier;
[0206] Store the data to be stored in the target data set.
[0207] The data processing device of the present application includes a receiving module that receives a data acquisition request, where the data acquisition request carries a data set identifier and a target data identifier; a determination module that determines a target data set based on the data set identifier and determines the data sorting rule of the target data set; an acquisition module that updates the target data set to a target data sequence according to the data sorting rule and acquires target data in the target data sequence based on the target data identifier. By obtaining the target data sequence based on the data sorting rule of the target data set, the efficiency of obtaining the target data sequence is improved, and further the efficiency of obtaining the target data in the target data sequence is improved, enabling the user to read the target data from the data set faster and enhancing the user experience.
[0208] The above is a schematic solution of a data processing device in this embodiment. It should be noted that the technical solution of this data processing device and the technical solution of the above data processing method belong to the same concept. For the details not described in the technical solution of the data processing device, reference can be made to the description of the technical solution of the above data processing method. In addition, each component in the device embodiment should be understood as a functional module that must be established to implement each step of the program flow or each step of the method. The device claims defined by such a set of functional modules should be understood as mainly implementing the functional module framework of the solution through the computer program recorded in the specification, rather than being understood as mainly implementing the entity device of the solution through hardware means.
[0209] Figure 8 FIG. 800 shows a structural block diagram of a computing device 800 provided according to an embodiment of the present application. The components of the computing device 800 include, but are not limited to, a memory 810 and a processor 820. The processor 820 is connected to the memory 810 via a bus 830, and a database 850 is used to store data.
[0210] The computing device 800 further includes an access device 840, which enables the computing device 800 to communicate via one or more networks 860. Examples of these networks include the Public Switched Telephone Network (PSTN), Local Area Network (LAN), Wide Area Network (WAN), Personal Area Network (PAN), or a combination of communication networks such as the Internet. The access device 840 may include one or more of any type of wired or wireless network interface (e.g., Network Interface Card (NIC)), such as an IEEE802.11 Wireless Local Area Network (WLAN) wireless interface, Worldwide Interoperability for Microwave Access (Wi-MAX) interface, Ethernet interface, Universal Serial Bus (USB) interface, cellular network interface, Bluetooth interface, Near Field Communication (NFC) interface, and so on.
[0211] In an embodiment of the present application, the above components of the computing device 800 and Figure 8 other components not shown may also be connected to each other, for example, via a bus. It should be understood that Figure 8 the shown structural block diagram of the computing device is only for illustrative purposes and is not a limitation on the scope of the present application. Those skilled in the art may add or replace other components as needed.
[0212] The computing device 800 may be any type of stationary or mobile computing device, including mobile computers or mobile computing devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones), wearable computing devices (e.g., smartwatches, smart glasses, etc.) or other types of mobile devices, or stationary computing devices such as desktop computers or PCs. The computing device 800 may also be a mobile or stationary server.
[0213] Among them, the processor 820 is used to execute computer-executable instructions of the data processing method.
[0214] The above is a schematic solution of a computing device in this embodiment. It should be noted that the technical solution of this computing device and the technical solution of the above data processing method belong to the same concept. For the details not described in the technical solution of the computing device, reference may be made to the description of the technical solution of the above data processing method.
[0215] One embodiment of the present application further provides a computer-readable storage medium, which stores computer instructions that, when executed by a processor, are used for a data processing method.
[0216] The above is a schematic solution of a computer-readable storage medium according to this embodiment. It should be noted that the technical solution of this storage medium and the technical solution of the above data processing method belong to the same concept. For the details not described in the technical solution of the storage medium, reference can be made to the description of the technical solution of the above data processing method.
[0217] One embodiment of the present application further provides a chip, which stores a computer program that, when executed by the chip, implements the steps of the data processing method.
[0218] The above describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve the desired result. Additionally, the processes depicted in the figures do not necessarily require the particular order or sequential order shown to achieve the desired result. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0219] The computer instructions include computer program code, which may be in the form of source code, object code, executable files, or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disc, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium, etc. It should be noted that the content included in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium does not include electrical carrier signals and telecommunication signals.
[0220] It should be noted that for the foregoing method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the present application is not limited by the described action sequence, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the present application.
[0221] In the above embodiments, the descriptions of the various embodiments have their own emphases. For parts not detailed in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.
[0222] The preferred embodiments of the present application disclosed above are only used to help explain the present application. The alternative embodiments do not describe all the details in detail, nor do they limit the invention to the specific embodiments described. Obviously, many modifications and variations can be made according to the content of the present application. These embodiments are selected and specifically described in the present application to better explain the principle and practical application of the present application, so that those skilled in the art can well understand and utilize the present application. The present application is only limited by the claims and their full scope and equivalents.
Claims
1. A data processing method, characterized in that, Including: Receiving a data acquisition request, where the data acquisition request carries a dataset identifier and a target data identifier; Determining a target dataset based on the dataset identifier and determining a data sorting rule for the target dataset; In the case where the sorting of the target dataset is inconsistent with the data sorting rule of the target dataset, updating the target dataset to a target data sequence according to the data sorting rule, and acquiring target data from the target data sequence based on the target data identifier; Wherein, the acquiring target data from the target data sequence based on the target data identifier includes: Determining a data fetching sorting rule for the target data according to the data acquisition request; Judging whether the data fetching sorting rule is consistent with the data sorting rule; Acquiring target data from the target data sequence based on the judgment result and the target data identifier; The acquiring target data from the target data sequence based on the judgment result and the target data identifier includes: In the case where the data fetching sorting rule is inconsistent with the data sorting rule, determining a fetching length and a reverse offset based on the target data identifier, and determining the total number of data in the target dataset; determining a target offset according to the reverse offset, the fetching length, and the total number of data; acquiring target data from the target data sequence based on the fetching length and the target offset, where the data fetching sorting rule at least includes a rule for reversely reading target data.
2. The data processing method according to claim 1, wherein Updating the target dataset to a target data sequence according to the data sorting rule includes: Determining a data identifier for each data in the target dataset; Sorting each data in the target dataset based on the data sorting rule and each data identifier to obtain a target data sequence.
3. The data processing method according to claim 1, wherein Acquiring target data from the target data sequence based on the judgment result and the target data identifier includes: In the case where the data fetching sorting rule is consistent with the data sorting rule, determining a fetching length and a target offset based on the target data identifier; Acquiring target data from the target data sequence based on the fetching length and the target offset.
4. The data processing method according to claim 1, wherein The acquiring target data from the target data sequence based on the fetching length and the target offset includes: Acquiring target data to be processed from the target data sequence based on the fetching length and the target offset; Performing an inversion operation on the target data to be processed to obtain target data.
5. The data processing method according to claim 1, wherein Before determining the target dataset based on the dataset identifier and determining the data sorting rule for the target dataset, further including: Updating the target dataset to a forward data sequence based on a forward data sorting rule and recording a first time value for obtaining the forward data sequence; Updating the target dataset to a reverse data sequence based on a reverse data sorting rule and recording a second time value for obtaining the reverse data sequence; In the case where the first time value is greater than the second time value, using the reverse data sorting rule as the data sorting rule for the target dataset; In the case where the first time value is less than the second time value, the forward data sorting rule is used as the data sorting rule for the target data set.
6. The data processing method according to claim 1, wherein Before receiving a data acquisition request, it further includes: Receiving a data storage request, where the data storage request contains a data set identifier; In response to the data storage request, determining the data to be stored and determining the target data set based on the data set identifier; Storing the data to be stored into the target data set.
7. A data processing method, characterized in that, It includes: Receiving a data acquisition request, where the data acquisition request carries a data set identifier and a target data identifier; Determining the target data set based on the data set identifier and determining the data sorting rule of the target data set; In the case where the sorting of the target data set is consistent with the data sorting rule of the target data set, obtaining the target data in the target data set according to the target data identifier; Wherein, obtaining the target data in the target data set according to the target data identifier includes: Determining the data extraction sorting rule of the target data according to the data acquisition request; Judging whether the data extraction sorting rule is consistent with the data sorting rule; Obtaining the target data in the target data set based on the judgment result and the target data identifier; The obtaining the target data in the target data sequence based on the judgment result and the target data identifier includes: In the case where the data extraction sorting rule is inconsistent with the data sorting rule, determining the extraction length and the reverse offset based on the target data identifier, and determining the total number of data in the target data set; determining the target offset according to the reverse offset, the extraction length and the total number of data; obtaining the target data in the target data sequence based on the extraction length and the target offset, where the data extraction sorting rule at least includes a rule for reversely reading the target data.
8. A data processing device, characterized in that, It includes: A receiving module, configured to receive a data acquisition request, where the data acquisition request carries a data set identifier and a target data identifier; A determining module, configured to determine the target data set based on the data set identifier and determine the data sorting rule of the target data set; An obtaining module, configured to, in the case where the sorting of the target data set is inconsistent with the data sorting rule of the target data set, update the target data set to a target data sequence according to the data sorting rule, and obtain the target data in the target data sequence based on the target data identifier; The obtaining module is further configured to determine a data fetching sorting rule for the target data according to the data fetching request; determine whether the data fetching sorting rule is consistent with the data sorting rule; obtain target data from the target data sequence based on the judgment result and the target data identifier; the obtaining target data from the target data sequence based on the judgment result and the target data identifier includes: in the case where the data fetching sorting rule is inconsistent with the data sorting rule, determining a fetching length and a reverse offset based on the target data identifier, and determining the total number of data in the target data set; determining a target offset according to the reverse offset, the fetching length and the total number of data; obtaining target data from the target data sequence based on the fetching length and the target offset, wherein the data fetching sorting rule at least includes a rule for reversely reading target data.
9. A computing device, characterized in that, including: a memory and a processor; The memory is used for storing computer-executable instructions, and the processor is used for executing the computer-executable instructions to implement the steps of the data processing method according to any one of claims 1 to 6 or 7.
10. A computer-readable storage medium storing computer instructions, characterized in that, When the instruction is executed by the processor, the steps of the data processing method according to any one of claims 1 to 6 or 7 are implemented.
11. A computer program product, characterized in that, including computer instructions, and when the computer instructions are executed by the processor, the steps of the data processing method according to any one of claims 1 to 6 or 7 are implemented.
Citation Information
Patent Citations
Data search method and device, computer equipment and storage medium
CN111651645A