Data query method, electronic device, storage medium and program product
By introducing data query methods into multiple business systems, using a single interface format to interact with the query end, the high query cost problem caused by the multiple interface types when querying data in multiple business systems is solved, and an efficient and low-cost data query process is realized.
Patent Information
- Application Number
- CN202411687033.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-03-04
AI Technical Summary
When performing data queries in multiple different business systems, the query party needs to call multiple different interfaces, resulting in high data queries.
A data query method is proposed, by receiving a first query request including order identification information and storage identification information, generating and sending a second query request to the target data source, receiving and processing query results to generate an order object, and finally feedback the query results. This method interacts with the query end through a single interface format, reducing query cost.
It realizes efficient data queries across multiple business systems without understanding the interface formats of different business systems, reducing query costs and simplifying the query process.
Smart Images

Figure CN119557356A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of computers, and more particularly to a data query method, an electronic device, a readable storage medium, and a computer program product. Background Art
[0002] Data query is a common processing step required in the process of achieving business objectives in business scenarios. The data query party obtains a variety of different data from multiple different data sources by querying data from multiple different business parties, and obtains the desired data results through these data.
[0003] In the related art, different data sources are configured with different types of interfaces, and the querying party interacts with different types of interfaces to query different data, which results in a high query cost for the querying party. Summary of the invention
[0004] The present disclosure provides a data query method, an electronic device, a readable storage medium, and a computer program product.
[0005] The first aspect of the present disclosure proposes a data query method, including: receiving a first query request, the first query request including order identification information and storage identification information, the storage identification information can be used to determine a target data source storing a desired query field, and the interface format of the interface called by different first query requests is the same; generating a second query request including the order identification information; sending the corresponding second query request to the target data source based on the storage identification information; receiving a second query result corresponding to the second query request sent by the target data source, the second query result including the field value of a business field associated with the order identification information in the second query request, the business field including the desired query field; generating an order object based on the second query result to obtain a first query result including the order object, the fields in the order object including at least part of the fields stored in the target data source; and feeding back the first query result.
[0006] According to some embodiments of the present disclosure, the execution entity that generates and issues the first query request is an independent query end, and the feedback object of the first query result is the query end.
[0007] According to some embodiments of the present disclosure, the step of generating the first query request includes: in response to receiving a display indication, displaying a data source identifier of an optional data source and a field identifier of a queryable field contained in the optional data source in a display interface; in response to receiving a selection indication, determining the storage identification information; and generating a first query request including the storage identification information.
[0008] According to some embodiments of the present disclosure, the optional data source includes at least one data module, the queryable field belongs to the at least one data module, the display interface also displays module identification information of the data module included in the optional data source, and the storage identification information includes the module identification information.
[0009] According to some embodiments of the present disclosure, the step of generating the first query request also includes: in response to receiving an input indication, determining the order identification information from the input indication; generating a first query request including the storage identification information, specifically: generating a first query request including the storage identification information and the order identification information.
[0010] According to some embodiments of the present disclosure, the interface formats of the interfaces called by different second query requests are the same, and the input parameters of the interface called by the second query request include a second order identification parameter for representing the order identification information.
[0011] According to some embodiments of the present disclosure, the input parameters of the interface called by the first query request include a first order identification parameter for representing the order identification information and a storage identification parameter for representing the storage identification information, and the data format of the first order identification parameter and / or storage identification parameter is in list form.
[0012] According to some embodiments of the present disclosure, the first query result obtained also includes the order identification information corresponding to the order object.
[0013] According to some embodiments of the present disclosure, generating a second query request including the order identification information includes: determining an interface path and a data structure of a return value that can point to the target data source based on the storage identification information; and requesting the target data source through the interface path through an interface called by the second query request, and sending the second query request to the target data source through the interface called by the second query request.
[0014] According to some embodiments of the present disclosure, the interface called by the second query request is the interface of the data module included in the target data source, and the data structure of the return value is adapted to the field type of the field included in the data module.
[0015] According to some embodiments of the present disclosure, generating an order object based on the second query result includes: creating an empty order object, the order object containing multiple fields; and filling the field values contained in the second query result into corresponding fields of the order object.
[0016] According to some embodiments of the present disclosure, an order object is generated based on the second query result, including: creating a proxy object of the order object, the proxy object being used to report read information when a target field in the order object is read, the read information including information of the read target field, the read information being used to count the number of times the read target field is read; wherein the first query result obtained also includes the proxy object.
[0017] According to some implementations of the present disclosure, the reporting object of the read information is the target data source corresponding to the read target field.
[0018] According to some embodiments of the present disclosure, creating a proxy object for the order object includes: if the order object contains a collection structure, creating a proxy object for the objects in the collection structure.
[0019] A second aspect of the present disclosure proposes an electronic device, comprising: a memory storing execution instructions; and a processor executing the execution instructions stored in the memory, so that the processor executes the method described in any one of the above embodiments.
[0020] A third aspect of the present disclosure provides a readable storage medium, wherein the readable storage medium stores a computer program, and when the computer program is executed by a processor, it is used to implement the method described in any of the above embodiments.
[0021] A fourth aspect of the present disclosure provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it is used to implement the method described in any of the above embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The accompanying drawings illustrate exemplary embodiments of the present disclosure and together with the description serve to explain the principles of the present disclosure. These drawings are included to provide a further understanding of the present disclosure and are incorporated in and constitute a part of this specification.
[0023] Figure 1 A schematic diagram of an application scenario of a data query method according to some embodiments of the present disclosure is shown.
[0024] Figure 2-Figure 6 A schematic diagram of the overall process of a data query method M100 according to some embodiments of the present disclosure is shown.
[0025] Figure 7 It is a schematic block diagram of the structure of an electronic device 1000 equipped with a data query system according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0026] The present disclosure is further described in detail below in conjunction with the accompanying drawings and implementations. It is understood that the specific implementations described herein are only used to explain the relevant content, rather than to limit the present disclosure. It should also be noted that, for ease of description, only the parts related to the present disclosure are shown in the accompanying drawings.
[0027] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments in the present disclosure can be combined with each other. The technical solution of the present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0028] Unless otherwise specified, the exemplary embodiments / embodiments shown will be understood as providing exemplary features of various details of some ways in which the technical concept of the present disclosure can be implemented in practice. Therefore, unless otherwise specified, the features of the various embodiments / embodiments can be combined, separated, interchanged and / or rearranged without departing from the technical concept of the present disclosure.
[0029] The terms used herein are for the purpose of describing specific embodiments, rather than being restrictive. As used herein, unless the context clearly indicates otherwise, the singular forms "one (kind, person)" and "said (the)" are also intended to include plural forms. In addition, when the terms "comprise" and / or "include" and their variations are used in this specification, it is explained that there are stated features, integral bodies, steps, operations, parts, assemblies and / or their groups, but it is not excluded that there are or add one or more other features, integral bodies, steps, operations, parts, assemblies and / or their groups. It should also be noted that, as used herein, the terms "substantially", "approximately" and other similar terms are used as approximate terms and not as degree terms, so that they are used to explain the inherent deviations of the measured values, calculated values and / or provided values that will be recognized by those of ordinary skill in the art.
[0030] In various business scenarios, the querying party has the need to query data from various business parties. Take house decoration as an example. In the entire business process of house decoration, different service providers will intervene at different stages and leave the business process after completing the service at different nodes. The different services provided by the service providers will be managed by different business parties. Therefore, different service data (business data) will be stored in different business systems. These business systems may include customer source systems, sales systems, housing source systems, construction systems, etc. In the business scenario of commission settlement for house decoration, if the commission settlement system wants to settle the service providers involved in the decoration process, it needs to query and obtain data from the above-mentioned multiple business systems.
[0031] In the process of implementing the present invention, the inventors found that with the iteration and optimization of the business system, as well as the expansion and introduction of new businesses, the original business system may be split into multiple different new business systems, which gradually increases the types of business systems and the connection between each business and other businesses gradually becomes more complicated. Different business systems are configured with multiple different types of interfaces, and the querying party may need to call multiple different interfaces of the business system to query different types of data, which makes the cost of data query high.
[0032] To this end, the present disclosure proposes a data query method.
[0033] Figure 1 The following is a schematic diagram showing an application scenario of the data query method of some embodiments of the present disclosure. In this application scenario, a data query system 10, an order service platform 20, a sales project management system 31, a customer source management system 32 and a construction management system 33 may be included. The data query system 10 is the data query party. Figure 1 The scenario shown is equivalent to the query end. The sales project management system 31, customer source management system 32 and construction management system 33 are data providers. Figure 1 The illustrated scenario is equivalent to the business end. The order service platform 20 is used to implement the interaction between the data query party and the data provider.
[0034] The data query system 10 can communicate with the order service platform 20, thereby sending the query request to the order service platform 20. The order service platform 20 can communicate with the sales project management system 31, the customer source management system 32 and the construction management system 33 respectively, thereby realizing data query, and feeding back the queried data to the data query system 10. During the query process, the data query system 10 only interacts with the order service platform 20, and does not need to interact with the sales project management system 31, the customer source management system 32 and the construction management system 33.
[0035] It is understandable that in the business process of house decoration, in addition to Figure 1 In addition to the three business terminals shown in the figure, there may be other independent business systems as business terminals. The query terminal can also be a business system other than the data query system (commission settlement system), and in different scenarios, Figure 1 The business end shown in can also be used as a query end, and the query end can also be used as one of the business ends in some scenarios, and this application does not limit this. In addition, there can be multiple different query ends interacting with the order service platform 20, and each query is implemented through the order service platform 20.
[0036] In the present disclosure, the data query system 10, the order service platform 20, the sales project management system 31, the customer source management system 32 and the construction management system 33 each include at least one processor and at least one memory. In the present disclosure, the "platform" and "system" can be run in different types of electronic devices such as mobile phones, tablet computers, laptops, desktops or servers. The server can be a physical server or a cloud server, and the present disclosure does not limit the type of server.
[0037] For the convenience of description and to make the technical solutions of the specific implementation methods of the present disclosure easier to understand, before describing the data query method implemented by the present disclosure, the technical terms involved in the specific implementation methods of the present disclosure are first introduced.
[0038] Dynamic proxy: is a technology that dynamically creates proxy objects according to the specified interface at runtime. This proxy object implements the same interface as the target object, so it can completely replace the target object to perform the same operations. Through dynamic proxy, you can add additional functions or logic to the target object without modifying the target object code.
[0039] Collection structure: A collection is a container provided by Java that is used to store multiple data. The structure of a collection can be: List, Queue, Set, or Map.
[0040] Figure 2 FIG. 1 is a schematic diagram showing the overall flow of a data query method M100 in some embodiments of the present disclosure. Figure 2 The method shown includes step S110, step S120, step S130 and step S140. The data query method M100 can be executed by a mobile phone, a tablet computer, a desktop computer and the like.
[0041] S110, receiving a first query request. The first query request includes order identification information and storage identification information. The storage identification information can be used to determine a target data source storing a desired query field. The interface format of the interface called by different first query requests is the same.
[0042] The sender and receiver of the first query request may be different independent systems or independent platforms, or different modules belonging to the same system or platform. For example, the sender and receiver of the first query request may be different functional modules in a business system. The sender is the initial initiator of the data query. The user or the control end may initiate the data query through the sender, and browse or obtain the final query result through the sender.
[0043] The order identification information is information that can be used to uniquely identify an order, and the order identification information can be an order number (order ID). When initiating a business data query, the sender of the first query request can obtain the order number of the business data to be queried, and initiate the query with the order number as the query field. The order number is associated with each business data in the order business cycle. For example, the business data in the data form stored in the external data source is associated with the order number or uses the order number as the primary key, so the order number can be used to obtain a variety of business data under the corresponding order.
[0044] There can be one or more data sources. Each data source can be an independent business system, and different business systems are responsible for different businesses. The expected query field is the field to which the business data that the user wants to query belongs. If the expected query fields are distributed and stored in multiple different business systems, there will be multiple target data sources for this query, and accordingly, there will be multiple storage identification information. If the expected query fields are all stored in the same business system, there will be only one target data source for this query, and there can be only one storage identification information. The storage identification information can be the data source ID of the target data source, or it can be the ID of different data modules in the target data source. The content of the data module will be described later.
[0045] The order identification information and the storage identification information may be obtained through user input at the sender, or may be obtained through an external system sending the information to the sender.
[0046] When the sender makes the first query request to the receiver, it calls the receiver's interface. The receiver provides only one type of interface to the sender, that is, the format of the receiver's called interface is the same, that is, the input parameter of the receiver's called interface can include only two parameters, one of which corresponds to the order identification information, and the other parameter corresponds to the storage identification information. The output parameter of the receiver's called interface can include only one parameter, which corresponds to the order object. The sender uses this interface to make the first query request to the receiver each time, which makes it convenient for the sender to query data.
[0047] S120: Generate a second query request including order identification information.
[0048] After receiving the first query request sent by the sender through the interface, the receiver generates a second query request according to the order ID in the first query request. The second query request is used to send to a data source storing business data to implement data query.
[0049] S130: Send a corresponding second query request to the target data source according to the storage identification information.
[0050] The sender does not interact directly with the data source, but the receiver interacts with the data source to implement the query. Before sending the second query request, the corresponding interface of the target data source corresponding to the stored identification information can be determined according to the mapping relationship between the pre-stored data source ID and the interface of the data source (such as the business system), and then the second query request is sent to the corresponding target data source according to the corresponding interface.
[0051] If the first query request contains n order IDs and m data source IDs, n order IDs are sent to each target data source to obtain the corresponding business data of each order ID in each target data source. If there is only 1 order ID and m data source IDs, this order ID is sent to each target data source. If there are only n order IDs and only 1 data source ID, n order IDs are sent to this target data source.
[0052] S140, receiving a second query result corresponding to the second query request from the target data source, wherein the second query result includes a field value of a business field associated with the order identification information in the second query request, and the business field includes an expected query field; After receiving the second query request, the target data source obtains the order ID contained in the second query request, searches its own database with the order ID as the query field, and obtains the business field data associated with the order ID. Since all business fields are associated with the order ID, these business fields will contain the expected query fields. For example, data source a1 contains 30 fields in total, all of which are associated with the order ID. The second query request contains 2 order IDs. Data source a1 reads the data of the corresponding 30 fields of each of the 2 order IDs from the data form stored in itself, and uses these data as the second query result. In the second query result, these data can exist in the form of an object data structure or in the form of other data structures.
[0053] The business data stored in different data sources for the same order ID are different. For example, in data source a1, the business data associated with the order ID may include business fields such as order signing time and order business type; in data source a2, the business data associated with the order ID includes business fields such as order salesperson ID and user ID.
[0054] S150, generating an order object according to the second query result, and obtaining a first query result including the order object, wherein the fields in the order object include at least part of the fields stored in the target data source.
[0055] According to the output parameter format requirements of the called interface of the receiver, after receiving the second query result, the receiver converts the feedback result into the data structure of the order object, thereby obtaining the first query result. In different queries, the quantity and content of the stored identification information are variable, while the data structure of the order object is fixed, so the order object can contain a part of the fields that may be queried and fed back in all data sources, or all the fields.
[0056] S160: Feedback the first query result.
[0057] After obtaining the first query result, the receiver may feed back the first query result as the final query result to the sender. The user may display the first query result through the display screen configured by the sender, or store the first query result through the sender.
[0058] According to the data query method proposed in the embodiment of the present disclosure, the sender uses the same format of interface to make a first query request to the receiver each time. The interface only contains the storage identifier of the order number. The receiver sends the order number to the data source corresponding to the storage identifier for data query. The data source feeds back the queried business data to the receiver. The receiver converts the business data into an order object according to the interface format and provides it to the sender. Therefore, during the query process, the sender does not need to interact with the data source, but interacts and queries with the data source through the receiver. The sender does not need to understand the interface format requirements of different business systems, but only needs to interact with the receiver through a single interface format to realize data query. The receiver and the data source uniformly use the order number for query. In this way, the unified output of order information can be realized, the query cost of the sender is reduced, and the data query of the sender is facilitated.
[0059] Exemplarily, the execution subject that generates and issues the first query request may be an independent query end, and the feedback object of the first query result may also be the query end. Figure 1 The data query system 10 is an independent business system as a query end. The user can initiate a first query request by operating the data query system 10. After the order service platform 20 finally generates an order object and obtains the first query result, it will feed back the first query result to the data query system 10, so that subsequent operations such as commission settlement can be performed.
[0060] Figure 3 FIG. 1 is a schematic diagram showing the overall flow of a data query method M100 in some other embodiments of the present disclosure. Figure 3 The step of generating a first query request may include step S101, step S102 and step S104.
[0061] S101: In response to receiving a display instruction, displaying a data source identifier of an optional data source and a field identifier of a queryable field included in the optional data source in a display interface.
[0062] S102: In response to receiving a selection indication, determine to store identification information.
[0063] S104: Generate a first query request including storage identification information.
[0064] The user can log in to the data query system 10 or log in to a separate query system for data query to initiate a data query. The data query system 10 can store the name and business system ID of each business system (i.e., the optional data source), the name and field ID of the field (i.e., the query field) stored in each business system, and the field meaning and other information. This information matches the name and ID of the field data stored in the business system. Before performing a data query, the user can first make a display instruction to the data query system 10 so that the display screen displays information such as the business system name, business system ID, field name, field ID and field meaning, so that the business data to be queried is stored in which business system.
[0065] Then the user can select the desired query field ID by making a selection instruction to the data query system 10, and the system can automatically determine the corresponding business system ID according to the query field, and then generate the first query request in combination with the pre-set order ID. Alternatively, the user can directly input the desired query field ID to the data query system 10, and the system can generate the first query request in combination with the desired query field ID and the pre-set order ID.
[0066] Continue reading Figure 3 , the step of generating a first query request may further include step S103.
[0067] S103, in response to receiving the input indication, determining the order identification information from the input indication. That is, the order ID may be obtained from the outside or pre-set, or may be obtained through user input. In addition, in step S104, generating a first query request including storage identification information specifically includes: generating a first query request including storage identification information and order identification information.
[0068] The optional data source may include at least one data module. The queryable field may be subordinate to the at least one data module. The display interface may also display module identification information of the data module included in the optional data source. The storage identification information may include module identification information.
[0069] by Figure 1Taking the business end (that is, the optional data source) shown in as an example, the customer source management system 32 may include multiple data modules, such as a customer source portrait module, a customer source query record module, etc. Different modules store different business data and may contain multiple business fields. Before the data query function is officially opened for use, the order service platform 20 and each business end will pre-define the queryable data modules and fields, establish a mapping relationship between the data modules and the fields, so that the platform can identify the module identification information requested by the query end, and enable the platform to identify which field the field value fed back by the business end belongs to.
[0070] The user determines the data module ID to which the desired query field belongs through the display interface of the data query system 10 , and then inputs the data module ID and the order ID into the data query system 10 , thereby generating a first query request.
[0071] The order service platform 20 provides an interface to the data query system 10, and the input parameters include the order ID and the data module ID, and the output parameters include the order ID and the order object. The data query system 10 calls a single type of interface provided by the order service platform 20 to initiate a first query request. After receiving the first query request, the order service platform 20 can first verify the first query request to see if any parameters contained therein are missing. Then, according to the data module ID, the order ID is sent to the business system to which the corresponding data module belongs, and all business field data related to the order ID under the data module is obtained, and then returned to the order service platform 20 as the second query result.
[0072] The interface formats of the interfaces called by different second query requests may be the same. The input parameters of the interface called by the second query request may include a second order identification parameter for representing order identification information.
[0073] In the business system, one data module can correspond to one interface. The order service platform 20 can make a second query request by calling the interface of the data module. The structure of the business system is inherited from the interface constrained by the order service platform 20. The interface of the data module can be constrained to only include the second order identification parameter and the data object, that is, in the second query result returned by the business system to the order service platform 20, the field value of the business field exists in the structure of the data object. The first query result and the second query result both use the data structure of the object to represent the business data, which is convenient for unified storage of business data of various different data types. The protocol layer definition and sub-module constraints can support the business system to maintain the output logic of each module.
[0074] The second order identification parameter and the first order identification parameter are both used to represent the order ID. The difference lies in the different interfaces where the parameters are located. The second order identification parameter is the interface of the data module, and the first order identification parameter is the interface of the order service platform 20.
[0075] The input parameters of the interface called by the first query request may include a first order identification parameter for representing order identification information and a storage identification parameter for representing storage identification information. The data format of the first order identification parameter and / or the storage identification parameter may be in a list form.
[0076] The interface called by the first query request is the interface provided by the order service platform 20 to the data query system 10. The format of the interface is usually composed of only the first order identification parameter (the value is the order ID) and the storage identification parameter (the value is the data module ID).
[0077] The list format is used to support batch input. When a user has multiple order IDs to query, the multiple order IDs included in the first query request will be in list format. When the user's expected query fields are distributed in multiple different data modules, the multiple data module IDs included in the first query request will be in list format.
[0078] Exemplarily, in step S150, the first query result obtained may also include order identification information corresponding to the order object. That is, the output parameter of the interface called by the first query request may include a first order identification parameter in addition to the order object.
[0079] If the first query request contains multiple order IDs, the first query result returned by the platform to the query end will also contain multiple order objects. In order to determine which order ID these order objects correspond to, the first query result will also contain the order ID. In other words, in addition to the order object, the output parameter of the interface called by the first query request can also contain the order ID and the corresponding relationship between the order ID and the order object, so that the data query system 10 knows which order object is the query result of which order ID.
[0080] Figure 4 FIG. 1 is a schematic diagram showing the overall flow of a data query method M100 in some other embodiments of the present disclosure. Figure 4 In step S120, the method of generating a second query request including order identification information may include the following steps S121 and S122.
[0081] S121, determining an interface path capable of pointing to a target data source and a data structure of a return value according to the storage identification information.
[0082] When the storage identification information is a data module ID (module identification information), the interface called by the second query request is the interface of the data module included in the target data source, and the data structure of the return value is compatible with the field type of the field included in the data module.
[0083] The order service platform 20 may pre-store a mapping relationship between the data module ID and the interface information, and determine the interface information, that is, the interface address and the return value structure, in the mapping relationship through the data module ID in the received first query request.
[0084] For interfaces of different data modules, the class structure of the return value may be different. For example, the interface of a data module returns information such as house ID and house address, while the interface of a data module returns information such as service provider name and service provider age. The structure of the returned data objects is different, so the return value structure is determined before making the second query request. The return value structure can be a data structure of object type.
[0085] S122: Request the interface called by the second query request of the target data source through the interface path, and send the second query request to the target data source through the interface called by the second query request.
[0086] After determining the interface path and the return value data structure, the order service platform 20 can perform an http query to request the interface of the data module of the business system. The order service platform 20 then converts the second query result of the business system into an order object defined by the platform.
[0087] This implementation method establishes sub-interface generic constraints based on the characteristics that the business primary key is the order number and each business needs to define core fields, core modules, and data output sub-interfaces. The sub-interface format is restricted by making the order number parameters and return values inherit from the basic model and form an interface template. The sub-interface constraints support a variety of sub-module interfaces, and the interface definitions are clear and the structure is stable. It can maintain hundreds of core fields in the order domain and serve the final unified output. The unified output API supports multiple business systems, and the unified output of the order service platform has provided efficient and simple access query solutions for a variety of businesses.
[0088] Figure 5 FIG. 1 is a schematic diagram showing the overall flow of a data query method M100 in some other embodiments of the present disclosure. Figure 5 In step S150, the method of generating an order object according to the second query result may include the following steps S151 and S152.
[0089] S151, creating an empty order object, wherein the order object contains multiple fields.
[0090] S152: Fill the field values included in the second query result into the corresponding fields of the order object.
[0091] All types of data from all data modules can be defined in the order object, and the data in the return value will be filled into the corresponding fields in the order object. When the same order number is queried from all data modules, all fields in the order object will be filled with field values. Each order number corresponds to an order object. After filling, it can be returned to the data query system 10.
[0092] After the existing fields in the business system are put into operation, there may be new fields, logical adjustments, or field offline. In order to ensure the normal operation of the data query function, the order service platform and the data query system need to be adjusted synchronously. For the data query system, the business system can collect statistics and understand the field query situation of the data query system, so that when the business system needs to make the above-mentioned business data adjustments, it can make better decisions on the business data adjustment method, thereby completing the replacement of its own business data and reducing the adjustment costs of the data query system and the order service platform.
[0093] Based on this, in order to balance the adjustment costs of data iteration and data query in the business system, the usage of the fields in the first query result can be collected and counted, so as to help the business system select the optimal iteration adjustment plan.
[0094] Figure 6 FIG. 1 is a schematic diagram showing the overall flow of a data query method M100 in some other embodiments of the present disclosure. Figure 6 In step S150, the step of generating an order object according to the second query result may further include: creating a proxy object of the order object. The proxy object is used to report read information when the target field in the order object is read, and the read information includes information of the read target field, and the read information is used to count the number of times the read target field is read. Accordingly, the first query result obtained also includes the proxy object.
[0095] The timing for creating a proxy object may be before completing the creation of an empty order object and filling the field values of the order object, or after completing the filling of the field values of the order object.
[0096] Since the order object is a class, it does not have the ability to perform actions. Therefore, you can create a proxy object by adding a Java dynamic proxy to the order object, so that the class has functional logic, thereby realizing the action of automatically reporting information. Since the target class (the class of the order object) needs to implement the interface to perform dynamic proxy, you need to implement the interface of the order object first in the process of adding the dynamic proxy. Then add the logic of reading information reporting in the interface of the object. Declare the function (method) of extracting fields in the interface, implement the method of extracting fields in the interface, and then fill the logic of sending messages into the interface.
[0097] When the order service platform 20 generates the first query result, the order object in the first query result may contain multiple fields of multiple data modules. At this time, each order object in the first query result is dynamically proxied, and the code is functionally enhanced through the dynamic proxy. The enhanced function is that when a field in the order object is read, a message can be automatically sent to the specified location without perception. The message includes the used field and the service that uses the field, thereby realizing the recording of the frequency of use of the field. The message sent can be a Kafka message.
[0098] The reporting object of the read information may be the target data source corresponding to the target field being read, that is, the above-mentioned designated location may be the order service platform 20 or the corresponding business system.
[0099] There may be nested structures in the order object, for example, an order object contains a list instead of just directly listing the fields. In order to use dynamic proxy to proxy specific fields, in step S150, in the process of creating a proxy object of the order object, if the order object contains a collection structure, a proxy object can be created for the objects in the collection structure.
[0100] Each order object may contain the query results of multiple data modules. In the dimension of data modules, you can add a proxy to each field under each data module in the order object. For example, if order object b includes multiple fields under the housing module, you can add a proxy to each field under the housing module. When the user reads the field data in the query result, you can use the getXXX() method to get the data, and then you can activate the message sending logic.
[0101] If the order object contains a collection structure, in addition to directly adding a proxy to the entire order object to implement the proxy for the fields in the sub-level directly belonging to the order object, it is also necessary to add a proxy to the collection structure in the order object. This can implement the proxy for all fields in the order object. For example, for the house object, all house data is in the next level directly under this order object, so when adding a proxy, you can add it directly to the house object, so that each field under the house object can be proxied. For the server object, since the server object contains a list and there are multiple objects in the list, you need to add a proxy to each object in the list.
[0102] After the field usage is forwarded to the server of the order service platform within the proxy logic, the field usage can be displayed in real time through the visual background.
[0103] By adding dynamic proxies to order objects and using Java proxy technology to enhance model objects, we can implement the three-level Model-Interface-Proxy structure, thereby obtaining the usage of business field information. This allows the order service platform to obtain the impact scope when fields are changed, taken offline, or added while maintaining many fields, thus avoiding update lags when the business side maintains permission fields.
[0104] Based on any of the above embodiments, the present disclosure further provides a data query system. The data query system includes an information transceiver module, a query request generation module and an order object generation module. Each of the above modules can be implemented by a computer program module.
[0105] The information transceiver module is used to receive a first query request. The first query request includes order identification information and storage identification information. The storage identification information can be used to determine the target data source storing the desired query field. The interface format of the interface called by different first query requests is the same.
[0106] The query request generating module is used to generate a second query request including order identification information.
[0107] The information transceiver module is also used to send a corresponding second query request to the target data source according to the storage identification information, and receive a second query result corresponding to the second query request sent by the target data source. The second query result includes a field value of a business field associated with the order identification information in the second query request, and the business field includes an expected query field; The order object generation module is used to generate an order object according to the second query result, and obtain a first query result including the order object, wherein the fields in the order object include at least part of the fields stored in the target data source.
[0108] The information transceiver module is also used to feed back the first query result.
[0109] The implementation process of the functions and effects of each module in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, which will not be repeated here.
[0110] See below Figure 1 The data query process in one implementation mode is described. The data query process involves a query end, a service platform and at least one business end.
[0111] The query end is used to generate a first query request containing order identification information and storage identification information, and send the first query request to the service platform, wherein the storage identification information can be used to determine the target business end that stores the expected query field, and the interface format of the interface called by different first query requests is the same.
[0112] The service platform is used to receive the first query request, generate a second query request containing order identification information, and send the corresponding second query request to the business end according to the storage identification information.
[0113] The business end is used to receive the second query request, obtain the field value of the business field associated with the order identification information in the second query request from its own stored data, and feedback the second query result containing the field value to the service platform, wherein the business field includes the expected query field.
[0114] The service platform is also used to receive a second query result sent by the business end, generate an order object based on the second query result, obtain a first query result including the order object, and feedback the first query result to the query end, wherein the fillable fields in the order object include at least part of the fields existing in at least one business end.
[0115] Exemplarily, the service platform can also be used to create a proxy object of the order object before obtaining the first query result including the order object, and the first query result obtained by the service platform also includes the proxy object. After receiving the first query result sent by the service platform, the query end reports the read information in response to reading the target field from the first query result, wherein the read information includes the information of the read target field, and the read information is used to count the number of times the read target field is read.
[0116] The execution subject of the data query method in the specific implementation manner of the present disclosure may be an electronic device such as a mobile phone, a tablet computer, or a server.
[0117] Therefore, based on any of the above embodiments, the present disclosure further provides an electronic device, which can execute the data query method of any of the above embodiments of the present disclosure, and the data query system of any of the above embodiments can be configured on the electronic device.
[0118] Figure 7 FIG. 1 is a schematic block diagram of an electronic device 1000 equipped with a data query system according to an embodiment of the present disclosure. Figure 7 The data query system includes an information transceiver module 1002, a query request generation module 1004 and an order object generation module 1006. The implementation process of the functions and effects of each of the above modules is specifically described in the implementation process of the corresponding steps in the above method, which will not be repeated here.
[0119] The hardware structure of the electronic device 1000 can be implemented using a bus architecture. The bus architecture can include any number of interconnected buses and bridges, depending on the specific application and overall design constraints of the hardware. The bus 1100 connects various circuits including one or more processors 1200, memory 1300 and / or hardware modules together. The bus 1100 can also connect various other circuits 1400 such as peripherals, voltage regulators, power management circuits, external antennas, etc.
[0120] The bus 1100 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Component (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the figure only uses one connecting line, but does not mean that there is only one bus or one type of bus.
[0121] The processor 1200 may be a central processing unit (CPU). The processor 1200 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or a combination of the above chips.
[0122] The memory 1300 can be used as a non-transitory computer-readable storage medium, and can be used to store non-transitory software programs, non-transitory computer executable programs and modules, such as program instructions of the computer program in the embodiment of the present disclosure. The processor 1200 implements the data query method by running the non-transitory software programs, instructions and modules stored in the memory 1300.
[0123] The memory 1300 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required by at least one function; the data storage area may store data created by the processor 1200, such as structural data, model data, sample data, stiffness evaluation results, etc. of the bridge. In addition, the memory 1300 may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one disk storage device, a flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory 1300 may optionally include a memory remotely arranged relative to the processor 1200, and these remote memories may be connected to the processor 1200 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0124] The present disclosure also provides a readable storage medium, in which a computer program is stored, and the computer program is used to implement the above method when executed by a processor. "Readable storage medium" can be any device that can contain, store, communicate, propagate or transmit a program for use in an instruction execution system, device or equipment or in combination with these instruction execution systems, devices or equipment. More specific examples of readable storage media include the following: an electrical connection portion (electronic device) with one or more wirings, a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and editable read-only memory (EPROM or flash memory), an optical fiber device, and a portable read-only memory (CDROM), etc.
[0125] The present disclosure also provides a computer program product, and the method of the present disclosure can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instruction is loaded and executed, the process or function of the present disclosure is executed in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user device, a core network device, an OAM or other programmable device.
[0126] The computer program or instructions may be stored in a readable storage medium or transmitted from one readable storage medium to another readable storage medium, for example, the computer program or instructions may be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired or wireless means. The readable storage medium may be any available medium that can be accessed or a data storage device such as a server, data center, etc. that integrates one or more available media. The available medium may be a magnetic medium, such as a floppy disk, a hard disk, or a magnetic tape; it may also be an optical medium, such as a digital video disk; it may also be a semiconductor medium, such as a solid state drive. The computer readable storage medium may be a volatile or non-volatile storage medium, or may include both volatile and non-volatile types of storage media.
[0127] Those skilled in the art will appreciate that the embodiments of the present disclosure may be provided as methods, systems, or computer program products. Therefore, the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0128] The present disclosure is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the present disclosure. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, 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, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0129] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0130] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0131] In the description of this specification, the description with reference to the terms "one embodiment / method", "some embodiments / methods", "example", "specific example", or "some examples" etc. means that the specific features, structures, or characteristics described in conjunction with the embodiment / method or example are included in at least one embodiment / method or example of the present disclosure. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment / method or example. Moreover, the specific features, structures, or characteristics described may be combined in any one or more embodiments / methods or examples in a suitable manner. In addition, those skilled in the art may combine and combine different embodiments / methods or examples described in this specification and features of different embodiments / methods or examples, unless they are contradictory.
[0132] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of the present disclosure, "plurality" means at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0133] Those skilled in the art should understand that the above embodiments are only for the purpose of clearly illustrating the present disclosure, and are not intended to limit the scope of the present disclosure. For those skilled in the art, other changes or modifications may be made based on the above disclosure, and these changes or modifications are still within the scope of the present disclosure.
Claims
1. A data query method, characterized in that: include: receiving a first query request, wherein the first query request includes order identification information and storage identification information, wherein the storage identification information can be used to determine a target data source storing a desired query field, and the interface format of the interface called by different first query requests is the same; generating a second query request including the order identification information; Sending the corresponding second query request to the target data source according to the storage identification information; receiving a second query result corresponding to the second query request sent by the target data source, wherein the second query result includes a field value of a business field associated with the order identification information in the second query request, and the business field includes the expected query field; Generate an order object according to the second query result, and obtain a first query result including the order object, wherein the fields in the order object include at least part of the fields stored in the target data source; as well as The first query result is fed back.
2. The data query method according to claim 1, characterized in that: The execution subject that generates and sends the first query request is an independent query end, and the feedback object of the first query result is the query end.
3. The data query method according to claim 1, characterized in that: The step of generating the first query request includes: In response to receiving the display instruction, displaying a data source identifier of the optional data source and a field identifier of a queryable field included in the optional data source in the display interface; In response to receiving the selection indication, determining the storage identification information; and generating a first query request including the storage identification information; Optionally, the optional data source includes at least one data module, the queryable field belongs to the at least one data module, the display interface further displays module identification information of the data module included in the optional data source, and the storage identification information includes the module identification information; Optionally, the step of generating the first query request further comprises: in response to receiving an input indication, determining the order identification information from the input indication; Generating a first query request including the storage identification information specifically includes: generating a first query request including the storage identification information and the order identification information.
4. The data query method according to claim 1, characterized in that: The interface formats of the interfaces called by different second query requests are the same, and the input parameters of the interface called by the second query request include a second order identification parameter for representing the order identification information; Optionally, the input parameters of the interface called by the first query request include a first order identification parameter for representing the order identification information and a storage identification parameter for representing the storage identification information, and the data format of the first order identification parameter and / or storage identification parameter is in list form.
5. The data query method according to claim 1, characterized in that: The first query result obtained also includes the order identification information corresponding to the order object.
6. The data query method according to claim 1, 3 or 4, characterized in that: Generating a second query request including the order identification information, including: Determining, based on the storage identification information, an interface path capable of pointing to the target data source and a data structure of a return value; and requesting the interface called by the second query request of the target data source through the interface path, and sending the second query request to the target data source through the interface called by the second query request; Optionally, the interface called by the second query request is an interface of a data module included in the target data source, and the data structure of the return value is compatible with the field type of the field included in the data module.
7. The data query method according to claim 1, characterized in that: Generating an order object according to the second query result includes: Creating an empty order object, wherein the order object contains a plurality of fields; and Fill the field values contained in the second query result into the corresponding fields of the order object; Optionally, generating an order object according to the second query result includes: Creating a proxy object of the order object, the proxy object is used to report read information when a target field in the order object is read, the read information includes information of the read target field, and the read information is used to count the number of times the read target field is read; wherein the first query result obtained also includes the proxy object; Optionally, the reporting object of the read information is the target data source corresponding to the read target field; Optionally, creating a proxy object of the order object includes: If the order object contains a collection structure, a proxy object is created for the objects in the collection structure.
8. An electronic device, characterized in that: include: A memory storing execution instructions; as well as A processor, wherein the processor executes the execution instructions stored in the memory, so that the processor executes the method according to any one of claims 1 to 7.
9. A readable storage medium, characterized in that: The readable storage medium stores a computer program, and when the computer program is executed by a processor, it is used to implement the method according to any one of claims 1 to 7.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the computer program is used to implement the method according to any one of claims 1 to 7.