Data aggregation method and device, electronic device and storage medium
By building dependency views and automatically identifying interfaces and data aggregation relationships, the problems of data aggregation complexity and inefficiency in manual programming in the prior art are solved, and automatic data aggregation and processing are realized, and programming efficiency and data acquisition accuracy are improved.
Patent Information
- Application Number
- CN202310173733.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-23
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2043-02-23
AI Technical Summary
In the prior art, data aggregation is more complex and manual programming is inefficient. Especially in complex interactive scenarios, the front-end needs to manually request multiple interfaces for data aggregation to meet business demands.
By building a dependency view, the view automatically identifies which interfaces and how data should be requested to be aggregated based on multiple fields in multiple interfaces that satisfy the preset protocol and the dependencies existing between each field, and realizes automatic data aggregation and processing.
It solves the problems of data aggregation complexity and inefficiency in manual programming, realizes automatic data aggregation and processing, and improves programming efficiency and data acquisition accuracy.
Smart Images

Figure CN116244365B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing, and in particular to a method and device for data aggregation, an electronic device, and a storage medium. Background Art
[0002] The web side (the web version on the computer side) generally needs to obtain or submit data from the server to render the page or implement interactive feedback with the user; the common division of labor is: the back end is responsible for developing interfaces and connecting to the database; the front end is responsible for developing pages and calling interfaces.
[0003] In complex interaction scenarios, the front end generally needs to manually request multiple interfaces for data aggregation to meet business demands, such as: full product information, which is generally composed of multi-dimensional information such as basic product information, inventory information, pricing information, logistics information, order information, related merchant information, and related purchaser information; and the way to obtain complete information under complex front-end interactions is generally to manually request the above 4 product information interfaces + 2 related interfaces to obtain data and then aggregate the data.
[0004] Therefore, when data from multiple interfaces need to be aggregated to meet feedback needs during business processing, related technologies have problems such as complex data aggregation and low efficiency of manual programming. Summary of the invention
[0005] The present disclosure provides a method and device for data aggregation, an electronic device and a storage medium, so as to at least solve the problems in the related art that data aggregation is relatively complex and manual programming is inefficient.
[0006] According to one aspect of an embodiment of the present disclosure, a method for data aggregation is provided, the method comprising:
[0007] Get the query target statement;
[0008] According to the query target statement and the dependency view, a plurality of dependency fields associated with the to-be-queried field corresponding to the query target statement are acquired, wherein the dependency view is a view constructed according to a plurality of fields in a plurality of interfaces satisfying a preset protocol and the dependency relationships between the respective fields;
[0009] The dependent fields are aggregated to obtain aggregated target fields.
[0010] According to another aspect of an embodiment of the present disclosure, a data aggregation device is also provided, the device comprising:
[0011] A first acquisition module is used to acquire a query target statement;
[0012] A second acquisition module is used to acquire, according to the query target statement and the dependency view, a plurality of dependent fields associated with the to-be-queried field corresponding to the query target statement, wherein the dependency view is a view constructed according to a plurality of fields in a plurality of interfaces satisfying a preset protocol and the dependency relationship between the respective fields;
[0013] The first aggregation module is used to aggregate the dependent fields to obtain an aggregated target field.
[0014] Optionally, the device further comprises:
[0015] A third acquisition module is used to determine the protocol specification of the interface for the field according to the preset protocol before acquiring a plurality of dependent fields associated with the to-be-queried field corresponding to the query target statement according to the query target statement and the dependent view;
[0016] A first determining module, used to determine the dependency relationship according to the protocol provisions;
[0017] The obtaining module is used to obtain the dependency view according to the dependency relationship.
[0018] Optionally, the first determining module includes:
[0019] A definition module, used to define key fields included in the interface according to the protocol provisions;
[0020] An establishing module is used to establish the dependency relationship using the key fields.
[0021] Optionally, the first acquisition module includes:
[0022] A first determining unit, used to determine the field to be queried;
[0023] A second determining unit, configured to determine a corresponding target model according to the field to be queried;
[0024] A first acquisition unit is used to acquire a target level of the cyclic drill-down, wherein a value of the target level is greater than or equal to a preset value;
[0025] A generating unit is used to generate the query target statement according to the field to be queried, the target model and the target level.
[0026] Optionally, the second acquisition module includes:
[0027] A second acquisition unit is used to acquire the dependent field according to the target level and the dependent view when it is determined that the target model where the field to be queried is located has an association relationship with other models, wherein the dependent view contains the association relationship between the target model and other models.
[0028] Optionally, the device further comprises:
[0029] A second determination module, configured to determine a corresponding target model according to the field to be queried after obtaining the query target statement;
[0030] A fourth acquisition module, configured to acquire at least a preset amount of attribute information dependent on the field to be queried in the target model when it is determined that the target model where the field to be queried is located has no association relationship with other models;
[0031] The second aggregation module is used to aggregate the attribute information to obtain the aggregated target field.
[0032] Optionally, the device further comprises:
[0033] A first establishing module, used for establishing a first association relationship between a plurality of the fields and the corresponding interfaces before determining the corresponding target model according to the field to be queried, wherein the field to be queried is included in the field;
[0034] A second establishing module, used for establishing a second association relationship between a plurality of the interfaces and the models to which they belong, wherein the target model is included in the model;
[0035] A third determination module is used to determine a third association relationship between the field and the model according to the second association relationship and the first association relationship.
[0036] According to another aspect of the embodiments of the present disclosure, there is also provided an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; wherein the memory is used to store a computer program; and the processor is used to execute the method steps in any of the above embodiments by running the computer program stored in the memory.
[0037] According to another aspect of the embodiments of the present disclosure, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the method steps in any of the above embodiments when running.
[0038] In the embodiments of the present disclosure, by utilizing multiple fields in multiple interfaces that satisfy a preset protocol and a dependency view constructed by the dependency relationships between the various fields, multiple dependency fields associated with the to-be-queried fields corresponding to the query target statement are aggregated, so as to automatically identify which interfaces should be requested and how the data should be aggregated, thereby realizing automatic data aggregation and processing, thereby solving the problems of complex data aggregation and inefficient manual programming existing in related technologies. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0040] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0041] Figure 1 is a schematic diagram of a hardware environment of a data aggregation method provided according to some embodiments of the present disclosure;
[0042] Figure 2 is a flowchart of a method for data aggregation provided according to some embodiments of the present disclosure;
[0043] Figure 3 is a schematic diagram of an association relationship between interfaces and fields provided according to some embodiments of the present disclosure;
[0044] Figure 4 It is a schematic diagram of associating models using primary keys and foreign keys according to some embodiments of the present disclosure;
[0045] Figure 5 is a structural block diagram of a data aggregation device provided according to some embodiments of the present disclosure;
[0046] Figure 6 It is a structural block diagram of an electronic device provided according to some embodiments of the present disclosure. DETAILED DESCRIPTION
[0047] In order to enable those skilled in the art to better understand the scheme of the present disclosure, the technical scheme in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without creative work should fall within the scope of protection of the present disclosure.
[0048] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.
[0049] According to one aspect of an embodiment of the present disclosure, a method for data aggregation is provided. Optionally, in this embodiment, the method for data aggregation can be applied to Figure 1 In the hardware environment shown in the figure. Figure 1 As shown, the terminal 102 may include a memory 104, a processor 106, and a display 108 (optional component). The terminal 102 may be connected to a server 112 via a network 110 for communication. The server 112 may be used to provide services (such as application services, etc.) for the terminal or a client installed on the terminal. A database 114 may be set on the server 112 or independently of the server 112 to provide data storage services for the server 112. In addition, a processing engine 116 may be running in the server 112, and the processing engine 116 may be used to execute the steps executed by the server 112.
[0050] Optionally, the terminal 102 may be, but is not limited to, a terminal that can calculate data, such as a mobile terminal (e.g., a mobile phone, a tablet computer), a laptop, a PC (Personal Computer), etc. The above network may include, but is not limited to, a wireless network or a wired network. The wireless network includes: Bluetooth, WIFI (Wireless Fidelity) and other networks that implement wireless communication. The above wired network may include, but is not limited to: a wide area network, a metropolitan area network, and a local area network. The above server 112 may include, but is not limited to, any hardware device that can perform calculations.
[0051] In addition, in this embodiment, the above data aggregation method can also be applied to, but not limited to, an independent processing device with a relatively powerful processing capability without data interaction. For example, the processing device can be, but not limited to, a terminal device with a relatively powerful processing capability, that is, each operation in the above data aggregation method can be integrated in an independent processing device. The above is only an example, and this embodiment does not make any limitation to this.
[0052] Optionally, in this embodiment, the above data aggregation method can be executed by the server 112, or by the terminal 102, or by both the server 112 and the terminal 102. The terminal 102 can also execute the data aggregation method of the embodiment of the present disclosure by a client installed thereon.
[0053] Take running on the server as an example, Figure 2 is a flow chart of a method for data aggregation provided according to some embodiments of the present disclosure, such as Figure 2 As shown, the process of the method may include the following steps:
[0054] Step S201, obtaining a query target statement.
[0055] Optionally, in an embodiment of the present disclosure, the user may select or input a query target statement in the terminal, and the server side may then receive the query target statement.
[0056] Step S202, based on the query target statement and the dependent view, obtain multiple dependent fields associated with the to-be-queried fields corresponding to the query target statement, wherein the dependent view is a view constructed based on multiple fields in multiple interfaces that meet the preset protocol and the dependency relationship between the various fields.
[0057] Optionally, the disclosed embodiment can register interfaces according to a defined preset protocol. Specifically, a dependency view is constructed based on multiple fields in multiple interfaces that satisfy the preset protocol and the dependency relationship between the various fields, and then multiple dependent fields associated with the query statement can be found based on the query statement of the target statement and in combination with the dependency view, wherein the dependent field can be understood as the need to access multiple interfaces when obtaining the final result of the query statement. Since each interface can contain multiple fields, the fields that need to be returned together are called dependent fields.
[0058] Step S203, aggregate the dependent fields to obtain the aggregated target fields.
[0059] Optionally, the obtained multiple dependent fields are aggregated, and then the aggregated field is obtained, which is called the target field. It should be noted that the number of dependent fields here should be greater than or equal to 2, so that data aggregation can be achieved.
[0060] In the embodiments of the present disclosure, by utilizing multiple fields in multiple interfaces that satisfy a preset protocol and a dependency view constructed by the dependency relationships between the various fields, multiple dependency fields associated with the to-be-queried fields corresponding to the query target statement are aggregated, so as to automatically identify which interfaces should be requested and how the data should be aggregated, thereby realizing automatic data aggregation and processing, thereby solving the problems of complex data aggregation and inefficient manual programming existing in related technologies.
[0061] As an optional embodiment, before acquiring multiple dependent fields associated with the to-be-queried field corresponding to the query target statement according to the query target statement and the dependent view, the method further includes:
[0062] Determine the protocol specification of the interface pair field according to the preset protocol;
[0063] Determine dependencies according to the agreement;
[0064] Get dependency view based on dependency relationships.
[0065] Optionally, in the disclosed embodiment, the protocol provisions of the interface for the fields can be determined based on a preset protocol set in advance, that is, which fields are defined in which places are all subject to corresponding protocol specification constraints, so the dependency relationship between the fields can be determined according to the protocol provisions, and with this dependency relationship, the dependency view formed between the interfaces can be obtained.
[0066] In the disclosed embodiment, multiple entities are aggregated into a dependent view so as to obtain data on demand.
[0067] As an optional embodiment, determining the dependency relationship according to the protocol specification includes:
[0068] Define the key fields contained in the interface according to the protocol provisions;
[0069] Use key fields to establish dependencies.
[0070] Optionally, in the embodiment of the present disclosure, the protocol specifies which of the multiple fields corresponding to the interface can be defined as key fields, where the key fields can be primary keys and foreign keys. Figure 3 As shown, the relationship between the interface personBase and the fields id, name, and age is indicated by connecting arrows, where the fields id and name are defined as key fields.
[0071] With the key fields defined, you can create Figure 4 The dependency view shown is constructed through primary key and foreign key associations, which in turn establishes the dependency relationship between fields. It is also the dependency relationship between interfaces and the dependency relationship between the models to which the interfaces belong.
[0072] In the disclosed embodiment, the standards and implementations of the interface dependency view constructed based on the key fields in the interface are based on the standards and implementations of the assembly software product based on the matching concept.
[0073] As an optional embodiment, obtaining a query target statement includes:
[0074] Determine the fields to be queried;
[0075] Determine the corresponding target model according to the field to be queried;
[0076] Get the target level of the loop drill-down, where the value of the target level is greater than or equal to the preset value;
[0077] Generate a query target statement based on the fields to be queried, the target model, and the target level.
[0078] Optionally, first, from Figure 4 It can be concluded that Figure 4 It contains 4 models, each model consists of 3 parts from top to bottom: model name, all interfaces contained in the model, and all fields contained in the interface; Figure 4 The dependency relationships among the four models, person, weapon, pet, and house, are formed into dependency views through primary key and foreign key associations and are marked with connecting arrows.
[0079] It should be noted that the foreign key of a model is the primary key of another model. The role of the primary key and foreign key is to realize the automatic association between models. When obtaining fields in models other than the current model, you can access the interfaces of other models based on the dependent view to obtain the desired data fields.
[0080] At this time, after the server obtains the fields to be queried, it obtains the data fields that need to be obtained as declared; then the root view is determined based on the fields to be queried, that is, the target model to which it belongs. For example, when the user selects the fields to be queried, the first field of the fields to be queried is the corresponding target model, for example, when querying personname, person here is the person model.
[0081] After locating the target model, obtain the defined target level for loop drilling, the value of which should be ≥ the preset value, such as 2. The target level for loop drilling is actually the maximum level of the fields that are associated with the fields to be queried, and the optimal value is 2.
[0082] The target model, the field to be queried, and the target level are used together as parameters for generating a query target statement.
[0083] In the disclosed embodiment, by setting the query target statement, the subsequent automatic combination of interfaces through dependent views is achieved to complete automatic data aggregation.
[0084] As an optional embodiment, according to the query target statement and the dependent view, a plurality of dependent fields associated with the to-be-queried field corresponding to the query target statement are obtained, including:
[0085] When it is determined that the target model where the field to be queried is located has an association relationship with other models, the dependent fields are obtained according to the target level and the dependent view, wherein the dependent view includes the association relationship between the target model and other models.
[0086] Optionally, after the query target statement is obtained, determine whether there are other models associated with the target model based on the dependent view, such as Figure 4 As shown, if the target model is the pet model, then the other model associated with the pet model is the person model. According to the determined target hierarchy and dependent view, the dependent fields that have a dependent relationship with the field to be queried are obtained.
[0087] For example, if the query target statement is the age of Zhang San, the owner of the pet Xiaoqiang, and the target level is 3, the field to be queried is personage (as the root view), and its corresponding target model is the person model. At this time, the model found to be associated with the person model is the pet model. The foreign key petName (Xiaoqiang) of the person model is found through the primary key name (Xiaoqiang) of the pet model, and then the primary key name (Zhang San) field of the person model is found, and then the age field in the person model is found. The primary key name field of the pet model and the primary key name field and age field of the person model are used as dependent fields, and data aggregation is performed to return the aggregation result.
[0088] In the disclosed embodiment, a web-based SDK is provided for interface registration and automatic data aggregation, so as to achieve visual management of interfaces and automatic data aggregation.
[0089] As an optional embodiment, after obtaining the query target sentence, the method further includes:
[0090] Determine the corresponding target model according to the field to be queried;
[0091] When it is determined that the target model where the field to be queried is located has no association relationship with other models, obtaining at least a preset amount of attribute information dependent on the field to be queried in the target model;
[0092] Aggregate the attribute information to obtain the aggregated target field.
[0093] Optionally, in an embodiment of the present disclosure, if the target model corresponding to the field to be queried has no association with other models, data aggregation can be achieved by relying only on multiple fields contained in each interface, without relying on views.
[0094] Specifically, when it is determined that the target model where the field to be queried is located has no association relationship with other models, obtain at least a preset amount of attribute information that is dependent on the field to be queried in the target model. For example, to query Zhang San's age, the target model is located as the person model, and then the name field in the personBase interface is found, and then the age field is found, and then the data in the name field and the age field are aggregated to obtain the aggregated target field.
[0095] It should be noted that the number of attribute information dependent on the field to be queried needs to be greater than or equal to the preset number 2, then aggregation is meaningful.
[0096] In the disclosed embodiment, a web-based SDK is provided for interface registration and automatic data aggregation, so as to achieve visual management of interfaces and automatic data aggregation.
[0097] As an optional embodiment, before determining the corresponding target model according to the field to be queried, the method further includes:
[0098] Establishing a first association relationship between a plurality of fields and the interfaces to which they belong, wherein the field to be queried is included in the field;
[0099] Establishing a second association relationship between the plurality of interfaces and the models to which they belong, wherein the target model is included in the model;
[0100] A third association relationship between the field and the model is determined according to the second association relationship and the first association relationship.
[0101] Optionally, from Figure 3 and Figure 4 It can be concluded that each interface can contain multiple fields, and the first association relationship between the interface and the field can be established; each model contains multiple interfaces, and the second association relationship between the interface and the model to which it belongs can be established. With the first and second association relationships, the third association relationship between the field and the model can be derived.
[0102] Since the field to be queried is included in the above multiple fields and the target model is included in the above multiple models, after the field to be queried is obtained, its corresponding target model can also be determined.
[0103] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the present disclosure is not limited by the order of the actions described, because according to the present disclosure, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present disclosure.
[0104] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present disclosure is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product is stored in a storage medium (such as ROM (Read-Only Memory, read-only memory) / RAM (Random Access Memory, random access memory), a disk, an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods of each embodiment of the present disclosure.
[0105] According to another aspect of an embodiment of the present disclosure, a data aggregation device for implementing the above data aggregation method is also provided. Figure 5 is a structural block diagram of a data aggregation device provided according to some embodiments of the present disclosure, such as Figure 5 As shown, the device may include:
[0106] A first acquisition module 501 is used to acquire a query target statement;
[0107] The second acquisition module 502 is used to acquire multiple dependent fields associated with the to-be-queried field corresponding to the query target statement according to the query target statement and the dependent view, wherein the dependent view is a view constructed according to multiple fields in multiple interfaces that meet the preset protocol and the dependency relationship between the various fields;
[0108] The first aggregation module 503 is used to aggregate dependent fields to obtain aggregated target fields.
[0109] It should be noted that the first acquisition module 501 in this embodiment can be used to execute the above step S201, the second acquisition module 502 in this embodiment can be used to execute the above step S202, and the first aggregation module 503 in this embodiment can be used to execute the above step S203.
[0110] Through the above module, multiple fields in multiple interfaces that meet the preset protocol and the dependency view constructed by the dependency relationship between the various fields are utilized to aggregate multiple dependency fields associated with the to-be-queried fields corresponding to the query target statement, so as to automatically identify which interfaces should be requested and how to aggregate the data, realize automatic data aggregation and processing, and thus solve the problems of complex data aggregation and low efficiency of manual programming existing in related technologies.
[0111] As an optional embodiment, the device further includes:
[0112] A third acquisition module is used to determine the protocol specification of the interface for the field according to a preset protocol before acquiring multiple dependent fields associated with the to-be-queried field corresponding to the query target statement according to the query target statement and the dependent view;
[0113] A first determination module, used to determine the dependency relationship according to the protocol provisions;
[0114] Get the module, which is used to get the dependency view based on the dependency relationship.
[0115] As an optional embodiment, the first determining module includes:
[0116] A definition module is used to define key fields included in the interface according to the protocol provisions;
[0117] Create a module for establishing dependencies using key fields.
[0118] As an optional embodiment, the first acquisition module includes:
[0119] A first determining unit, used to determine a field to be queried;
[0120] A second determining unit, used to determine a corresponding target model according to the field to be queried;
[0121] A first acquisition unit is used to acquire a target level of the cyclic drill-down, wherein a value of the target level is greater than or equal to a preset value;
[0122] The generation unit is used to generate a query target statement according to the field to be queried, the target model and the target level.
[0123] As an optional embodiment, the second acquisition module includes:
[0124] The second acquisition unit is used to acquire the dependent field according to the target level and the dependent view when it is determined that the target model where the field to be queried is located has an association relationship with other models, wherein the dependent view includes the association relationship between the target model and other models.
[0125] As an optional embodiment, the device further includes:
[0126] A second determination module is used to determine the corresponding target model according to the field to be queried after obtaining the query target statement;
[0127] A fourth acquisition module, configured to acquire at least a preset amount of attribute information dependent on the field to be queried in the target model when it is determined that the target model where the field to be queried is located has no association relationship with other models;
[0128] The second aggregation module is used to aggregate the attribute information to obtain an aggregated target field.
[0129] As an optional embodiment, the device further includes:
[0130] A first establishing module, used for establishing a first association relationship between a plurality of fields and their corresponding interfaces before determining a corresponding target model according to a field to be queried, wherein the field to be queried is included in the field;
[0131] A second establishing module, used to establish a second association relationship between the plurality of interfaces and the models to which they belong, wherein the target model is included in the model;
[0132] The third determination module is used to determine a third association relationship between the field and the model according to the second association relationship and the first association relationship.
[0133] It should be noted that the examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the contents disclosed in the above embodiments. It should be noted that the above modules as part of the device can be run in Figure 1 In the hardware environment shown, it can be implemented by software or by hardware, wherein the hardware environment includes a network environment.
[0134] According to another aspect of an embodiment of the present disclosure, an electronic device for implementing the above-mentioned data aggregation method is also provided. The electronic device may be a server, a terminal, or a combination thereof.
[0135] Figure 6 is a structural block diagram of an electronic device provided according to some embodiments of the present disclosure, such as Figure 6 As shown, it includes a processor 601, a communication interface 602, a memory 603 and a communication bus 604, wherein the processor 601, the communication interface 602 and the memory 603 communicate with each other through the communication bus 604, wherein,
[0136] Memory 603, used for storing computer programs;
[0137] The processor 601 is used to implement the following steps when executing the computer program stored in the memory 603:
[0138] Get the query target statement;
[0139] According to the query target statement and the dependent view, a plurality of dependent fields associated with the to-be-queried field corresponding to the query target statement are obtained, wherein the dependent view is a view constructed according to a plurality of fields in a plurality of interfaces satisfying a preset protocol and the dependency relationship between the respective fields;
[0140] Aggregate the dependent fields to obtain the aggregated target fields.
[0141] Optionally, in this embodiment, the communication bus may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0142] The communication interface is used for communication between the above electronic device and other devices.
[0143] The memory may include RAM, or may include non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0144] As an example, Figure 6 As shown, the memory 603 may include but is not limited to the first acquisition module 501, the second acquisition module 502, and the aggregation module 503 in the data aggregation device. In addition, other module units in the data aggregation device may also be included but are not limited to, which will not be repeated in this example.
[0145] The above-mentioned processor can be a general-purpose processor, which can include but not be limited to: CPU (Central Processing Unit), NP (Network Processor), etc.; it can also be DSP (Digital Signal Processing), ASIC (Application Specific Integrated Circuit), FPGA (Field-Programmable Gate Array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0146] In addition, the above electronic device also includes: a display for displaying the result of data aggregation.
[0147] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment will not be described in detail here.
[0148] It can be understood by those skilled in the art that Figure 6 The structure shown is for illustration only. The device for implementing the above data aggregation method may be a terminal device, which may be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (Mobile Internet Devices, MID), a PAD, and other terminal devices. Figure 6 It does not limit the structure of the above electronic device. For example, the terminal device may also include Figure 6 More or fewer components (such as network interfaces, display devices, etc.) shown in, or having Figure 6 Different configurations shown.
[0149] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, which can include: a flash drive, ROM, RAM, a magnetic disk or an optical disk, etc.
[0150] According to another aspect of the embodiment of the present disclosure, a storage medium is also provided. Optionally, in this embodiment, the storage medium can be used to execute the program code of the method for data aggregation.
[0151] Optionally, in this embodiment, the storage medium may be located on at least one network device among a plurality of network devices in the network shown in the above embodiment.
[0152] Optionally, in this embodiment, the storage medium is configured to store program codes for executing the following steps:
[0153] Get the query target statement;
[0154] According to the query target statement and the dependent view, a plurality of dependent fields associated with the to-be-queried field corresponding to the query target statement are obtained, wherein the dependent view is a view constructed according to a plurality of fields in a plurality of interfaces satisfying a preset protocol and the dependency relationship between the respective fields;
[0155] Aggregate the dependent fields to obtain the aggregated target fields.
[0156] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, which will not be described in detail in this embodiment.
[0157] Optionally, in this embodiment, the storage medium may include, but is not limited to, various media that can store program codes, such as a USB flash drive, a ROM, a RAM, a mobile hard disk, a magnetic disk, or an optical disk.
[0158] According to another aspect of the embodiments of the present disclosure, a computer program product or a computer program is also provided, which includes computer instructions stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the method steps of data aggregation in any of the above embodiments.
[0159] The serial numbers of the above-mentioned embodiments of the present disclosure are only for description and do not represent the advantages or disadvantages of the embodiments.
[0160] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on this understanding, the technical solution of the present disclosure is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which may be personal computers, servers or network devices, etc.) to perform all or part of the steps of the data aggregation method of each embodiment of the present disclosure.
[0161] In the above embodiments of the present disclosure, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0162] In the several embodiments provided in the present disclosure, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0163] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution provided in this embodiment.
[0164] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0165] The above is only a preferred embodiment of the present disclosure. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present disclosure. These improvements and modifications should also be regarded as the scope of protection of the present disclosure.
Claims
1. A method for data aggregation, characterized in that: The method comprises: Get the query target statement; According to the query target statement and the dependent view, a plurality of dependent fields associated with the field to be queried corresponding to the query target statement are obtained, wherein the dependent view is a view constructed according to a plurality of fields in a plurality of interfaces satisfying a preset protocol and the dependency relationship between the respective fields; the obtaining of the plurality of dependent fields associated with the field to be queried corresponding to the query target statement according to the query target statement and the dependent view comprises: in the case of determining that a target model where the field to be queried is located has an association relationship with other models, obtaining the dependent fields according to the target hierarchy and the dependent view, wherein the dependency relationship between models constitutes the dependent view through primary key and foreign key associations, the dependency view contains the association relationship between the target model and other models, the target hierarchy is the target hierarchy for looping down, and the target hierarchy is the maximum hierarchy for traversing fields that have an association relationship with the field to be queried; The dependent fields are aggregated to obtain aggregated target fields.
2. The method according to claim 1, characterized in that: Before acquiring, according to the query target statement and the dependent view, a plurality of dependent fields associated with the to-be-queried field corresponding to the query target statement, the method further includes: Determining the protocol specification of the interface for the field according to the preset protocol; Determine the dependency relationship in accordance with the provisions of the agreement; The dependency view is obtained according to the dependency relationship.
3. The method according to claim 2, characterized in that The determining the dependency relationship according to the protocol provisions includes: Defining key fields included in the interface according to the protocol provisions; The dependency relationship is established using the key field.
4. The method according to claim 3, characterized in that The obtaining of the query target statement includes: Determine the field to be queried; Determine a corresponding target model according to the field to be queried; Obtaining a target level for cyclic drilling, wherein a value of the target level is greater than or equal to a preset value; The query target statement is generated according to the field to be queried, the target model and the target level.
5. The method according to claim 1, characterized in that After obtaining the query target sentence, the method further includes: Determine a corresponding target model according to the field to be queried; When it is determined that the target model where the field to be queried is located has no association relationship with other models, obtaining at least a preset amount of attribute information dependent on the field to be queried in the target model; The attribute information is aggregated to obtain the aggregated target field.
6. The method according to claim 4 or 5, characterized in that: Before determining the corresponding target model according to the field to be queried, the method further includes: Establishing a first association relationship between a plurality of the fields and the interfaces to which they belong, wherein the field to be queried is included in the field; Establishing a second association relationship between a plurality of the interfaces and the models to which they belong, wherein the target model is included in the model; A third association relationship between the field and the model is determined according to the second association relationship and the first association relationship.
7. A data aggregation device, characterized in that: The device comprises: A first acquisition module is used to acquire a query target statement; A second acquisition module is used to acquire multiple dependent fields associated with the field to be queried corresponding to the query target statement according to the query target statement and the dependent view, wherein the dependent view is a view constructed according to multiple fields in multiple interfaces that meet the preset protocol and the dependency relationship between the various fields; the second acquisition module includes: a second acquisition unit, which is used to acquire the dependent fields according to the target hierarchy and the dependent view when it is determined that the target model where the field to be queried is located has an association relationship with other models, wherein the dependency relationship between the models constitutes the dependent view through primary key and foreign key associations, and the dependent view contains the association relationship between the target model and other models, the target hierarchy is the target hierarchy for cyclic drilling down, and the target hierarchy is the maximum hierarchy for traversing the fields that have an association relationship with the field to be queried; The aggregation module is used to aggregate the dependent fields to obtain the aggregated target fields.
8. An electronic device comprising a processor, a communication interface, a memory and a communication bus, wherein: The processor, the communication interface and the memory communicate with each other via the communication bus, wherein: The memory is used to store computer programs; The processor is configured to execute the method steps of any one of claims 1 to 6 by running the computer program stored in the memory.
9. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program implements the method steps described in any one of claims 1 to 6 when executed by a processor.
Citation Information
Patent Citations
Data aggregation processing method and device thereof, computer equipment and storage medium
CN113986581A
Data query method and device based on artificial intelligence, electronic equipment and medium
CN114969261A