CN112182107B - List data acquisition method, device, computer equipment and storage medium - Google Patents

List data acquisition method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN112182107B
CN112182107B CN202011052146.2A CN202011052146A CN112182107B CN 112182107 B CN112182107 B CN 112182107B CN 202011052146 A CN202011052146 A CN 202011052146A CN 112182107 B CN112182107 B CN 112182107B
Authority
CN
China
Prior art keywords
query
data
list
priority
result
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011052146.2A
Other languages
Chinese (zh)
Other versions
CN112182107A (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.)
Ping An Property and Casualty Insurance Company of China Ltd
Original Assignee
Ping An Property and Casualty Insurance Company of China 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 Ping An Property and Casualty Insurance Company of China Ltd filed Critical Ping An Property and Casualty Insurance Company of China Ltd
Priority to CN202011052146.2A priority Critical patent/CN112182107B/en
Publication of CN112182107A publication Critical patent/CN112182107A/en
Application granted granted Critical
Publication of CN112182107B publication Critical patent/CN112182107B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2453Query optimisation
    • G06F16/24534Query rewriting; Transformation
    • 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/248Presentation of query results
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

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

Abstract

The embodiment of the application belongs to the technical field of big data, and relates to a list data acquisition method, which comprises the following steps: acquiring preset query conditions and priority fields, acquiring corresponding query results according to the query conditions and the priority fields, and combining the query results to obtain result set data; grouping the result set data according to the query condition to obtain grouping data, and sorting the grouping data to obtain sorting data corresponding to the query condition; when receiving a list query instruction, determining whether the list query instruction carries a specified query condition; when the list query instruction does not carry the designated query condition, the first data of each group in the ordered data are combined into a data set, and the first data with the highest priority in the data set is extracted as list data. The application also provides a list data acquisition device, computer equipment and a storage medium. In addition, the application also relates to a blockchain technology, and list data can be stored in the blockchain. The application improves the data acquisition efficiency.

Description

List data acquisition method, device, computer equipment and storage medium
Technical Field
The present application relates to the field of big data technologies, and in particular, to a method and apparatus for acquiring list data, a computer device, and a storage medium.
Background
The TiDB is an open source distributed mySQL database, list resources are usually stored in the TIDB database, and the database needs to be queried each time the list is acquired and processed. The traditional query mode needs to acquire list data meeting the conditions through the service modes which can be processed by the agents, the dialing mechanism and other conditions.
The list data has different priority characteristics, and after the corresponding result set data is queried according to the seat dialing mechanism, the result set data is ordered according to all fields of the priority characteristics. When the data volume is large, the query mode can cause overlong database ordering time (the current production data is less than 20 ten thousand per day, and the single acquisition time length exceeds 0.15 s), thereby causing the technical problem of low list data acquisition efficiency.
Disclosure of Invention
The embodiment of the application aims to provide a method, a device, computer equipment and a storage medium for acquiring list data, so as to solve the technical problem of low efficiency of acquiring the list data.
In order to solve the above technical problems, the embodiment of the present application provides a method for acquiring list data, which adopts the following technical scheme:
Acquiring preset query conditions and priority fields, acquiring corresponding query results according to the query conditions and the priority fields, and combining all the query results corresponding to the query conditions to obtain result set data;
grouping the result set data according to the query conditions to obtain grouping data, obtaining the query grade of the priority field, and sorting the grouping data according to the query grade to obtain sorting data corresponding to the query conditions;
when receiving a list query instruction, determining whether the list query instruction carries a specified query condition;
and when the list query instruction does not carry the specified query condition, combining the first data of each group in the sequencing data into a data set, and extracting the first data with the highest priority in the data set as list data corresponding to the list query instruction.
Further, the step of grouping the result set data according to the query condition to obtain grouping data specifically includes:
taking the query condition as a keyword, and taking the priority field and the query result as keys corresponding to the keyword;
and grouping the result set data based on a preset data structure according to the keywords and the keys to obtain grouping data.
Further, the step of obtaining the query level of the priority field and sorting the packet data according to the query level specifically includes:
acquiring preset field types, determining query levels of priority fields in each piece of packet data under different field types, and determining the result priority of a query result in each piece of packet data according to the query levels;
and sorting the query results in each group of data according to the result priority, and obtaining sorting data when all the group of data are sorted.
Further, the step of determining the result priority of the query result in each packet data according to the query level specifically includes:
acquiring a preset initial weight of each field category, wherein the field category comprises a list name, a list batch number and start-stop time;
and obtaining the result priority of the query result in each group of data through weighted summation calculation according to the preset initial weight and the query grade.
Further, after the step of obtaining the ranking data corresponding to the query condition, the method further includes:
When a data adding instruction is received, acquiring a preset timing adding moment;
and when the timing adding moment is reached, adding the newly added query result and the newly added query condition corresponding to the data adding instruction into the sequencing data.
Further, after the step of determining whether the list query instruction carries a specified query condition, the method further includes:
and inquiring grouping data comprising the specified query conditions in the sorting data according to the specified query conditions when the list query instruction carries the specified query conditions, and extracting first data in the grouping data as list data corresponding to the list query instruction.
Further, after the step of combining the query results to obtain result set data, the method further comprises:
acquiring a list primary key corresponding to each query condition;
according to the list main key, the query conditions and the priority fields are formed into a data row, and query results corresponding to the query conditions are associated;
and loading the list main key, the query condition, the priority field and the query result into an application memory for storage.
In order to solve the above technical problems, the embodiment of the present application further provides a device for acquiring list data, which adopts the following technical scheme:
The acquisition module is used for acquiring preset query conditions and priority fields, acquiring corresponding query results according to the query conditions and the priority fields, and combining all the query results corresponding to the query conditions to obtain result set data;
the grouping module is used for grouping the result set data according to the query condition to obtain grouping data, and performing sorting processing on the grouping data to obtain sorting data corresponding to the query condition;
the confirmation module is used for determining whether the list query instruction carries a specified query condition or not when receiving the list query instruction;
and the extraction module is used for combining the first data of each group in the sequencing data into a data set when the list query instruction does not carry the specified query condition, and extracting the first data with the highest priority in the data set as the list data corresponding to the list query instruction.
In order to solve the above technical problem, an embodiment of the present application further provides a computer device, including a memory and a processor, where the memory stores computer readable instructions, and the processor implements the steps of the above list data obtaining method when executing the computer readable instructions.
In order to solve the above technical problem, an embodiment of the present application further provides a computer readable storage medium, where computer readable instructions are stored on the computer readable storage medium, and the computer readable instructions implement the steps of the above list data obtaining method when executed by a processor.
The method comprises the steps of obtaining preset query conditions and priority fields, obtaining corresponding query results according to the query conditions and the priority fields, and combining all query results corresponding to the query conditions to obtain result set data; grouping the result set data according to the query conditions to obtain grouping data, wherein the grouping data is grouping according to the query conditions and comprises a priority field corresponding to each query condition and data of a query result, when the grouping data is obtained, a preset field class is obtained, and sorting processing is carried out on the grouping data according to the field class to obtain sorting data corresponding to the query conditions; when receiving a list query instruction, determining whether the list query instruction carries a specified query condition, wherein the specified query condition is a query condition of a request query initiated by a requester; when the list query instruction does not carry the specified query condition, the method indicates that the currently stored optimal list data is directly obtained, and the specified list data is not required to be obtained according to the specified query condition; and combining the first data of each group in the ordered data into a data set, extracting the first data with the highest priority in the data set as list data corresponding to the list query instruction, wherein the list data is the optimal list data acquired by the list query instruction which does not carry the designated query condition, so that the quick query of the data is realized, the acquisition time of the list data is greatly reduced particularly when the data magnitude is large, and the acquisition efficiency of the data is improved.
Drawings
In order to more clearly illustrate the solution of the present application, a brief description will be given below of the drawings required for the description of the embodiments of the present application, it being apparent that the drawings in the following description are some embodiments of the present application, and that other drawings may be obtained from these drawings without the exercise of inventive effort for a person of ordinary skill in the art.
FIG. 1 is an exemplary system architecture diagram in which the present application may be applied;
FIG. 2 is a flow chart of one embodiment of a method of acquiring list data in accordance with the present application;
FIG. 3 is a schematic diagram of an embodiment of a tabular data acquisition device according to the present application;
FIG. 4 is a schematic structural diagram of one embodiment of a computer device in accordance with the present application.
Reference numerals: the list data obtaining apparatus 400 includes: an acquisition module 401, a grouping module 402, a confirmation module 403, and an extraction module 404.
Detailed Description
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs; the terminology used in the description of the applications herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "comprising" and "having" and any variations thereof in the description of the application and the claims and the description of the drawings above are intended to cover a non-exclusive inclusion. The terms first, second and the like in the description and in the claims or in the above-described figures, are used for distinguishing between different objects and not necessarily for describing a sequential or chronological order.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments.
In order to make the person skilled in the art better understand the solution of the present application, the technical solution of the embodiment of the present application will be clearly and completely described below with reference to the accompanying drawings.
As shown in fig. 1, a system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used as a medium to provide communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The user may interact with the server 105 via the network 104 using the terminal devices 101, 102, 103 to receive or send messages or the like. Various communication client applications, such as a web browser application, a shopping class application, a search class application, an instant messaging tool, a mailbox client, social platform software, etc., may be installed on the terminal devices 101, 102, 103.
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablet computers, electronic book readers, MP3 players (Moving Picture ExpertsGroup Audio Layer III, dynamic video expert compression standard audio plane 3), MP4 (Moving PictureExperts Group Audio Layer IV, dynamic video expert compression standard audio plane 4) players, laptop and desktop computers, and the like.
The server 105 may be a server providing various services, such as a background server providing support for pages displayed on the terminal devices 101, 102, 103.
It should be noted that, the method for acquiring the list data provided by the embodiment of the present application is generally executed by a server/terminal device, and accordingly, the device for acquiring the list data is generally set in the server/terminal device.
It should be understood that the number of terminal devices, networks and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to fig. 2, a flow chart of one embodiment of a method of acquiring list data according to the present application is shown. The list data acquisition method comprises the following steps:
Step S201, obtaining preset query conditions and priority fields, obtaining corresponding query results according to the query conditions and the priority fields, and combining all the query results corresponding to the query conditions to obtain result set data;
in this embodiment, the preset query conditions are preset query conditions acquired and set in advance according to the current application scenario, and different application scenarios may have different preset query conditions. For example, in the application scene of insurance, the simple query condition in the application scene is obtained by multiplying the application model and the mechanism type. The priority field is the specific field content included in the field category, and the field category includes: list name, list lot number, start-stop time, etc. And according to the query conditions and the priority field query result database, acquiring a query result corresponding to each query condition. The query results are combined to obtain the result set data, wherein the combination is that a plurality of query results are arranged together, and the combination form is not limited.
Step S202, grouping the result set data according to the query conditions to obtain grouping data, obtaining the query grade of the priority field, and sorting the grouping data according to the query grade to obtain sorting data corresponding to the query conditions;
In this embodiment, when the result set data is obtained, the result set data is grouped according to the query condition, that is, each query condition and the query result corresponding to the priority field are stored in a one-to-one group, each query condition may correspond to a plurality of query results, and a plurality of group data are formed by combining the query condition, the priority field and the query results. When the packet data is obtained, obtaining the query levels of the priority fields, wherein different priority fields may have different preset query levels, and according to the query levels, the query results in each packet may be ranked in priority, wherein the higher the query level is, the higher the priority is. And sequencing the query results in each group of data from high to low according to the priority order, and obtaining data, namely sequencing data corresponding to the current query condition.
Step S203, when a list query instruction is received, determining whether the list query instruction carries a specified query condition;
in this embodiment, the list query instruction is a received list data query instruction, where the list query instruction includes two types, one is a list query instruction that does not carry a specified query condition, and the other is a list query instruction that carries a specified query condition. When a list inquiry instruction is received, determining whether the list inquiry instruction carries a specified inquiry condition, wherein the list inquiry instruction and the specified inquiry condition can be bound and sent to an inquirer when the requester sends the list inquiry instruction; when the inquirer receives the list inquiry command, whether the list inquiry command carries a specified inquiry condition or not is determined. If the list query instruction carries the appointed query condition, querying according to the carried appointed query condition; if the list query instruction does not carry the specified query condition, the method indicates that the currently stored query result with the highest priority is directly obtained according to the list query instruction, for example, in the seat mode, the received list query instruction does not carry the specified query condition, and only the optimal list data is required to be queried according to the list query instruction.
Step S204, when the list query instruction does not carry the specified query condition, the first data of each group in the ordered data is combined into a data set, and the first data with the highest priority in the data set is extracted as the list data corresponding to the list query instruction.
In this embodiment, when the list query instruction does not carry a query condition, if in the agent mode, the list query instruction does not carry any query instruction, the first data of each packet in the sorted data is screened, and the first data is the query data with the highest priority in the packet. And combining all the first data into a data set, and sequencing all the first data in the data set according to the priority of each first data, wherein the first data with the highest priority is list data corresponding to the list query instruction. And sending the list data to a requester corresponding to the list inquiry instruction, and removing the list data.
It should be emphasized that, to further ensure the privacy and security of the above-mentioned list data, the above-mentioned list data may also be stored in a node of a blockchain.
The blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm and the like. The Blockchain (Blockchain), which is essentially a decentralised database, is a string of data blocks that are generated by cryptographic means in association, each data block containing a batch of information of network transactions for verifying the validity of the information (anti-counterfeiting) and generating the next block. The blockchain may include a blockchain underlying platform, a platform product services layer, an application services layer, and the like.
The application realizes the rapid inquiry of the data, particularly when the data magnitude is large, greatly reduces the acquisition time of the list data and improves the acquisition efficiency of the data.
In some embodiments of the present application, grouping the result set data according to the query condition to obtain grouping data includes:
taking the query condition as a keyword, and taking the priority field and the query result as keys corresponding to the keyword;
and grouping the result set data based on a preset data structure according to the keywords and the keys to obtain grouping data.
In this embodiment, after the result set data is acquired, the result set data is grouped. Specifically, the query condition is used as a keyword (i.e. key), the priority field and the query result are used as keys corresponding to the keyword, and the structure data set is grouped based on a preset data structure (such as a map data structure). The key words can uniquely identify the associated keys, and each query condition is associated with the corresponding priority field and query result. Specifically, when the result set data is obtained, each query condition is used as a key, namely a keyword, the query result and the priority field corresponding to each query condition are the value corresponding to the key, and each group data can be expressed as a combination form of (key value). In addition, the query results corresponding to the same query condition are not unique, the query condition may be a rough range of query conditions, a plurality of corresponding query results meeting the query condition may exist, the same query condition (key) may have different query results, and the query results of the same query condition (key) are divided into the same group.
The embodiment realizes the grouping of the result set data, so that the data meeting the query condition can be quickly obtained when the data is queried by taking the query condition as an index.
In some embodiments of the present application, the obtaining the query level of the priority field, and the sorting the packet data according to the query level includes:
acquiring preset field types, determining query levels of priority fields in each piece of packet data under different field types, and determining the result priority of a query result in each piece of packet data according to the query levels;
and sorting the query results in each group of data according to the result priority, and obtaining sorting data when all the group of data are sorted.
In this embodiment, since a plurality of query results may be queried under the same query condition, for the packet data under the same query condition, different query results included in the same packet need to be prioritized. Specifically, when the packet data is acquired, the result priority corresponding to each query result under the packet data belonging to a group is acquired, and the result priority is the priority of different query results under the same query condition in the packet data. The result priority can be determined according to the query level of the priority field corresponding to each query result under different field categories, the larger the value of the query level is, the higher the corresponding result priority is, wherein the field categories comprise: the name of the list, the batch number of the list, the start-stop time and the like, the priority field is the specific field content under the category of the field, and the query level of the priority field is determined according to the preset level rule corresponding to each different field category. For example, when the field class is a list batch number, the query level of the priority field under the list batch number is determined according to the number size, and the smaller the number is, the larger the value of the corresponding query level is; and the query grade of the priority field under the name of the list can be graded according to a preset grade rule, for example, the grade corresponding to the name of the list under the first-level organization is highest, and the value of the query grade is larger.
And determining the query grades of the priority fields corresponding to each query result under different field types according to a preset grade rule, and summing the query grades under different field types to obtain the result priority corresponding to each query result. When the result priority corresponding to each query result is obtained, the query results in the same group are ordered according to the order of the result priorities from high to low. And when all the different groups are sequenced, sequencing data corresponding to the current query condition is obtained.
The embodiment realizes the sorting of the data according to the query conditions, so that the data with the highest priority can be quickly and directly obtained when the data is obtained, and the sorting and the re-obtaining of the priority are not needed when all the data are obtained, thereby further improving the efficiency of data obtaining.
In some embodiments of the present application, determining the result priority of the query result in each packet data according to the query level includes:
acquiring a preset initial weight of each field category, wherein the field category comprises a list name, a list batch number and start-stop time;
And obtaining the result priority of the query result in each group of data through weighted summation calculation according to the preset initial weight and the query grade.
In this embodiment, when calculating the result priority of the query result in each packet data, a preset initial weight corresponding to each field class may be obtained in advance, and the result priority of the query result may be calculated according to the preset initial weight and the obtained query level. Specifically, each field category corresponds to different preset initial weights, the preset initial weights of the same field category are multiplied by the corresponding query levels to obtain product results, and then the product results of each query result under different field categories are added to obtain the result priority corresponding to the query result. Wherein, the result priority is represented by a number, and the higher the number is, the higher the corresponding priority is.
For example, for a query result a under a certain query condition, the preset initial weight of the name list is 0.5, the preset initial weight of the batch number of the list is 0.2, and the preset initial weight of the start-stop time is 0.3. The query grade of the query result A under the name of the list in the field category is 2, the query grade under the corresponding list batch number is 1, the query grade under the corresponding start and stop time is 4, and the result priority of the query result A is 2.4 through weighted summation calculation.
The embodiment realizes the accurate calculation of different query results, and further realizes the accurate division of the priority of the query results, so that the result which is most in line with the query conditions can be accurately obtained according to the priority when data acquisition is carried out.
In some embodiments of the present application, after obtaining the ranking data corresponding to the query condition, the method further includes:
when a data adding instruction is received, acquiring a preset timing adding moment;
and when the timing adding moment is reached, adding the newly added query result and the newly added query condition corresponding to the data adding instruction into the sequencing data.
In this embodiment, the timing addition time is an addition polling time specified in a preset timing addition task, and the timing addition task can add the result database at a time of a time period. Therefore, when a data adding instruction is received, a preset timing adding moment is acquired, and when the timing adding moment is reached, a corresponding timing adding task is triggered. And inquiring the currently stored sequencing data according to the timing adding task, and adding the newly added inquiry condition and the newly added inquiry result carried by the data adding instruction into the sequencing data.
The embodiment realizes the new addition processing of the data, and the regular updating and maintenance of the data are further realized by regularly inquiring and adding the ordered data through the regular adding task.
In some embodiments of the present application, after determining whether the list query instruction carries a specified query condition, the method further includes:
and inquiring grouping data comprising the specified query conditions in the sorting data according to the specified query conditions when the list query instruction carries the specified query conditions, and extracting first data in the grouping data as list data corresponding to the list query instruction.
In this embodiment, when the list query instruction carries a specified query condition, all packet data including the specified query condition in the ordering data are obtained according to the specified query condition carried in the list query instruction. And the data of the first query result, namely the first piece of data, is arranged in the grouping data, and is determined to be the list data corresponding to the list query instruction. When the list data is obtained, the list data is sent to a requester corresponding to the list inquiry instruction, and the list data is reserved. In addition, if the corresponding query result cannot be queried according to the designated query condition carried by the list query instruction, the corresponding query failure information is fed back to the requester corresponding to the current list query instruction.
The embodiment realizes the rapid query of the list data when the specified query condition is carried in the list query instruction, and further improves the acquisition efficiency of the list data.
In some embodiments of the present application, after the combining the query results to obtain the result set data, the method further includes:
acquiring a list primary key corresponding to each query condition;
according to the list main key, the query conditions and the priority fields are formed into a data row, and query results corresponding to the query conditions are associated;
and loading the list main key, the query condition, the priority field and the query result into an application memory for storage.
In this embodiment, the list primary key is a list unique identifier column, and each column of data can be identified according to the list primary key. And when the query condition and the priority field are acquired, acquiring a list main key corresponding to the query condition, and combining different query conditions and the priority field into different data rows according to the list main key. And then, associating the combined multiple data rows with the query results corresponding to each query condition, and loading the list main key, the query conditions, the priority field and the query results into an application memory for storage.
The embodiment realizes the storage of the data through the application memory, so that the corresponding data can be obtained more quickly through the application memory when the data is extracted.
Those skilled in the art will appreciate that implementing all or part of the processes of the methods of the embodiments described above may be accomplished by way of computer readable instructions, stored on a computer readable storage medium, which when executed may comprise processes of embodiments of the methods described above. The storage medium may be a nonvolatile storage medium such as a magnetic disk, an optical disk, a Read-Only Memory (ROM), or a random access Memory (Random Access Memory, RAM).
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited in order and may be performed in other orders, unless explicitly stated herein. Moreover, at least some of the steps in the flowcharts of the figures may include a plurality of sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, the order of their execution not necessarily being sequential, but may be performed in turn or alternately with other steps or at least a portion of the other steps or stages.
With further reference to fig. 3, as an implementation of the method shown in fig. 2, the present application provides an embodiment of a list data obtaining apparatus, where an embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 2, and the apparatus may be specifically applied to various electronic devices.
As shown in fig. 3, the list data obtaining apparatus 400 according to the present embodiment includes: an acquisition module 401, a grouping module 402, a confirmation module 403, and an extraction module 404. Wherein:
the obtaining module 401 is configured to obtain preset query conditions and a priority field, obtain corresponding query results according to the query conditions and the priority field, and combine query results corresponding to all the query conditions to obtain result set data;
in this embodiment, the preset query conditions are preset query conditions acquired and set in advance according to the current application scenario, and different application scenarios may have different preset query conditions. For example, in the application scenario of insurance, there are multiple combinations of application models and mechanism types multiplied by a simple query condition in the application scenario. The priority field is the specific field content included in the field category, and the field category includes: list name, list lot number, start-stop time, etc. And according to the query conditions and the priority field query result database, acquiring a query result corresponding to each query condition. The query results are combined to obtain the result set data, wherein the combination is that a plurality of query results are arranged together, and the combination form is not limited.
A grouping module 402, configured to group the result set data according to the query condition to obtain grouping data, obtain a query level of the priority field, and perform sorting processing on the grouping data according to the query level to obtain sorting data corresponding to the query condition;
wherein the grouping module 402 includes:
a first confirmation unit, configured to use the query condition as a keyword, and use the priority field and the query result as keys corresponding to the keyword;
and the grouping unit is used for grouping the result set data based on a preset data structure according to the keywords and the keys to obtain grouping data.
The second confirmation unit is used for acquiring preset field types, determining the query level of the priority field in each piece of packet data under different field types, and determining the result priority of the query result in each piece of packet data according to the query level;
and the sequencing unit is used for sequencing the query result in each group of data according to the result priority, and acquiring sequencing data when all the group of data are sequenced.
Wherein the second confirmation unit further comprises:
The acquisition subunit is used for acquiring preset initial weights of each field category, wherein the field category comprises a list name, a list batch number and start-stop time;
and the calculating subunit is used for obtaining the result priority of the query result in each group of data through weighted summation calculation according to the preset initial weight and the query grade.
In this embodiment, when the result set data is obtained, the result set data is grouped according to the query condition, that is, each query condition and the query result corresponding to the priority field are stored in a one-to-one group, each query condition may correspond to a plurality of query results, and a plurality of group data are formed by combining the query condition, the priority field and the query results. When the packet data is obtained, obtaining the query levels of the priority fields, wherein different priority fields may have different preset query levels, and according to the query levels, the query results in each packet may be ranked in priority, wherein the higher the query level is, the higher the priority is. Sequencing the query results in each group of data from high to low according to the priority order, and obtaining data which is sequencing data corresponding to the current query condition
A confirmation module 403, configured to determine, when a list query instruction is received, whether the list query instruction carries a specified query condition;
in this embodiment, the list query instruction is a received list data query instruction, where the list query instruction includes two types, one is a list query instruction that does not carry a specified query condition, and the other is a list query instruction that carries a specified query condition. When a list inquiry instruction is received, determining whether the list inquiry instruction carries a specified inquiry condition, wherein the list inquiry instruction and the specified inquiry condition can be bound and sent to an inquirer when the requester sends the list inquiry instruction; when the inquirer receives the list inquiry command, whether the list inquiry command carries a specified inquiry condition or not is determined. If the list query instruction carries the appointed query condition, querying according to the carried appointed query condition; if the list query instruction does not carry the specified query condition, the method indicates that the currently stored query result with the highest priority is directly obtained according to the list query instruction, for example, in the seat mode, the received list query instruction does not carry the specified query condition, and only the optimal list data is required to be queried according to the list query instruction.
And the extracting module 404 is configured to combine the first data of each group in the ordered data into a dataset when the list query instruction does not carry the specified query condition, and extract the first data with the highest priority in the dataset as list data corresponding to the list query instruction.
In this embodiment, when the list query instruction does not carry a query condition, if in the agent mode, the list query instruction does not carry any query instruction, the first data of each packet in the sorted data is screened, and the first data is the query data with the highest priority in the packet. And combining all the first data into a data set, and sequencing all the first data in the data set according to the priority of each first data, wherein the first data with the highest priority is list data corresponding to the list query instruction. And sending the list data to a requester corresponding to the list inquiry instruction, and removing the list data.
It should be emphasized that, to further ensure the privacy and security of the above-mentioned list data, the above-mentioned list data may also be stored in a node of a blockchain.
The blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm and the like. The Blockchain (Blockchain), which is essentially a decentralised database, is a string of data blocks that are generated by cryptographic means in association, each data block containing a batch of information of network transactions for verifying the validity of the information (anti-counterfeiting) and generating the next block. The blockchain may include a blockchain underlying platform, a platform product services layer, an application services layer, and the like.
The list data acquisition device in the application further comprises:
the first acquisition sub-module is used for acquiring a preset timing adding moment when receiving a data adding instruction;
and the adding sub-module is used for adding the newly added query result and the newly added query condition corresponding to the data adding instruction into the sequencing data when the timing adding moment is reached.
In this embodiment, the timing addition time is an addition polling time specified in a preset timing addition task, and the timing addition task can add the result database at a time of a time period. Therefore, when a data adding instruction is received, a preset timing adding moment is acquired, and when the timing adding moment is reached, a corresponding timing adding task is triggered. And inquiring the currently stored sequencing data according to the timing adding task, and adding the newly added inquiry condition and the newly added inquiry result carried by the data adding instruction into the sequencing data.
And the extraction sub-module is used for inquiring the grouping data comprising the specified query condition in the sorting data according to the specified query condition when the list query instruction carries the specified query condition, and extracting the first piece of data in the grouping data as list data corresponding to the list query instruction.
In this embodiment, when the list query instruction carries a specified query condition, all packet data including the specified query condition in the ordering data are obtained according to the specified query condition carried in the list query instruction. And the data of the first query result, namely the first piece of data, is arranged in the grouping data, and is determined to be the list data corresponding to the list query instruction. When the list data is obtained, the list data is sent to a requester corresponding to the list inquiry instruction, and the list data is reserved. In addition, if the corresponding query result cannot be queried according to the designated query condition carried by the list query instruction, the corresponding query failure information is fed back to the requester corresponding to the current list query instruction.
The second acquisition sub-module is used for acquiring the list primary key corresponding to each query condition;
the association sub-module is used for forming the query condition and the priority field into a data row according to the list main key and associating a query result corresponding to the query condition;
and the storage sub-module is used for loading the list main key, the query condition, the priority field and the query result into an application memory for storage.
In this embodiment, the list primary key is a list unique identifier column, and each column of data can be identified according to the list primary key. And when the query condition and the priority field are acquired, acquiring a list main key corresponding to the query condition, and combining different query conditions and the priority field into different data rows according to the list main key. And then, associating the combined multiple data rows with the query results corresponding to each query condition, and loading the list main key, the query conditions, the priority field and the query results into an application memory for storage.
The list data acquisition device provided by the application realizes quick inquiry of data, and particularly when the data magnitude is large, the acquisition time of the list data is greatly reduced, and the acquisition efficiency of the data is improved.
In order to solve the technical problems, the embodiment of the application also provides computer equipment. Referring specifically to fig. 4, fig. 4 is a basic structural block diagram of a computer device according to the present embodiment.
The computer device 6 comprises a memory 61, a processor 62, a network interface 63 communicatively connected to each other via a system bus. It is noted that only computer device 6 having components 61-63 is shown in the figures, but it should be understood that not all of the illustrated components are required to be implemented and that more or fewer components may be implemented instead. It will be appreciated by those skilled in the art that the computer device herein is a device capable of automatically performing numerical calculations and/or information processing in accordance with predetermined or stored instructions, the hardware of which includes, but is not limited to, microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASICs), programmable gate arrays (fields-Programmable Gate Array, FPGAs), digital processors (Digital Signal Processor, DSPs), embedded devices, etc.
The computer equipment can be a desktop computer, a notebook computer, a palm computer, a cloud server and other computing equipment. The computer equipment can perform man-machine interaction with a user through a keyboard, a mouse, a remote controller, a touch pad or voice control equipment and the like.
The memory 61 includes at least one type of readable storage media including flash memory, hard disk, multimedia card, card memory (e.g., SD or DX memory, etc.), random Access Memory (RAM), static Random Access Memory (SRAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), programmable Read Only Memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the storage 61 may be an internal storage unit of the computer device 6, such as a hard disk or a memory of the computer device 6. In other embodiments, the memory 61 may also be an external storage device of the computer device 6, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card) or the like, which are provided on the computer device 6. Of course, the memory 61 may also comprise both an internal memory unit of the computer device 6 and an external memory device. In this embodiment, the memory 61 is generally used to store an operating system and various application software installed on the computer device 6, such as computer readable instructions of a list data acquisition method. Further, the memory 61 may be used to temporarily store various types of data that have been output or are to be output.
The processor 62 may be a central processing unit (Central Processing Unit, CPU), controller, microcontroller, microprocessor, or other data processing chip in some embodiments. The processor 62 is typically used to control the overall operation of the computer device 6. In this embodiment, the processor 62 is configured to execute computer readable instructions stored in the memory 61 or process data, such as computer readable instructions for executing the method for acquiring list data.
The network interface 63 may comprise a wireless network interface or a wired network interface, which network interface 63 is typically used for establishing a communication connection between the computer device 6 and other electronic devices.
The computer equipment provided by the application realizes quick inquiry of the data, particularly when the data magnitude is large, the acquisition time of the list data is greatly reduced, and the acquisition efficiency of the data is improved.
The present application also provides another embodiment, namely, a computer-readable storage medium storing computer-readable instructions executable by at least one processor to cause the at least one processor to perform the steps of the method for acquiring list data as described above.
The computer readable storage medium provided by the application realizes quick inquiry of data, and particularly when the data magnitude is large, the acquisition time of list data is greatly reduced, and the acquisition efficiency of the data is improved.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present application.
It is apparent that the above-described embodiments are only some embodiments of the present application, but not all embodiments, and the preferred embodiments of the present application are shown in the drawings, which do not limit the scope of the patent claims. This application may be embodied in many different forms, but rather, embodiments are provided in order to provide a thorough and complete understanding of the present disclosure. Although the application has been described in detail with reference to the foregoing embodiments, it will be apparent to those skilled in the art that modifications may be made to the embodiments described in the foregoing description, or equivalents may be substituted for elements thereof. All equivalent structures made by the content of the specification and the drawings of the application are directly or indirectly applied to other related technical fields, and are also within the scope of the application.

Claims (7)

1. The method for acquiring the list data is characterized by comprising the following steps of:
acquiring preset query conditions and priority fields, acquiring corresponding query results according to the query conditions and the priority fields, and combining all the query results corresponding to the query conditions to obtain result set data;
grouping the result set data according to the query conditions to obtain grouping data, obtaining the query grade of the priority field, and sorting the grouping data according to the query grade to obtain sorting data corresponding to the query conditions;
when receiving a list query instruction, determining whether the list query instruction carries a specified query condition;
when the list query instruction does not carry the specified query condition, combining the first data of each group in the ordered data into a data set, and extracting the first data with the highest priority in the data set as list data corresponding to the list query instruction;
the step of grouping the result set data according to the query condition to obtain grouping data specifically includes:
taking the query condition as a keyword, and taking the priority field and the query result as keys corresponding to the keyword;
Grouping the result set data based on a preset data structure according to the keywords and the keys to obtain grouping data;
the step of obtaining the query level of the priority field and sequencing the packet data according to the query level specifically includes:
acquiring preset field types, determining query levels of priority fields in each piece of packet data under different field types, and determining the result priority of a query result in each piece of packet data according to the query levels;
sorting the query results in each group of data according to the result priority, and obtaining sorting data when all the group of data are sorted;
the step of determining the result priority of the query result in each packet data according to the query level specifically includes:
acquiring a preset initial weight of each field category, wherein the field category comprises a list name, a list batch number and start-stop time;
and obtaining the result priority of the query result in each group of data through weighted summation calculation according to the preset initial weight and the query grade.
2. The method according to claim 1, further comprising, after the step of obtaining ranking data corresponding to the query condition:
when a data adding instruction is received, acquiring a preset timing adding moment;
and when the timing adding moment is reached, adding the newly added query result and the newly added query condition corresponding to the data adding instruction into the sequencing data.
3. The method of claim 1, further comprising, after the step of determining whether the list query instruction carries a specified query condition:
and inquiring grouping data comprising the specified query conditions in the sorting data according to the specified query conditions when the list query instruction carries the specified query conditions, and extracting first data in the grouping data as list data corresponding to the list query instruction.
4. The method according to claim 1, further comprising, after the step of combining query results corresponding to all the query conditions to obtain result set data:
acquiring a list primary key corresponding to each query condition;
According to the list main key, the query conditions and the priority fields are formed into a data row, and query results corresponding to the query conditions are associated;
and loading the list main key, the query condition, the priority field and the query result into an application memory for storage.
5. A listing data obtaining apparatus, characterized by comprising:
the acquisition module is used for acquiring preset query conditions and priority fields, acquiring corresponding query results according to the query conditions and the priority fields, and combining all the query results corresponding to the query conditions to obtain result set data;
the grouping module is used for grouping the result set data according to the query condition to obtain grouping data, and performing sorting processing on the grouping data to obtain sorting data corresponding to the query condition;
the confirmation module is used for determining whether the list query instruction carries a specified query condition or not when receiving the list query instruction;
the extraction module is used for combining the first data of each group in the sequencing data into a data set when the list query instruction does not carry the specified query condition, and extracting the first data with the highest priority in the data set as list data corresponding to the list query instruction;
Wherein the grouping module comprises:
a first confirmation unit, configured to use the query condition as a keyword, and use the priority field and the query result as keys corresponding to the keyword;
the grouping unit is used for grouping the result set data based on a preset data structure according to the keywords and the keys to obtain grouping data;
the second confirmation unit is used for acquiring preset field types, determining the query level of the priority field in each piece of packet data under different field types, and determining the result priority of the query result in each piece of packet data according to the query level;
the sorting unit is used for sorting the query results in each group of data according to the result priority, and obtaining sorting data when all the group of data are sorted;
wherein the second confirmation unit further comprises:
the acquisition subunit is used for acquiring preset initial weights of each field category, wherein the field category comprises a list name, a list batch number and start-stop time;
and the calculating subunit is used for obtaining the result priority of the query result in each group of data through weighted summation calculation according to the preset initial weight and the query grade.
6. A computer device comprising a memory and a processor, the memory having stored therein computer readable instructions which when executed by the processor implement the steps of the method of acquiring roster data of any of claims 1 to 4.
7. A computer readable storage medium having stored thereon computer readable instructions which when executed by a processor implement the steps of the method for acquiring roster data of any of claims 1 to 4.
CN202011052146.2A 2020-09-29 2020-09-29 List data acquisition method, device, computer equipment and storage medium Active CN112182107B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011052146.2A CN112182107B (en) 2020-09-29 2020-09-29 List data acquisition method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011052146.2A CN112182107B (en) 2020-09-29 2020-09-29 List data acquisition method, device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112182107A CN112182107A (en) 2021-01-05
CN112182107B true CN112182107B (en) 2023-11-03

Family

ID=73947260

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011052146.2A Active CN112182107B (en) 2020-09-29 2020-09-29 List data acquisition method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112182107B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023230943A1 (en) * 2022-06-01 2023-12-07 Huawei Technologies Co., Ltd. System and method of data management

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109669986A (en) * 2018-12-12 2019-04-23 深圳乐信软件技术有限公司 Blacklist sharing method, device, equipment and storage medium based on block chain
CN110223159A (en) * 2019-05-22 2019-09-10 深圳壹账通智能科技有限公司 Credit data query method, apparatus, computer equipment and storage medium
CN110457945A (en) * 2019-08-01 2019-11-15 卫盈联信息技术(深圳)有限公司 Method, inquiry method, apparatus, service method, apparatus and the storage medium of list inquiry
CN111680477A (en) * 2020-04-28 2020-09-18 中国平安财产保险股份有限公司 Method and device for exporting spreadsheet file, computer equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11430077B2 (en) * 2019-02-13 2022-08-30 The Toronto-Dominion Bank System and method for searching and monitoring assets available for acquisition

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109669986A (en) * 2018-12-12 2019-04-23 深圳乐信软件技术有限公司 Blacklist sharing method, device, equipment and storage medium based on block chain
CN110223159A (en) * 2019-05-22 2019-09-10 深圳壹账通智能科技有限公司 Credit data query method, apparatus, computer equipment and storage medium
CN110457945A (en) * 2019-08-01 2019-11-15 卫盈联信息技术(深圳)有限公司 Method, inquiry method, apparatus, service method, apparatus and the storage medium of list inquiry
CN111680477A (en) * 2020-04-28 2020-09-18 中国平安财产保险股份有限公司 Method and device for exporting spreadsheet file, computer equipment and storage medium

Also Published As

Publication number Publication date
CN112182107A (en) 2021-01-05

Similar Documents

Publication Publication Date Title
CN112395390B (en) Training corpus generation method of intention recognition model and related equipment thereof
CN110704677B (en) Program recommendation method and device, readable storage medium and terminal equipment
CN111190689B (en) Digital twin system simulation method and device
CN113220734A (en) Course recommendation method and device, computer equipment and storage medium
CN113836131A (en) Big data cleaning method and device, computer equipment and storage medium
CN112860662B (en) Automatic production data blood relationship establishment method, device, computer equipment and storage medium
CN112181835A (en) Automatic testing method and device, computer equipment and storage medium
CN112182107B (en) List data acquisition method, device, computer equipment and storage medium
CN114490756A (en) Generation method and device of association checking model, computer equipment and storage medium
CN112507141B (en) Investigation task generation method, investigation task generation device, computer equipment and storage medium
CN110443441B (en) Rule efficiency monitoring method, device, computer equipment and storage medium
CN116956326A (en) Authority data processing method and device, computer equipment and storage medium
CN116842012A (en) Method, device, equipment and storage medium for storing Redis cluster in fragments
CN113658711B (en) Medical data localization method, device, computer equipment and storage medium
CN112002352B (en) Random music playing method and device, computer equipment and storage medium
CN115378806A (en) Flow distribution method and device, computer equipment and storage medium
CN112084408B (en) List data screening method, device, computer equipment and storage medium
CN114663073B (en) Abnormal node discovery method and related equipment thereof
CN112328960B (en) Optimization method and device for data operation, electronic equipment and storage medium
CN110245146B (en) User identification method and related device
CN117061471A (en) Message pushing method, device, equipment and medium based on user tag
CN112632102A (en) Data query method and device, computer equipment and storage medium
CN116821210A (en) Blacklist query method, blacklist query device, computer equipment and storage medium
CN116402644A (en) Legal supervision method and system based on big data multi-source data fusion analysis
CN117853241A (en) Risk service provider identification method, apparatus, device and storage medium thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant