Data query methods, devices, equipment, media and products
By directly calling the data query methods of the backend service through the front-end configuration interface, the bugs caused by the poor skills of the developers were solved, and the accuracy and performance stability of the data query service were improved.
Patent Information
- Application Number
- CN202310031513.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-10
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2043-01-10
AI Technical Summary
In existing technologies, due to the varying programming skills of developers, the code for data query services is prone to bugs, affecting performance and stability.
This paper provides a data query method. Through the front-end query service configuration interface, users can define the mapping relationship between the query conditions and the returned results of the online query service, directly call the back-end message service and table service to generate query messages and database query requests, and realize data query in a visual interface.
This effectively reduced the amount of code development, minimized the impact of bugs on the data query service, and improved the accuracy and performance stability of the data query service.
Smart Images

Figure CN116010682B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the fields of computer, big data, data visualization, and data preprocessing technology, and in particular relates to a data query method and its apparatus, equipment, medium, and product. Background Technology
[0002] With the rapid development of internet businesses, the amount of business data has increased significantly. In order to better analyze the business, it is necessary to query the required data through data query services and then use the queried data to carry out business analysis. Therefore, data query services have become a basic service in internet technology.
[0003] In related technologies, data query services are usually implemented by developers who create code. However, the varying programming skills of developers can lead to bugs in the code, which can negatively impact the performance of the data query service. Summary of the Invention
[0004] This application provides a data query method, apparatus, device, medium, and product that can reduce the impact of bugs in the development code on the data query service and improve the accuracy and performance stability of the data query service.
[0005] In a first aspect, embodiments of this application provide a data query method, the method comprising: responding to a first input to a query service configuration interface of an online query service, defining a first field associated with query conditions of the online query service from a plurality of fields, and configuring at least one second field associated with the return result of the online query service, wherein the first field and at least one second field are mapped, and the at least one second field includes a third field and a fourth field, the third field corresponding to a message service and the fourth field corresponding to a table service; rendering the query interface of the online query service; when first data corresponding to the first field is input into the query interface, generating a query message by calling the message service corresponding to the third field, and generating a database query request by calling the table service corresponding to the fourth field; obtaining query data corresponding to the third field based on the query message, and obtaining query data corresponding to the fourth field based on the database query request, thereby obtaining the return result of the online query service.
[0006] In some possible implementations of the first aspect, prior to responding to the first input to the query service configuration interface of the online query service, the method further includes: in response to the second input to the message service configuration interface, defining request and response messages corresponding to M message services, and configuring field attributes for multiple fields corresponding to each message service; in response to the second input to the table service configuration interface, defining table structures corresponding to N table services, and configuring field attributes for fields in each table structure.
[0007] In some possible implementations of the first aspect, the method further includes: dividing the fields with the same meaning among all fields corresponding to the M message services into the same field set to obtain multiple field sets; defining the primary key and its associated foreign key in the multiple field sets.
[0008] In some possible implementations of the first aspect, the third field includes P1 instances, and the fourth field includes P2 instances. The field attribute configuration includes defining the primary key in each table structure, obtaining the query data corresponding to the third field based on the query message, and obtaining the query data corresponding to the fourth field based on the database query request, to obtain the return result of the online query service. This includes: combining the P1 instances of query data corresponding to the P1 third fields based on the primary key and its associated foreign key in multiple field sets to obtain the first query result; combining the P2 instances of query data corresponding to the P2 fourth fields based on the primary key in each table structure to obtain the second query result; combining the first query result and the second query result through field mapping to obtain the return result of the online query service; and displaying the return result on the query interface of the online query service.
[0009] Among some possible implementations of the first aspect, the method further includes: dividing the message service structure corresponding to each message service into structured or semi-structured data blocks according to the data content category, wherein each data block includes multiple fields.
[0010] In some possible implementations of the first aspect, the third field includes P1 types. After obtaining the query data corresponding to the third field based on the query message and obtaining the query data corresponding to the fourth field based on the database query request, the method further includes: determining the first target field belonging to the same data block among the P1 third fields; and centrally displaying the query data corresponding to the first target field.
[0011] In some possible implementations of the first aspect, after configuring at least one second field associated with the return results of the online query service, the method further includes defining a primary key in the first field and at least one second field.
[0012] Secondly, embodiments of this application provide a data query device, which includes: a configuration module, configured to respond to a first input to a query service configuration interface of an online query service, from...
[0013] Among multiple fields, a first field is defined that is associated with the query conditions of the online query service, and at least one second field is configured that is associated with the return results of the online query service. The first field and the at least one second field have a mapping relationship. The at least one second field includes a third field and a fourth field. The third field corresponds to the message service, and the fourth field corresponds to the table service. A rendering module is used to render the query interface of the online query service. A generation module is also included.
[0014] The module is used to generate a query message by calling the message service corresponding to the third field when the first data corresponding to the first field is entered in the query interface, and to generate a database query request by calling the table service corresponding to the fourth field; the return module is used to obtain the query data corresponding to the third field based on the query message, and to obtain the query data corresponding to the fourth field based on the database query request, so as to obtain the return result of the online query service.
[0015] In some possible implementations of the second aspect, the configuration module is also used to: define request and response messages corresponding to M message services in response to a second input to the message service configuration interface before responding to a first input to the query service configuration interface for the online query service; and configure field attributes for multiple fields corresponding to each message service in response to a second input to the table service configuration interface; and define table structures corresponding to N table services in response to a second input to the table service configuration interface, and configure field attributes for fields in each table structure.
[0016] In some possible implementations of the second aspect, the apparatus further includes: a partitioning module, used to partition fields with the same meaning from all fields corresponding to M message services into the same field set to obtain multiple field sets; and a configuration module, used to define the primary key and its associated foreign key in the multiple field sets.
[0017] In some possible implementations of the second aspect, the third field includes P1 instances, the fourth field includes 5P2 instances, the field attribute configuration includes defining the primary key in each table structure, and the return module includes: a combination unit, used to combine P1 query data corresponding to the P1 third fields based on the primary key and its associated foreign key in multiple field sets to obtain a first query result; a combination unit is also used to combine P2 query data corresponding to the P2 fourth fields based on the primary key in each table structure to obtain a second query result; a combination unit is also used to combine the first query result and the second query result through field mapping to obtain the return result of the online query service; and a display unit is also used to display the return result on the query interface of the online query service.
[0018] In some possible implementations of the second aspect, the apparatus further includes: a splitting module for splitting the message service structure corresponding to each message service into structured or semi-structured data blocks according to data content categories, wherein each data block includes multiple fields.
[0019] In some possible implementations of the second aspect, the third field includes P1 types, and the device further includes: a determining module, used to determine the first target field belonging to the same data block among the P1 third fields after obtaining the query data corresponding to the third field based on the query message and obtaining the query data corresponding to the fourth field based on the database query request; and a display module, used to centrally display the query data corresponding to the first target field.
[0020] In some possible implementations of the second aspect, the configuration module is also used to define the primary key in the first field and at least one second field after configuring at least one second field associated with the return result of the online query service.
[0021] Thirdly, embodiments of this application provide an electronic device, the device including: a processor and a memory storing computer program instructions; the processor, when executing the computer program instructions, implements the steps of the data query method as shown in any embodiment of the first aspect.
[0022] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer program instructions, which, when executed by a processor, implement the steps of the data query method shown in any embodiment of the first aspect.
[0023] Fifthly, embodiments of this application provide a computer program product stored in a non-volatile storage medium, which is executed by at least one processor to implement the steps of the data query method as shown in any embodiment of the first aspect.
[0024] The data query method, apparatus, device, medium, and product of this application embodiment can provide users with a front-end query service configuration interface for online query services in scenarios requiring configuration. Users can configure the online query service through a first input on this interface. Specifically, in response to the first input, a first field associated with the query conditions of the online query service can be defined, and at least one second field associated with the returned results of the online query service can be configured. The first field and at least one second field have a mapping relationship, and the at least one second field includes a third field and a fourth field. The third field corresponds to a message service, and the fourth field corresponds to a table service. Based on this, after the online query service configuration operation is completed, the query interface of the online query service can be rendered, providing users with a visual query service. Specifically, in response to the user's input of the first data corresponding to the first field, a query message is generated by calling the message service corresponding to the third field, and a database query request is generated by calling the table service corresponding to the fourth field. That is, the front-end page is directly linked to the back-end query table service and message service. The query data corresponding to the third field is obtained based on the query message, and the query data corresponding to the fourth field is obtained based on the database query request. This enables data querying through a visual interface and provides the return results of the online query service. Compared to existing technologies that require developers to customize message and table services for specific scenarios, and where the provided data query methods are relatively backend-oriented, making them unusable for users, this application supports a visual query service provided to users through interface configuration. User operations on the front-end interface directly call the back-end message and table services, allowing users to automatically generate code to retrieve and return query data in the context of interface queries. This achieves a data query service based on a visual interface, effectively reducing the amount of code development required for the data query service, mitigating the impact of bugs in the code, and improving the accuracy and performance stability of the data query service. Attached Figure Description
[0025] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0026] Figure 1 This is a schematic flowchart of a data query method provided in an embodiment of this application;
[0027] Figure 2 This is a schematic diagram of the structure of a data query device provided in an embodiment of this application;
[0028] Figure 3 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0029] The features and exemplary embodiments of various aspects of this application will be described in detail below. To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain this application and not to limit it. For those skilled in the art, this application can be implemented without some of these specific details. The following description of the embodiments is merely to provide a better understanding of this application by illustrating examples.
[0030] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes said element.
[0031] First, the technical terms used in this application will be explained accordingly:
[0032] A message is a data unit exchanged and transmitted in a network; it is a block of data that a station sends at one time. A message contains complete data information to be sent, and its length varies greatly, being unlimited and variable.
[0033] Application Programming Interface (API) is a predefined interface (such as a function or the HTTP interface), or a convention for connecting different components of a software system.
[0034] Table services are predefined table interfaces. Essentially, they are tables defined in the database, but they allow the provision of table services through database authorization and other methods. Their structure is generally structured.
[0035] Message services provide data services through messages, and their structure is generally semi-structured.
[0036] With the rapid development of internet businesses, the amount of business data has increased significantly. In order to better analyze the business, it is necessary to query the required data through data query services and then use the queried data to carry out business analysis. Therefore, data query services have become a basic service in internet technology.
[0037] In related technologies, data query services are usually implemented by developers who create code. However, the varying programming skills of developers can lead to bugs in the code, which can negatively impact the performance of the data query service.
[0038] To address the problems in related technologies, this application provides a data query method. In scenarios requiring online query service configuration, a front-end query service configuration interface can be provided to users. Users can configure the online query service through a first input on this interface. Specifically, in response to the first input, a first field associated with the query conditions of the online query service can be defined, and at least one second field associated with the returned results of the online query service can be configured. The first field and at least one second field have a mapping relationship, and the at least one second field includes a third field and a fourth field. The third field corresponds to a message service, and the fourth field corresponds to a table service. Based on this, after the online query service configuration operation is completed, the query interface of the online query service can be rendered, providing users with a visual query service. Specifically, in response to the user's input of the first data corresponding to the first field, a query message is generated by calling the message service corresponding to the third field, and a database query request is generated by calling the table service corresponding to the fourth field. That is, the front-end page is directly linked to the back-end query table service and message service. The query data corresponding to the third field is obtained based on the query message, and the query data corresponding to the fourth field is obtained based on the database query request. This enables data querying through a visual interface and provides the return results of the online query service. Compared to existing technologies that require developers to customize message and table services for specific scenarios, and where the provided data query methods are relatively backend-oriented, making them unusable for users, this application supports a visual query service provided to users through interface configuration. User operations on the front-end interface directly call the back-end message and table services, allowing users to automatically generate code to retrieve and return query data in the context of interface queries. This achieves a data query service based on a visual interface, effectively reducing the amount of code development required for the data query service, mitigating the impact of bugs in the code, and improving the accuracy and performance stability of the data query service.
[0039] The data query method provided in this application will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.
[0040] It should be noted that the acquisition, storage, use, and processing of data in this application embodiment all comply with the relevant provisions of national laws and regulations.
[0041] Figure 1 This is a flowchart illustrating a data query method provided in an embodiment of this application. The executing entity of this data query method can be an electronic device. It should be noted that the aforementioned executing entity does not constitute a limitation on this application.
[0042] Here, the electronic device can be a mobile phone, tablet computer, all-in-one computer or other device with communication function, or it can include a device simulated by a virtual machine or simulator. Of course, it can also include a cloud server or server cluster or other device with storage and computing function.
[0043] For example, the aforementioned electronic device can be a client, through which users can log in to the data query platform and configure query services and perform data queries on the front-end interface provided by the data query platform.
[0044] like Figure 1 As shown, the data query method provided in this application embodiment may include steps 110-140.
[0045] Step 110: In response to the first input to the query service configuration interface of the online query service, define a first field associated with the query conditions of the online query service from multiple fields, and configure at least one second field associated with the returned results of the online query service.
[0046] The first field is mapped to at least one second field, and the at least one second field includes a third field and a fourth field. The third field corresponds to the message service, and the fourth field corresponds to the table service.
[0047] Step 120: Render the query interface for the online query service.
[0048] Step 130: When the first data corresponding to the first field is entered in the query interface, a query message is generated by calling the message service corresponding to the third field, and a database query request is generated by calling the table service corresponding to the fourth field.
[0049] Step 140: Obtain the query data corresponding to the third field based on the query message, and obtain the query data corresponding to the fourth field based on the database query request, to get the return result of the online query service.
[0050] The data query method of this application embodiment, in scenarios requiring online query service configuration, can provide users with a front-end query service configuration interface for the online query service. Users can configure the online query service through a first input on this interface. Specifically, in response to the first input, a first field associated with the query conditions of the online query service can be defined, and at least one second field associated with the returned results of the online query service can be configured. The first field and at least one second field have a mapping relationship, and the at least one second field includes a third field and a fourth field. The third field corresponds to the message service, and the fourth field corresponds to the table service. Based on this, after the online query service configuration operation is completed, the query interface of the online query service can be rendered, providing users with a visual query service. Specifically, in response to the user's input of the first data corresponding to the first field, a query message is generated by calling the message service corresponding to the third field, and a database query request is generated by calling the table service corresponding to the fourth field. That is, the front-end page is directly linked to the back-end query table service and message service. The query data corresponding to the third field is obtained based on the query message, and the query data corresponding to the fourth field is obtained based on the database query request. This enables data querying through a visual interface and provides the return results of the online query service. Compared to existing technologies that require developers to customize message and table services for specific scenarios, and where the provided data query methods are relatively backend-oriented, making them unusable for users, this application supports a visual query service provided to users through interface configuration. User operations on the front-end interface directly call the back-end message and table services, allowing users to automatically generate code to retrieve and return query data in the context of interface queries. This achieves a data query service based on a visual interface, effectively reducing the amount of code development required for the data query service, mitigating the impact of bugs in the code, and improving the accuracy and performance stability of the data query service.
[0051] The specific implementation of the above steps will be described in detail below with reference to specific embodiments.
[0052] In step 110, the first input is used to select a first field from multiple fields and define the first field as an associated field of the query conditions of the online query service, and to select at least one second field from multiple fields and configure the at least one second field as an associated field of the return result of the online query service; the first input can be a selection input for selecting a first field from multiple fields and selecting at least one second field.
[0053] Among them, multiple fields can be all fields corresponding to the message service and the table service. The third field is the field corresponding to the message service, that is, the message data corresponding to the third field needs to be retrieved by the message service. The fourth field is the field corresponding to the table service (i.e., the table field), that is, the message data corresponding to the fourth field needs to be retrieved by the table service.
[0054] For example, the message service includes services A and B, and the table service includes services C and D. Service A is used to query business registration data, service B is used to query enterprise violation data, service C is an enterprise news information table, and service D is an enterprise graph relationship table. The online query service can provide query data services such as enterprise business registration, violations, and related news. The first input can define the first field associated with the query conditions, including the unified social credit code and enterprise name. The second field associated with the returned results can be configured to include the enterprise's registered capital (the third field corresponding to service A), the reason for the enterprise's administrative violation penalty, the department that imposed the administrative violation penalty (the third field corresponding to service B), the enterprise's invested enterprises (the fourth field corresponding to service D), and the enterprise's news (the fourth field corresponding to service C).
[0055] In some embodiments of this application, in order to define and configure the backend table services and message services through the front-end interface configuration, before the first input to the query service configuration interface of the online query service in step 110, the method may further include the following steps: in response to the second input to the message service configuration interface, defining the request messages and response messages corresponding to M message services, and configuring the field attributes of multiple fields corresponding to each message service; in response to the second input to the table service configuration interface, defining the table structures corresponding to N table services, and configuring the field attributes of the fields in each table structure.
[0056] The second input is used to define and configure the message service, and the third input is used to define and configure the table service.
[0057] In one embodiment, the definition parameters of request and response messages may include, but are not limited to: message header structure, message body structure, and API service address; field attribute parameters may include, but are not limited to: message header / message body field name, field description, field format, field length, and whether it is required; the definition parameters of table structure may include, but are not limited to: table name, table description, table fields, and table field order; the field attribute parameters of the fields in the table structure, that is, the table fields, may include, but are not limited to: whether the field can be null, field length, field type, and primary key.
[0058] In some embodiments of this application, after defining the request and response messages corresponding to the M message services and configuring the field attributes of multiple fields corresponding to each message service, the method may further include: dividing the fields with the same meaning among all fields corresponding to the M message services into the same field set to obtain multiple field sets; defining the primary key and its associated foreign key in the multiple field sets.
[0059] Referring to the example above, although services A, B, C, and D query different enterprise information, they generally carry the same enterprise identifiers, such as enterprise name and unified social credit code. These fields with the same meaning have different field definitions in different messages / tables (e.g., name, length, type, etc.). Therefore, it is necessary to associate such fields and define the primary key.
[0060] In some embodiments of this application, after configuring at least one second field associated with the return results of the online query service, the method further includes defining a primary key in the first field and at least one second field.
[0061] Referring to the example above, the first field includes the unified social credit code and the company name, and the second field includes the company's registered capital (the field corresponding to service A), the reason for the company's administrative violation penalty, the department that imposed the administrative violation penalty (the field corresponding to service B), the company's invested companies (the field corresponding to service D), and the company's news (the field corresponding to service C). These five fields can form a field set, so one of the fields can be defined as the primary key, for example, the company name can be defined as the primary key.
[0062] In step 120, the query interface of the online query service is rendered based on the query service configuration corresponding to the first input.
[0063] In step 130, the first data is the data corresponding to the first field. For example, if the first field includes the unified social credit code and the company name, then the first data is the unified social credit code and the company name "XXX Company".
[0064] In step 140, the query data corresponding to the third field is obtained based on the query message, and the query data corresponding to the fourth field is obtained based on the database query request, so as to obtain the return result of the online query service.
[0065] In some embodiments of this application, the third field includes P1 instances, and the fourth field includes P2 instances. The field attribute configuration includes defining the primary key in each table structure, obtaining the query data corresponding to the third field based on the query message, and obtaining the query data corresponding to the fourth field based on the database query request to obtain the return result of the online query service. This includes: combining P1 instances of query data corresponding to the P1 third fields based on the primary key and its associated foreign key in multiple field sets to obtain a first query result; combining P2 instances of query data corresponding to the P2 fourth fields based on the primary key in each table structure to obtain a second query result; combining the first query result and the second query result through field mapping to obtain the return result of the online query service; and displaying the return result on the query interface of the online query service.
[0066] In some embodiments of this application, the method further includes: dividing the message service structure corresponding to each message service into structured or semi-structured data blocks according to the data content category, wherein each data block includes multiple fields.
[0067] For example, if company A queries business registration data, the data content can be divided into multiple structured / semi-structured data blocks, such as basic company information, annual report information, and historical change information; if company B queries violation data, the data content can be divided into multiple structured / semi-structured data blocks, such as administrative violation information and customs violation information.
[0068] In some embodiments of this application, the third field includes P1 fields. After obtaining the query data corresponding to the third field based on the query message and obtaining the query data corresponding to the fourth field based on the database query request, the method further includes: determining the first target field belonging to the same data block among the P1 third fields; and centrally displaying the query data corresponding to the first target field.
[0069] Referring to the example above, the third field includes the company's registered capital, the reason for the company's administrative violation penalty, and the department that imposed the administrative violation penalty. Since the reason for the company's administrative violation penalty and the department that imposed the administrative violation penalty belong to the same data block "Company Administrative Violation Information", the query data corresponding to the reason for the company's administrative violation penalty and the department that imposed the administrative violation penalty can be displayed centrally on the query interface.
[0070] It should be noted that the data query method provided in this application embodiment can be executed by a data query system, or a control module within the data query system used to execute the data query method. This application embodiment uses a data query device executing the data query method as an example to illustrate the data query device provided in this application embodiment. The data query device will be described in detail below.
[0071] Figure 2This is a schematic diagram of the structure of a data query device provided in an embodiment of this application. For example... Figure 2 As shown, the data query device 200 may include: a configuration module 210, a rendering module 220, a generation module 220, and a return module 240.
[0072] The configuration module 210 is used to, in response to a first input to the query service configuration interface of the online query service, define a first field associated with the query conditions of the online query service from multiple fields, and configure at least one second field associated with the return result of the online query service, wherein the first field and the at least one second field have a mapping relationship, and the at least one second field includes a third field and a fourth field, wherein the third field corresponds to a message service and the fourth field corresponds to a table service; the rendering module 220 is used to render the query interface of the online query service; the generation module 230 is used to, when the first data corresponding to the first field is input in the query interface, generate a query message by calling the message service corresponding to the third field, and generate a database query request by calling the table service corresponding to the fourth field; the return module 240 is used to obtain the query data corresponding to the third field based on the query message, and obtain the query data corresponding to the fourth field based on the database query request, and obtain the return result of the online query service.
[0073] In some embodiments of this application, the configuration module 210 is further configured to: before responding to the first input to the query service configuration interface of the online query service, in response to the second input to the message service configuration interface, define the request message and response message corresponding to M message services, and configure the field attributes of multiple fields corresponding to each message service; in response to the second input to the table service configuration interface, define the table structure corresponding to N table services, and configure the field attributes of the fields in each table structure.
[0074] In some embodiments of this application, the apparatus further includes: a partitioning module, used to partition fields with the same meaning from all fields corresponding to M message services into the same field set to obtain multiple field sets; and a configuration module 210, used to define the primary key and its associated foreign key in the multiple field sets.
[0075] In some embodiments of this application, the third field includes P1 instances, the fourth field includes P2 instances, and the field attribute configuration includes defining the primary key in each table structure. The return module 240 includes: a combination unit, used to combine P1 query data corresponding to the P1 third fields based on the primary key and its associated foreign key in multiple field sets to obtain a first query result; a combination unit is also used to combine P2 query data corresponding to the P2 fourth fields based on the primary key in each table structure to obtain a second query result; a combination unit is also used to combine the first query result and the second query result through field mapping to obtain the return result of the online query service; and a display unit is also used to display the return result on the query interface of the online query service.
[0076] In some embodiments of this application, the apparatus further includes: a splitting module, configured to split the message service structure corresponding to each message service into structured or semi-structured data blocks according to the data content category, wherein each data block includes multiple fields.
[0077] In some embodiments of this application, the third field includes P1 types, and the apparatus further includes: a determining module, used to determine the first target field belonging to the same data block among the P1 third fields after obtaining the query data corresponding to the third field based on the query message and obtaining the query data corresponding to the fourth field based on the database query request; and a display module, used to centrally display the query data corresponding to the first target field.
[0078] In some embodiments of this application, the configuration module 210 is further configured to define the primary key in the first field and the at least one second field after configuring at least one second field associated with the return result of the online query service.
[0079] The data query device of this application embodiment, in scenarios requiring online query service configuration, can provide users with a front-end query service configuration interface for the online query service. Users can configure the online query service through a first input on this interface. Specifically, in response to the first input, a first field associated with the query conditions of the online query service can be defined, and at least one second field associated with the returned results of the online query service can be configured. The first field and at least one second field have a mapping relationship, and the at least one second field includes a third field and a fourth field. The third field corresponds to the message service, and the fourth field corresponds to the table service. Based on this, after the online query service configuration operation is completed, the query interface of the online query service can be rendered, providing users with a visual query service. Specifically, in response to the user's input of the first data corresponding to the first field, a query message is generated by calling the message service corresponding to the third field, and a database query request is generated by calling the table service corresponding to the fourth field. That is, the front-end page is directly linked to the back-end query table service and message service. The query data corresponding to the third field is obtained based on the query message, and the query data corresponding to the fourth field is obtained based on the database query request. This enables data querying through a visual interface and provides the return results of the online query service. Compared to existing technologies that require developers to customize message and table services for specific scenarios, and where the provided data query methods are relatively backend-oriented, making them unusable for users, this application supports a visual query service provided to users through interface configuration. User operations on the front-end interface directly call the back-end message and table services, allowing users to automatically generate code to retrieve and return query data in the context of interface queries. This achieves a data query service based on a visual interface, effectively reducing the amount of code development required for the data query service, mitigating the impact of bugs in the code, and improving the accuracy and performance stability of the data query service.
[0080] The data query device in this application embodiment can be a device, or a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. For example, mobile electronic devices can be mobile phones, tablets, laptops, PDAs, in-vehicle electronic devices, wearable devices, ultra-mobile personal computers (UMPCs), netbooks, or personal digital assistants (PDAs), etc., while non-mobile electronic devices can be servers, network attached storage (NAS), personal computers (PCs), televisions (TVs), ATMs, or self-service machines, etc. This application embodiment does not impose specific limitations.
[0081] The data query device in this application embodiment can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit it.
[0082] Figure 3 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application.
[0083] like Figure 3 As shown, the electronic device 300 in this embodiment may include a processor 301 and a memory 302 storing computer program instructions.
[0084] Specifically, the processor 301 may include a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.
[0085] Memory 302 may include mass storage for data or instructions. For example, and not limitingly, memory 302 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 302 may include removable or non-removable (or fixed) media. Where appropriate, memory 302 may be internal or external to the integrated gateway disaster recovery device. In a particular embodiment, memory 302 is non-volatile solid-state memory. Memory may include read-only memory (ROM), random access memory (RAM), disk storage media devices, optical storage media devices, flash memory devices, electrical, optical, or other physical / tangible memory storage devices. Therefore, typically, a memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform operations described with reference to the methods according to embodiments of this application.
[0086] The processor 301 reads and executes computer program instructions stored in the memory 302 to implement any of the data query methods in the above embodiments.
[0087] In one example, the electronic device 300 may also include a communication interface 303 and a bus 310. For example, Figure 3 As shown, the processor 301, memory 302, and communication interface 303 are connected through bus 310 and complete communication with each other.
[0088] The communication interface 303 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.
[0089] Bus 310 includes hardware, software, or both, that couples components of an online data traffic metering device together. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 310 may include one or more buses. Although specific buses are described and illustrated in embodiments of this application, any suitable bus or interconnect is contemplated herein.
[0090] The electronic device provided in this application embodiment is capable of achieving Figure 1 The various processes implemented in the method embodiments can achieve the same technical effect, and will not be described again here to avoid repetition.
[0091] In conjunction with the data query methods described in the above embodiments, this application provides a data query system, which includes the electronic device described in the above embodiments. For details regarding the electronic device, please refer to the relevant descriptions in the above embodiments, which will not be repeated here.
[0092] Furthermore, in conjunction with the data query methods in the above embodiments, this application embodiment can provide a computer-readable storage medium for implementation. This computer-readable storage medium stores computer program instructions; when executed by a processor, these computer program instructions implement the steps of any of the data query methods in the above embodiments.
[0093] Based on the data query methods in the above embodiments, this application embodiment can provide a computer program product to implement them. This (computer) program product is stored in a non-volatile storage medium, and when executed by at least one processor, it implements the steps of any of the data query methods in the above embodiments.
[0094] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.
[0095] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.
[0096] It should also be noted that the exemplary embodiments mentioned in this application describe methods or systems based on a series of steps or apparatus. However, this application is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.
[0097] The aspects of this disclosure have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It should be understood that each block in the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by special-purpose hardware performing the specified functions or actions, or can be implemented by a combination of special-purpose hardware and computer instructions.
[0098] The above description is merely a specific implementation of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application.
Claims
1. A data query method, characterized in that, The method includes: In response to a first input to the query service configuration interface of the online query service, a first field associated with the query conditions of the online query service is defined from multiple fields, and at least one second field associated with the return result of the online query service is configured, wherein the first field and the at least one second field are mapped, and the at least one second field includes a third field and a fourth field, wherein the third field corresponds to the message service and the fourth field corresponds to the table service; Render the query interface of the online query service; When the first data corresponding to the first field is entered into the query interface, a query message is generated by calling the message service corresponding to the third field, and a database query request is generated by calling the table service corresponding to the fourth field. Based on the query message, obtain the query data corresponding to the third field, and based on the database query request, obtain the query data corresponding to the fourth field, and obtain the return result of the online query service; Prior to the first input to the query service configuration interface of the online query service, the method further includes: In response to the second input to the message service configuration interface, the request and response messages corresponding to the M message services are defined, and the field attributes of multiple fields corresponding to each message service are configured. In response to the second input to the table service configuration interface, the table structure corresponding to N table services is defined, and the field attributes of the fields in each table structure are configured. The method further includes: Among all fields corresponding to the M message services, fields with the same meaning are grouped into the same field set to obtain multiple field sets; Define the primary key and its associated foreign key in the set of multiple fields; The third field includes P1 items, the fourth field includes P2 items, the field attribute configuration includes defining the primary key in each of the table structures, obtaining the query data corresponding to the third field based on the query message, and obtaining the query data corresponding to the fourth field based on the database query request to obtain the return result of the online query service, including: Based on the primary key and its associated foreign key in the multiple field sets, P1 query data corresponding to P1 third fields are combined to obtain the first query result; Based on the primary key in each of the table structures, the P2 query data corresponding to the P2 fourth fields are combined to obtain the second query result; By mapping fields, the first query result and the second query result are combined to obtain the return result of the online query service; The returned results are displayed on the query interface of the online query service.
2. The method according to claim 1, characterized in that, The method further includes: According to the data content category, the message service structure corresponding to each message service is split into structured or semi-structured data blocks, wherein each data block includes multiple fields.
3. The method according to claim 2, characterized in that, The third field includes P1 items. After obtaining the query data corresponding to the third field based on the query message and obtaining the query data corresponding to the fourth field based on the database query request, the method further includes: Determine the first target field belonging to the same data block among P1 third fields; Display the query dataset corresponding to the first target field in a centralized manner.
4. The method according to claim 1, characterized in that, After configuring at least one second field associated with the returned results of the online query service, the method further includes: Define the primary key in the first field and the at least one second field.
5. A data query device, characterized in that, The device includes: A configuration module is used to respond to a first input to the query service configuration interface of the online query service, define a first field associated with the query conditions of the online query service from multiple fields, and configure at least one second field associated with the return result of the online query service, wherein the first field and the at least one second field are mapped, and the at least one second field includes a third field and a fourth field, wherein the third field corresponds to the message service and the fourth field corresponds to the table service; The rendering module is used to render the query interface of the online query service; The generation module is used to generate a query message by calling the message service corresponding to the third field and to generate a database query request by calling the table service corresponding to the fourth field when the first data corresponding to the first field is input in the query interface. The return module is used to obtain the query data corresponding to the third field based on the query message, and to obtain the query data corresponding to the fourth field based on the database query request, so as to obtain the return result of the online query service; The configuration module is also used for: Before responding to the first input to the query service configuration interface for the online query service, in response to the second input to the message service configuration interface, request messages and response messages corresponding to M message services are defined, and field attributes are configured for multiple fields corresponding to each message service; in response to the second input to the table service configuration interface, table structures corresponding to N table services are defined, and field attributes are configured for fields in each table structure. The partitioning module is used to partition fields with the same meaning from all fields corresponding to the M message services into the same field set, thereby obtaining multiple field sets; The configuration module is also used to define the primary key and its associated foreign key in the multiple field sets; The third field includes P1 items, the fourth field includes P2 items, the field attribute configuration includes defining the primary key in each of the table structures, and the return module includes: The combination unit is used to combine P1 query data corresponding to P1 third fields based on the primary key and its associated foreign key in the multiple field sets to obtain the first query result; The combination unit is also used to combine P2 query data corresponding to P2 fourth fields based on the primary key in each of the table structures to obtain a second query result; The combination unit is also used to combine the first query result and the second query result through field mapping to obtain the return result of the online query service; The display unit is used to display the returned results on the query interface of the online query service.
6. An electronic device, characterized in that, The device includes: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, it implements the data query method as described in any one of claims 1-4.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer program instructions, which, when executed by a processor, implement the steps of the data query method as described in any one of claims 1-4.
8. A computer program product, characterized in that, The program product is stored in a non-volatile storage medium, and the program product is executed by at least one processor to implement the steps of the data query method as described in any one of claims 1-4.
Citation Information
Patent Citations
Visual data query method and system
CN110059106A
Data query method and device, server and readable storage medium
CN111767303A