CN116340342A - Data filtering method and device, electronic equipment and storage medium - Google Patents

Data filtering method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN116340342A
CN116340342A CN202310284043.6A CN202310284043A CN116340342A CN 116340342 A CN116340342 A CN 116340342A CN 202310284043 A CN202310284043 A CN 202310284043A CN 116340342 A CN116340342 A CN 116340342A
Authority
CN
China
Prior art keywords
data
target
layer object
query
fields
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.)
Pending
Application number
CN202310284043.6A
Other languages
Chinese (zh)
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.)
Beijing Bo Hongyuan Data Polytron Technologies Inc
Original Assignee
Beijing Bo Hongyuan Data Polytron Technologies Inc
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 Beijing Bo Hongyuan Data Polytron Technologies Inc filed Critical Beijing Bo Hongyuan Data Polytron Technologies Inc
Priority to CN202310284043.6A priority Critical patent/CN116340342A/en
Publication of CN116340342A publication Critical patent/CN116340342A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • G06F16/2433Query languages
    • G06F16/2448Query languages for particular applications; for extensibility, e.g. user defined types
    • 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/25Integrating or interfacing systems involving database management systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • 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)
  • Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Software Systems (AREA)
  • Mathematical Physics (AREA)
  • Computational Linguistics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a data filtering method, a data filtering device, electronic equipment and a storage medium. The method comprises the following steps: the interface consumer generates a transmission layer object query language speech segment according to the required multi-level target field, and sends the transmission layer object query language speech segment and a data query request to the interface provider; the interface provider obtains the return data according to the data query request, and sends the return data and the transport layer object query speech segment to a grammar analysis filter; and the grammar analysis filter splits the transport layer object query language speech segment into a plurality of query fields, extracts target data matched with the query fields from the returned data, and returns the target data to the interface consumer. By adopting the technical scheme, the interface consumer can be ensured to quickly and efficiently receive the returned data matched with the required field, thereby saving the transmission bandwidth.

Description

Data filtering method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a data filtering method, a data filtering device, an electronic device, and a storage medium.
Background
In the actual interface network transmission process, the data field returned by the background interface is always larger than the use requirement of the front end, so that unnecessary resource waste is generated.
At present, field filtering is often carried out on data returned by a background interface through GraphQL (graphic data query language). However, the GraphQL grammar is complex, has a long learning curve, and the interface request style does not conform to the Restful (presentation state transformation) style, so that the search engine optimization of the website is not easy. In addition, the configuration of the GraphQL framework is complicated, and for projects designed in the Restful style, the difficulty of reforming the projects by adopting the GraphQL is very large and is equivalent to the need of re-writing a request interface.
Disclosure of Invention
The invention provides a data filtering method, a device, electronic equipment and a storage medium, which can ensure that an interface consumer can quickly and efficiently receive returned data matched with required fields, thereby saving transmission bandwidth.
According to an aspect of the present invention, there is provided a data filtering method, including:
the interface consumer generates a transmission layer object query language speech segment according to the required multi-level target field, and sends the transmission layer object query language speech segment and a data query request to the interface provider;
the interface provider obtains the return data according to the data query request, and sends the return data and the transport layer object query speech segment to a grammar analysis filter;
and the grammar analysis filter splits the transport layer object query language speech segment into a plurality of query fields, extracts target data matched with the query fields from the returned data, and returns the target data to the interface consumer.
According to another aspect of the present invention, there is provided a data filtering apparatus comprising:
the query information sending module is used for generating a transmission layer object query language speech segment by the interface consumer according to the required multi-layer target field and sending the transmission layer object query language speech segment and the data query request to the interface provider;
the data providing module is used for the interface provider to acquire the return data according to the data query request and send the return data and the transmission layer object query language speech segment to the grammar analysis filter;
and the data filtering module is used for splitting the transmission layer object query language speech segment into a plurality of query fields by a grammar analysis filter, extracting target data matched with the query fields from the returned data, and returning the target data to an interface consumer.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the data filtering method according to any one of the embodiments of the present invention.
According to another aspect of the present invention, there is provided a computer readable storage medium storing computer instructions for causing a processor to execute a data filtering method according to any one of the embodiments of the present invention.
According to the technical scheme, the interface consumer generates the transmission layer object query language speech segment according to the field requirement, the transmission layer object query language speech segment and the data query request are sent to the interface provider together, the interface provider returns data according to the data query request, the returned data and the transmission layer object query language speech segment are sent to the grammar analysis filter, the grammar analysis filter obtains the query field required by the interface consumer according to the transmission layer object query language speech segment, the returned data is filtered according to the query field, and the filtered data meeting the field requirement of the interface consumer is fed back to the interface consumer.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a data filtering method according to a first embodiment of the present invention;
FIG. 2 is a flow chart of another data filtering method according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a data filtering device according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device implementing a data filtering method according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
Fig. 1 is a flowchart of a data filtering method according to a first embodiment of the present invention, where the method may be applied to a case where an interface consumption requests data of a specified field from an interface provider, the interface provider sends a full amount of data to a syntax parser for filtering, and the syntax parser feeds back the filtered data of the specified field to the interface consumer. As shown in fig. 1, the method includes:
s110, the interface consumer generates a transmission layer object query language speech segment according to the required multi-layer target field, and sends the transmission layer object query language speech segment and the data query request to the interface provider.
In the actual interface network transmission process, the interface consumer is generally a front-end interface, the interface provider is generally a background interface, the interface consumer can send call information such as a data access request to the interface provider, and the interface provider can return data matched with the data access request to the interface consumer after receiving the data access request, but the interface consumer and the interface provider are not limited to the front-end interface and the background interface, and can also be other interfaces with data processing and exchanging functions.
The invention provides a method for generating a transmission layer object query language, which is characterized in that the transmission layer object query language is a language which has a concise grammar form and can represent hierarchical relations among a plurality of fields, and a transmission layer object query language speech segment is a speech segment generated by an interface consumer according to a required target field and depending on the transmission layer object query language.
The data query request is a request sent by the interface consumer to the interface provider, the data query request can include the data requirement of the interface consumer, the interface provider can return data according to the data requirement of the interface consumer, but the returned data is generally a full data packet, but the full data packet can be filtered by the data filtering method provided by the invention, and the data matched with the fields required by the interface consumer can be screened out and returned to the interface consumer.
In order to realize the transmission of data matched with the required fields to an interface consumer, in the invention, the interface consumer transmits the field requirements to an interface provider in the form of a transmission layer object query language speech segment, the interface provider transmits the return data and the transmission layer object query language speech segment to a grammar analysis filter after acquiring the return data required by the interface consumer, the grammar analysis filter acquires the fields required by the interface consumer by analyzing the transmission layer object query language speech segment, filters the return data according to the fields required by the interface consumer, and finally transmits the filtered return data to the interface consumer.
It will be appreciated that there may be some hierarchical relationship between the multiple target fields required by the interface consumer. For example, the target field may include an id, a username, and a name in a tags list, where id, username, and tags are the same-level target fields and the name in the tags list is the next-level field of tags.
Wherein the transport layer object query speech segment may include a first identifier for separating the target fields and a second identifier for specifying the target field value.
Further, a colon may be included in the second identifier, which may be used to indicate a connection relationship between the target field and a next-level target field matched thereto, and a middle bracket may be used to fill in a next-level target field of the target field, the second identifier supporting multi-level application.
In the previous example, the first identifier may be comma, i.e. ",", and the second identifier may be in the form of ": [] "wherein field information may be filled in brackets. Specifically, in the process of generating the transport layer object query speech segment, for the target field id, username and tags of the same hierarchy, a first identifier may be used to separate the target field id, username and tags, where the first identifier is formed by: "id, username, tags"; for tags with hierarchical relationships and names in the tags list, a second identifier may be used to connect, for example, "tags: [ name ]", and further, the generated transport layer object query speech segment may be "id, username, tags: [ name ]". Further, if the next-stage field a of the name in the tags list also exists in the target field, the second identifier may be used in multiple levels, so that the ": a" may be added after the name in the generated transport layer object query speech segment, and the transport layer object query speech segment may be "id, username, tags: [ name: [ a ] ]).
The advantages of this arrangement are that: compared with GraphQL in the prior art, the grammar of the transport layer object query language provided by the embodiment of the invention is more concise, and the field requirements of the interface consumers can be transmitted on the premise of ensuring that the original interface style is not destroyed.
S120, the interface provider acquires the return data according to the data query request, and sends the return data and the transport layer object query speech segment to the grammar analysis filter.
It can be understood that in the embodiment of the present invention, the interface provider does not have a data filtering function, and after the interface provider obtains the return data according to the data query request sent by the interface consumer, the return data and the speech segment of the transport layer object query speech segment can be sent to the syntax analysis filter together, so that the syntax analysis filter analyzes the obtained query field, thereby filtering the return data.
S130, splitting the transmission layer object query language speech segment into a plurality of query fields by a grammar analysis filter, extracting target data matched with the query fields from the returned data, and returning the target data to the interface consumer.
The query field is a field for filtering returned data by a grammar analysis filter, and can be equivalent to a target field appointed by an interface consumer; the target data is the data after data filtering, meets the field requirements of the interface consumer, and can be directly returned to the interface consumer.
Optionally, when the interface consumer generates the transport layer object query speech segment, a specific identifier may be added before the transport layer object query speech segment, and when the grammar parsing filter parses the specific identifier, the transport layer object query speech segment may be accurately extracted.
Further, the grammar parsing filter can perform identifier removal processing on the transport layer object query speech segment for a plurality of times, and finally obtain a query field which does not contain the first identifier and does not contain the second identifier.
In the previous example, for the transport layer object query language speech segment "id, usernames, tags: [ name ]", the parse filter may split the first identifier first to obtain id, username, tags: [ name ], store the three fields in the list, and traverse the elements in the list after storing, query whether the second identifier exists, i.e. ": [] In this example, "tags: [ name ]", it is further possible to detect whether the first identifier still exists in the middle bracket, if the first identifier does not exist as shown in this example, the "name" is also stored in the list, and if the first identifier exists in the middle bracket, the content in the middle bracket is processed by removing the first identifier and then stored in the list. It should be noted that, after "name" is stored in the list, the "name" may indicate that it is a name in the tags list by specific identification information.
According to the technical scheme, the interface consumer generates the transmission layer object query language speech segment according to the field requirement, the transmission layer object query language speech segment and the data query request are sent to the interface provider together, the interface provider returns data according to the data query request, the returned data and the transmission layer object query language speech segment are sent to the grammar analysis filter, the grammar analysis filter obtains the query field required by the interface consumer according to the transmission layer object query language speech segment, the returned data is filtered according to the query field, and the filtered data meeting the field requirement of the interface consumer is fed back to the interface consumer.
Example two
Fig. 2 is a flowchart of a data filtering method provided in a second embodiment of the present invention, where the method of generating a transport layer object query speech segment by an interface consumer and the method of obtaining a query field by a syntax parsing filter are specifically described based on the above embodiment. As shown in fig. 2, the method includes:
s210, the interface consumer obtains the hierarchical relationship among the target fields.
And S220, the interface consumer connects each target field by using the first identifier and the second identifier according to the hierarchical relation among the target fields, and generates a transmission layer object query speech segment according to the connection result of each target field.
The interface consumer connects each target field by using the first identifier and the second identifier according to the hierarchical relationship between each target field, and generates a transport layer object query speech segment according to the connection result of each target field, which may specifically include:
the interface consumer obtains each level of target fields from the target fields, and obtains the bottom level target fields of each level of target fields according to the hierarchical relationship among the target fields;
the interface consumer separates each level of target fields by using the first identifier, and connects each level of target fields with each bottom level of target fields by using the first identifier and the second identifier;
the interface consumer adds the transport layer object query language identification before each connected target field to generate a transport layer object query language speech segment.
The first-level target field can be understood as a target field of the same hierarchy, no previous-level field of any first-level target field exists in the target fields, each first-level target field can be provided with a plurality of bottom-level target fields, the bottom-level target fields can also have a hierarchy relation, and in the process of generating the transmission layer object query speech segment, the relation between the first-level target field and the bottom-level target field can be expressed in a mode of embedding a second identifier in multiple layers.
Optionally, the transport layer object query language identifier may be used to mark a transport layer object query language speech segment, and when the grammar parser parses the transport layer object query language identifier, the transport layer object query language speech segment may be accurately obtained.
S230, the interface consumer sends the transport layer object query language speech segment and the data query request to the interface provider.
S240, the interface provider obtains the return data according to the data query request, and sends the return data and the transport layer object query speech segment to the grammar analysis filter.
Optionally, the interface provider obtains the return data according to the data query request, and sends the return data and the transport layer object query speech segment to the syntax analysis filter, which may further include:
when no query data matched with the data query request exists in a first interface provider currently receiving the transmission layer object query language speech segment and the data query request, the first interface provider determines a target second interface provider with query data matched with the data query request from a plurality of second interface providers, and forwards the transmission layer object query language speech segment and the data query request to the target second interface provider;
and the target second interface provider acquires the return data according to the data query request and sends the return data and the transport layer object query speech segment to a grammar analysis filter.
The first interface provider can directly perform data transmission with the interface consumer, the second interface provider does not directly perform data transmission with the interface consumer, but the first interface provider and the second interface provider can perform data transmission, and data matched with the data query request exists in the target second interface provider.
S250, extracting a language segment of the transport layer object query language from data sent by the interface provider according to the transport layer object query language identifier by the grammar analysis filter.
S260, splitting and extracting the transport layer object query language segment for multiple times by using the grammar analysis filter until each split field does not comprise the second identifier.
The parsing filter performs multiple splitting extraction on the transport layer object query language segment until each split field does not include the second identifier, which may specifically include:
the grammar analysis filter splits the first identifier of the transport layer object query language segment for the first time, and stores each split first field in a list;
traversing the list, and judging whether a second field containing a second identifier exists in the list;
if yes, splitting each field in brackets of the second field by removing a first identifier, storing each split first field in the list, and traversing the list again;
if not, determining that each field stored in the current list does not include the second identifier.
The first field can be understood as each field obtained after the first identifier is removed from the speech segment of the transport layer object query, and the first field may further include an identifier; the second field may be understood as a field containing a second identifier.
S270, the grammar analysis filter takes the fields obtained through final splitting as query fields, and extracts target data matched with the query fields from the returned data.
S280, the grammar analysis filter returns the target data to the interface consumer.
According to the technical scheme of the embodiment of the invention, through the mode that an interface consumer connects each target field by using the first identifier and the second identifier according to the hierarchical relation among the target fields and generates the transmission layer object query speech segment according to the connection result of each target field, the representation of the required field and the hierarchical relation of each field can be realized by using a simple identifier, the original interface style is met, an interface is not required to be rewritten, and the transmission layer object query speech segment is split and extracted for multiple times by using a grammar analysis filter until the split fields do not comprise the second identifier, so that the query field can be quickly and efficiently acquired, the returned data can be accurately filtered, and the efficiency of data query and data filtering can be improved.
Example III
Fig. 3 is a schematic structural diagram of a data filtering device according to a third embodiment of the present invention. As shown in fig. 3, the apparatus includes: a query information sending module 310, a data providing module 320, and a data filtering module 330.
The query information sending module 310 is configured to generate a transport layer object query speech segment according to the required multi-level target field by the interface consumer, and send the transport layer object query speech segment and the data query request to the interface provider.
The data providing module 320 is configured to obtain the return data according to the data query request by the interface provider, and send the return data and the transport layer object query speech segment to the syntax analysis filter.
The data filtering module 330 is configured to split the transport layer object query speech segment into a plurality of query fields by using a syntax parsing filter, extract target data matching the query fields from the returned data, and return the target data to the interface consumer.
According to the technical scheme, the interface consumer generates the transmission layer object query language speech segment according to the field requirement, the transmission layer object query language speech segment and the data query request are sent to the interface provider together, the interface provider returns data according to the data query request, the returned data and the transmission layer object query language speech segment are sent to the grammar analysis filter, the grammar analysis filter obtains the query field required by the interface consumer according to the transmission layer object query language speech segment, the returned data is filtered according to the query field, and the filtered data meeting the field requirement of the interface consumer is fed back to the interface consumer.
On the basis of the above embodiments, the transport layer object query speech segment includes a first identifier for separating each target field and a second identifier for specifying the value of the target field;
and the second identifier comprises a colon and a bracket, the colon is used for representing the connection relation between the target field and the target field of the next level matched with the colon, the bracket is used for filling in the target field of the next level of the target field, and the second identifier supports multi-level application.
On the basis of the above embodiments, the query information sending module 310 may include:
the hierarchical relation acquisition unit is used for acquiring the hierarchical relation among the target fields by the interface consumer;
and the transmission layer object query language speech segment generating unit is used for connecting each target field by using the first identifier and the second identifier according to the hierarchical relation among the target fields by the interface consumer and generating the transmission layer object query language speech segment according to the connection result of each target field.
On the basis of the above embodiments, the transport layer object query speech segment generating unit may be specifically configured to:
the interface consumer obtains each level of target fields from the target fields, and obtains the bottom level target fields of each level of target fields according to the hierarchical relationship among the target fields;
the interface consumer separates each level of target fields by using the first identifier, and connects each level of target fields with each bottom level of target fields by using the first identifier and the second identifier;
the interface consumer adds the transport layer object query language identification before each connected target field to generate a transport layer object query language speech segment.
Based on the above embodiments, the data filtering module 330 may include:
the grammar analysis filter is used for extracting the transport layer object query language speech segment from the data sent by the interface provider according to the transport layer object query language identifier;
the transmission layer object inquiry language speech segment splitting unit is used for splitting and extracting the transmission layer object inquiry language speech segment for a plurality of times by the grammar analysis filter until each split field does not comprise the second identifier;
and the target data extraction unit is used for using the fields finally obtained by splitting as query fields by the grammar analysis filter and extracting target data matched with the query fields from the returned data.
On the basis of the above embodiments, the transport layer object query speech segment splitting unit may be specifically configured to:
the grammar analysis filter splits the first identifier of the transport layer object query language segment for the first time, and stores each split first field in a list;
traversing the list, and judging whether a second field containing a second identifier exists in the list;
if yes, splitting each field in brackets of the second field by removing a first identifier, storing each split first field in the list, and traversing the list again;
if not, determining that each field stored in the current list does not include the second identifier.
Based on the above embodiments, the data providing module 320 may be further specifically configured to:
when no query data matched with the data query request exists in a first interface provider currently receiving the transmission layer object query language speech segment and the data query request, the first interface provider determines a target second interface provider with query data matched with the data query request from a plurality of second interface providers, and forwards the transmission layer object query language speech segment and the data query request to the target second interface provider;
and the target second interface provider acquires the return data according to the data query request and sends the return data and the transport layer object query speech segment to a grammar analysis filter.
The data filtering device provided by the embodiment of the invention can execute the data filtering method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Example IV
Fig. 4 shows a schematic diagram of the structure of an electronic device 10 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 4, the electronic device 10 includes at least one processor 11, and a memory, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, etc., communicatively connected to the at least one processor 11, in which the memory stores a computer program executable by the at least one processor, and the processor 11 may perform various appropriate actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from the storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 may also be stored. The processor 11, the ROM 12 and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
Various components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, etc.; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as the data filtering method described in embodiments of the present invention. Namely:
the interface consumer generates a transmission layer object query language speech segment according to the required multi-level target field, and sends the transmission layer object query language speech segment and a data query request to the interface provider;
the interface provider obtains the return data according to the data query request, and sends the return data and the transport layer object query speech segment to a grammar analysis filter;
and the grammar analysis filter splits the transport layer object query language speech segment into a plurality of query fields, extracts target data matched with the query fields from the returned data, and returns the target data to the interface consumer.
In some embodiments, the data filtering method may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. One or more of the steps of the data filtering method described above may be performed when the computer program is loaded into RAM 13 and executed by processor 11. Alternatively, in other embodiments, the processor 11 may be configured to perform the data filtering method in any other suitable way (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (10)

1. A method of data filtering, comprising:
the interface consumer generates a transmission layer object query language speech segment according to the required multi-level target field, and sends the transmission layer object query language speech segment and a data query request to the interface provider;
the interface provider obtains the return data according to the data query request, and sends the return data and the transport layer object query speech segment to a grammar analysis filter;
and the grammar analysis filter splits the transport layer object query language speech segment into a plurality of query fields, extracts target data matched with the query fields from the returned data, and returns the target data to the interface consumer.
2. The method of claim 1, wherein the transport layer object query speech segment includes a first identifier for separating target fields and a second identifier for specifying target field values;
and the second identifier comprises a colon and a bracket, the colon is used for representing the connection relation between the target field and the target field of the next level matched with the colon, the bracket is used for filling in the target field of the next level of the target field, and the second identifier supports multi-level application.
3. The method of claim 2, wherein the interface consumer generating the transport layer object query speech segments from the desired multi-level object fields comprises:
the interface consumer obtains the hierarchical relation among all the target fields;
and the interface consumer connects each target field by using the first identifier and the second identifier according to the hierarchical relation among the target fields, and generates a transmission layer object query speech segment according to the connection result of each target field.
4. The method of claim 3, wherein the interfacing consumer connects the target fields using the first identifier and the second identifier according to a hierarchical relationship between the target fields, and generates the transport layer object query speech segment according to a connection result of the target fields, comprising:
the interface consumer obtains each level of target fields from the target fields, and obtains the bottom level target fields of each level of target fields according to the hierarchical relationship among the target fields;
the interface consumer separates each level of target fields by using the first identifier, and connects each level of target fields with each bottom level of target fields by using the first identifier and the second identifier;
the interface consumer adds the transport layer object query language identification before each connected target field to generate a transport layer object query language speech segment.
5. The method of claim 4, wherein the parsing filter splits the transport layer object query speech segment into a plurality of query fields and extracts target data matching the query fields in return data, comprising:
the grammar analysis filter extracts a transport layer object query language speech segment from data sent by the interface provider according to the transport layer object query language identifier;
the grammar analysis filter carries out splitting extraction on the transport layer object query language segment for a plurality of times until each split field does not comprise the second identifier;
and the grammar analysis filter takes the fields obtained by final splitting as query fields, and extracts target data matched with the query fields from the returned data.
6. The method of claim 5, wherein the parsing filter performs a plurality of split extractions on the transport layer object query speech segment until the split fields do not include the second identifier, comprising:
the grammar analysis filter splits the first identifier of the transport layer object query language segment for the first time, and stores each split first field in a list;
traversing the list, and judging whether a second field containing a second identifier exists in the list;
if yes, splitting each field in brackets of the second field by removing a first identifier, storing each split first field in the list, and traversing the list again;
if not, determining that each field stored in the current list does not include the second identifier.
7. The method of claim 1, wherein an interface provider obtains return data according to the data query request and sends the return data and the transport layer object query speech segments to a parse filter, further comprising:
when no query data matched with the data query request exists in a first interface provider currently receiving the transmission layer object query language speech segment and the data query request, the first interface provider determines a target second interface provider with query data matched with the data query request from a plurality of second interface providers, and forwards the transmission layer object query language speech segment and the data query request to the target second interface provider;
and the target second interface provider acquires the return data according to the data query request and sends the return data and the transport layer object query speech segment to a grammar analysis filter.
8. A data filtering apparatus, comprising:
the query information sending module is used for generating a transmission layer object query language speech segment by the interface consumer according to the required multi-layer target field and sending the transmission layer object query language speech segment and the data query request to the interface provider;
the data providing module is used for the interface provider to acquire the return data according to the data query request and send the return data and the transmission layer object query language speech segment to the grammar analysis filter;
and the data filtering module is used for splitting the transmission layer object query language speech segment into a plurality of query fields by a grammar analysis filter, extracting target data matched with the query fields from the returned data, and returning the target data to an interface consumer.
9. An electronic device, the electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the data filtering method of any one of claims 1-7.
10. A computer readable storage medium storing computer instructions for causing a processor to perform the data filtering method of any one of claims 1-7.
CN202310284043.6A 2023-03-22 2023-03-22 Data filtering method and device, electronic equipment and storage medium Pending CN116340342A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310284043.6A CN116340342A (en) 2023-03-22 2023-03-22 Data filtering method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310284043.6A CN116340342A (en) 2023-03-22 2023-03-22 Data filtering method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116340342A true CN116340342A (en) 2023-06-27

Family

ID=86880139

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310284043.6A Pending CN116340342A (en) 2023-03-22 2023-03-22 Data filtering method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116340342A (en)

Similar Documents

Publication Publication Date Title
CN117454817B (en) Engineering processing method and device based on FPGA, electronic equipment and storage medium
CN114816578A (en) Method, device and equipment for generating program configuration file based on configuration table
CN113204695B (en) Website identification method and device
CN117009283A (en) Multi-core multi-chip data processing method, device, chip and storage medium
CN116860751A (en) Data processing method and device, electronic equipment and storage medium
CN116340342A (en) Data filtering method and device, electronic equipment and storage medium
CN116126719A (en) Interface testing method and device, electronic equipment and storage medium
CN115665285A (en) Data processing method and device, electronic equipment and storage medium
CN115599571A (en) Data processing method and device, electronic equipment and storage medium
CN113360407B (en) Function positioning method and device, electronic equipment and readable storage medium
CN115840604B (en) Data processing method, device, electronic equipment and computer readable storage medium
CN117742900B (en) Method, device, equipment and storage medium for constructing service call graph
CN117539840B (en) Log acquisition method, device, equipment and medium
CN113835893B (en) Data processing method, device, equipment, storage medium and program product
CN113726872B (en) Method, device, equipment and medium for filtering promotion information
CN117806604A (en) TLV data analysis method and device based on spring boot frame
CN117093274A (en) Application running stack analysis method, device, equipment and storage medium
CN116225568A (en) Management method, device and equipment of application system interface and storage medium
CN116578801A (en) Page rendering method and device, electronic equipment and storage medium
CN114860312A (en) Mobile terminal adaptation method, device, equipment and medium based on credit business
CN118193577A (en) Data processing method and device, electronic equipment and computer readable storage medium
CN116881368A (en) Data synchronization method and device, electronic equipment and storage medium
CN116069805A (en) Big data analysis method, device, equipment and medium based on pre-event
CN117194553A (en) Relationship diagram display method, device, equipment and storage medium
CN118012936A (en) Data extraction method, device, equipment and storage medium

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