Logistics service data query method and device, electronic equipment and storage medium
By using a query engine and query mode table that does not require index management in the logistics service platform, and dynamically selecting the query mode, the problem of inefficient query of logistics service data is solved, and fast response and efficient query are achieved.
Patent Information
- Application Number
- CN202510418192.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-03
- Publication Date
- 2025-07-18
AI Technical Summary
The existing online logistics service platform has low query efficiency, especially due to the large variety of logistics service data and large differences in business data, which leads to low user query efficiency. The Salesforce-based customer relationship management platform requires additional index management, occupying computing resources, and reducing query efficiency.
Using a query engine that does not require index management, through predefined query mode tables and query engines, we dynamically select appropriate query modes, quickly respond to user query requests, and use the ElasticSearch (ES) query engine to process logistics product data.
It improves the efficiency of logistics service data query, shortens query time, reduces query complexity, and provides an efficient, reliable and easy-to-maintain query solution.
Smart Images

Figure CN120336378A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the technical field of logistics services, and in particular, to a method, device, electronic device, and storage medium for querying logistics service data. Background Art
[0002] In recent years, many integrated logistics service companies have built online logistics service platforms to better serve users. Users can query relevant physical services through the online logistics service platform at any time, including various types of logistics services such as customs affairs, warehousing, trailers, inspections, and sea freight. However, due to the large variety of logistics service data and significant differences in business data, the efficiency of users querying services on the online logistics service platform is very low. Therefore, how to efficiently support various logistics services with greatly different business attributes on the online logistics service platform is a very difficult problem.
[0003] Most of the current online logistics reading platforms that support users to query data are built based on the Salesforce customer relationship management platform. This platform is a metadata-driven multi-tenant architecture solution, and its architecture allows multiple tenants to share the same set of infrastructure while maintaining the isolation of data and configuration information. However, this method requires the use of special index tables to optimize query performance. These index tables need to synchronize the data in the underlying data tables and convert the data into strongly typed storage. Using this method to support the user's data query task will introduce additional performance overhead, occupy the resources of computer devices, and reduce the query efficiency. Summary of the Invention
[0004] The embodiments of the present invention provide a method, device, electronic device, and storage medium for querying logistics service data, which can quickly query data for users through a query engine that does not require index management, reducing development costs and improving the query efficiency of logistics service data at the same time.
[0005] In a first aspect, the embodiments of the present invention provide a method for querying logistics service data, including:
[0006] Receiving a query condition sent by a first user;
[0007] Determining a target query mode corresponding to the query condition according to a query mode table pre-stored in a local database; the query mode table is used to store query modes corresponding to the attributes of each logistics product;
[0008] Obtaining a query result corresponding to the query condition through a predefined query engine based on the query condition, the target query mode, and the logistics product data stored in the query engine;
[0009] Generating result display information according to the query result and displaying the result display information to the first user.
[0010] In a second aspect, an embodiment of the present invention provides a logistics service data query device, which includes:
[0011] A condition receiving module, configured to receive a query condition sent by a first user;
[0012] A mode determining module, configured to determine a target query mode corresponding to the query condition according to a pre-stored query mode table in a local database; the query mode table is used to store query modes corresponding to attributes of each logistics product;
[0013] A result determining module, configured to obtain a query result corresponding to the query condition based on the query condition, the target query mode, and logistics product data stored in the query engine through a predefined query engine;
[0014] A result display module, configured to generate result display information according to the query result and display the result display information to the first user.
[0015] In a third aspect, an embodiment of the present invention further provides an electronic device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, it implements the logistics service data query method as described in any one of the embodiments of the present invention.
[0016] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, it implements the logistics service data query method as described in any one of the embodiments of the present invention.
[0017] In an embodiment of the present invention, a query condition sent by a first user is received; a query mode corresponding to the query condition is determined according to a pre-stored query mode table in a local database; the query mode table is used to store a target query mode corresponding to attributes of each logistics product; through a predefined query engine, a query result corresponding to the query condition is obtained based on the query condition, the target query mode, and logistics product data stored in the query engine; result display information is generated according to the query result and the result display information is displayed to the first user. The method of the embodiment of the present invention can dynamically select a suitable query mode according to different query conditions through the query mode table, enabling the server to more quickly respond to various complex query requests and improving query efficiency. The query engine can quickly query data for users according to the logistics product data it stores without index management, shortening the data query time and reducing the query complexity, providing an efficient, reliable, and easy-to-maintain solution for data processing and query in the logistics service process. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] To more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the drawings required for use in the embodiments. It should be understood that the following drawings only show certain embodiments of the present invention and should not be regarded as limiting the scope. For those of ordinary skill in the art, without creative efforts, other related drawings can also be obtained based on these drawings.
[0019] Figure 1 The first flowchart of a method for querying logistics service data provided by an embodiment of the present invention;
[0020] Figure 2 The second flowchart of a method for querying logistics service data provided by an embodiment of the present invention;
[0021] Figure 3 The flowchart of a method for synchronizing logistics product information to a query engine provided by an embodiment of the present invention;
[0022] Figure 4 The structural schematic diagram of synchronizing logistics product information to a query engine provided by an embodiment of the present invention;
[0023] Figure 5 The flowchart of a method for updating a logistics product data table provided by an embodiment of the present invention
[0024] Figure 6 The structural schematic diagram of a logistics service data query device provided by an embodiment of the present invention;
[0025] Figure 7 The structural schematic diagram of an electronic device provided by an embodiment of the present invention. Detailed implementation manners
[0026] The following will further elaborate on the present invention in conjunction with the drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the present invention and not to limit the present invention. Additionally, it should be noted that for the sake of description, only parts related to the present invention rather than all structures are shown in the drawings.
[0027] Figure 1 The first flowchart of a method for querying logistics service data provided by an embodiment of the present invention. The method of the embodiment of the present invention can quickly query data for users through a query engine that does not require index management, reducing development costs while improving the query efficiency of logistics service data. This method can be executed by a logistics service data query device provided by an embodiment of the present invention, and the device can be implemented in software and / or hardware. The following embodiments will be described by taking the integration of the device in an electronic device as an example. The electronic device can be a server or a computer device for implementing a method for querying logistics service data. Refer to Figure 1, the method may specifically include the following steps:
[0028] Step 101: Receive the query conditions sent by the first user.
[0029] Among them, the first user is the user who needs to use the query engine to query the logistics service. The query condition is a specific parameter or expression input by the first user in the query engine, which is used to filter out data that meets specific criteria from the database of the query engine. In an optional implementation manner, when the first user needs to query logistics service information, the query condition can be input through the front-end page displayed to the first user by the server. The server can receive the query condition sent by the first user through the front-end page.
[0030] Step 102: Determine the target query mode corresponding to the query condition according to the query mode table pre-stored in the local database.
[0031] Among them, the query mode table is used to store the query modes corresponding to the attributes of each logistics product. The query engine in this solution can be an ElasticSearch (ES) query engine. The query mode can be a query mode supported by the ES query engine. The query modes include but are not limited to match query, exact match query, range query, compound query, analyzer query, fuzzy query, combination query, multi-condition query, and full-text search query.
[0032] The local database in this solution includes a logistics product object table, a logistics product attribute table, and a query mode table. Logistics product objects include various logistics service products, such as customs declaration product objects and warehousing product objects, etc.; Logistics product object attributes include various types and related information of logistics product objects. For example, customs declaration product object attributes include: goods category, transportation mode, import and export type, supervision mode, price information, and timeliness information, etc. Specifically, after obtaining the query condition, the query condition can be parsed to obtain the query product attribute corresponding to the query condition; the target product attribute identical to the query product attribute is searched in the query mode table, and the query mode corresponding to the target product attribute is determined as the target query mode.
[0033] Step 103: Through the predefined query engine, obtain the query result corresponding to the query condition based on the query condition, the target query mode, and the logistics product data stored in the query engine.
[0034] Among them, the query engine is a system or software component used to retrieve data from a database or data storage system. The query engine parses the query conditions input by the first user and filters out data that meets specific criteria from the database of the query engine according to the query pattern or logic corresponding to the query conditions. The query engine in this solution can be an ES query engine, which is used to process and respond to the query requests of the first user for logistics products (such as customs declaration, warehousing, etc.). The ES query engine can understand the user's query conditions and find relevant logistics product information in the database according to these conditions. The database of the ES query engine includes a logistics product data table, which is used to store all data of logistics products, including logistics product object data and logistics product attribute data.
[0035] Specifically, after obtaining the target query pattern, format conversion is performed on the query conditions and the target query pattern to convert them into an engine query statement supported by the ES query engine. The engine query statement is input into the ES query engine. After receiving the engine query statement, the ES query engine determines the query result in the logistics product data according to the target query pattern based on the engine query statement.
[0036] Step 104: Generate result display information according to the query result and display the result display information to the first user.
[0037] Specifically, after obtaining the query result, visual processing is performed on the query result to obtain result display information corresponding to the query result. The result display information is sent to the front-end page or the client of the first user, and the query result is displayed to the user through the front-end page or the client.
[0038] The technical solution of this embodiment receives the query conditions sent by the first user; determines the query pattern corresponding to the query conditions according to the query pattern table pre-stored in the local database; the query pattern table is used to store the target query patterns corresponding to the attributes of each logistics product; through a predefined query engine, the query result corresponding to the query conditions is obtained based on the query conditions, the target query pattern, and the logistics product data stored in the query engine; result display information is generated according to the query result and the result display information is displayed to the first user. The technical solution of this embodiment can dynamically select an appropriate query pattern according to different query conditions through the query pattern table, enabling the server to respond to various complex query requests more quickly and improving the query efficiency. According to the logistics product data it stores, the query engine can quickly query data for users without index management, shortening the data query time and reducing the query complexity, providing an efficient, reliable, and easy-to-maintain solution for data processing and query in the logistics service process.
[0039] Figure 2This is the second flowchart of the logistics service data query method provided by the embodiments of the present invention. This embodiment is a refinement based on the above embodiments. The specific method can be as follows Figure 2 shown. The method may include the following steps:
[0040] Step 201: Receive the query condition sent by the first user.
[0041] Step 202: Analyze the query condition to obtain the query product attributes corresponding to the query condition.
[0042] Among them, the query condition is a specific parameter or expression input by the user in the query engine, used to filter out data that meets specific criteria from the database of the query engine. Specifically, after obtaining the query condition, the server can decompose the string in the query condition into smaller parts, such as keywords, operators, and values. Perform intent analysis on the decomposed string, for example, determine whether the first user is querying a specific logistics service or comparing different service options. After obtaining the keywords and values in the query condition, determine the query product attributes according to the keywords and values. For example, if the keyword in the query condition is the product identifier of a certain logistics service product, the query product attributes include all attributes of the logistics service product. If the keyword in the query condition is the cost of a certain logistics service product, the query product attributes include the price information of the logistics service product.
[0043] Step 203: Search for the target product attribute identical to the query product attribute in the query mode table, and determine the query mode corresponding to the target product attribute as the target query mode.
[0044] Specifically, the query modes include but are not limited to match query, exact match query, range query, compound query, analyzer query, fuzzy query, combination query, multi-condition query, and full-text search query. The match query is applicable to full-text search. As long as any token of the query condition is included in the database of the query engine, it is determined that the query condition is matched. The exact match query requires that the entire query condition must be completely included in the database of the query engine. The range query is used to filter data within a numerical range. The prefix query is used to match words starting with a specific prefix. The phrase query requires that the phrase order in the database of the query engine is exactly the same as the query condition. The fuzzy query allows matching similar words to a certain extent.
[0045] Different product attributes are suitable for different query modes. Exemplarily, by analyzing the query conditions, the query product attribute corresponding to the query conditions is obtained as: Commodity category: electronic products. Then it can be determined that the first user wants to find all logistics services related to "electronic products". The query mode suitable for this logistics service product attribute is the matching query. Exemplarily, according to the query conditions, it is determined that the user hopes to find a logistics service with a price between 100 and 500 yuan. The query product attribute is determined as: price information. The query mode suitable for this product attribute is the range query (filter out logistics services with a price between 100 and 500 yuan). The query mode table stores the query modes suitable for each logistics service product attribute. After obtaining the query product attribute, the target product attribute identical to the query product attribute is searched for in the query mode table. The query mode corresponding to the target product attribute in the query mode table is determined as the target query mode.
[0046] Step 204: Construct an engine query statement according to the query conditions and the target query mode, and input the engine query statement into the query engine.
[0047] Among them, the engine query statement is a query statement in a data format supported by the query engine. In an optional implementation manner, after obtaining the query conditions and the target query mode, a corresponding ES engine query statement is constructed according to the query conditions and the target query mode. After obtaining the ES engine query statement, the ES engine query statement is input into the ES query engine.
[0048] Step 205: Through the query engine, according to the target query mode, determine the query result in the logistics product data according to the engine query statement.
[0049] Among them, the logistics product data is pre-synchronized from the local server to the ES query engine, and the storage format of the logistics product data is the metadata format. After receiving the engine query statement, the ES query engine parses the engine query statement to obtain the target query mode corresponding to the engine query statement. After determining the target query mode, the query condition statement is extracted from the engine query statement and its logical analysis is performed. Exemplarily, the query statement is a bool (Boolean) query statement, including a range (full-text matching query) clause and a term (exact matching query) clause. The ES query engine can parse this query statement and recognize that it is a composite query that needs to meet two conditions simultaneously.
[0050] After determining the target query pattern, the ES query engine can query the query results corresponding to the query conditions in the logistics product data according to the query method corresponding to the target query pattern. For example, for a range query, the ES query engine checks whether the price information of the corresponding logistics product in the logistics product data is within the specified range; for a term query, the ES query engine checks whether the transportation method of the corresponding logistics product in the logistics product data exactly matches the specified value. In an optional implementation manner, after obtaining the matching data, the ES query engine can use a pre-determined relevance scoring algorithm to score the matching data. The higher the scoring calculation result, the higher the relevance between the matching data and the query conditions. Further, sort the data obtained by matching according to the scoring results, and determine the data with the highest scoring result as the query result.
[0051] Step 206, generate result display information according to the query results, and display the result display information to the first user.
[0052] The technical solution of this embodiment receives the query conditions sent by the first user. Parse the query conditions to obtain the query product attributes corresponding to the query conditions; search for the target product attributes identical to the query product attributes in the query mode table, and determine the query mode corresponding to the target product attributes as the target query mode. Construct an engine query statement according to the query conditions and the target query mode, and input the engine query statement into the query engine. Determine the query results in the logistics product data through the query engine according to the target query mode and the engine query statement. Among them, the storage format of the logistics product data is the metadata format. Generate result display information according to the query results, and display the result display information to the first user. The technical solution of this embodiment can accurately identify the product attributes that the user wants to query by parsing the received query conditions, thus avoiding problems such as query failure or inaccurate results caused by misunderstanding. The method of dynamically determining the query mode enables the server to select the most suitable query method according to different query requirements, improving the efficiency and accuracy of the query. The logistics product data is stored in the metadata format, which helps to maintain data consistency and accessibility. At the same time, it is also convenient for the server to quickly retrieve and process the data. Through the ES query engine, the user's query request can be quickly responded to, and accurate query results can be returned, improving the query efficiency and user experience.
[0053] Figure 3 It is a flowchart of the method for synchronizing logistics product information to the query engine provided by an embodiment of the present invention. This embodiment is based on the above embodiment. The specific method can be as Figure 3 shown. The method may include the following steps:
[0054] Step 301, receive the logistics product information sent by the second user.
[0055] Among them, the second user is a staff member of the logistics product service provider. The second user can define the logistics product and store the relevant information of the defined logistics product in the local service library to support the server to provide the logistics service information query service for the first user. The logistics product information includes the object information and attribute information of the logistics product. In the field of logistics services, different services and operations can be regarded as different "logistics products". For example, customs declaration, warehousing, transportation, etc. are all part of the logistics service, and each part can be defined as a logistics product object. Specifically, when the second user needs to define a new logistics product, the object information and attribute information of the logistics product can be uploaded to the server, and the server can receive the logistics product information sent by the second user.
[0056] Optionally, in this solution, after receiving the logistics product object information sent by the second user, it further includes: obtaining the query mode supported by the attribute information of the logistics product, and establishing a query mode table according to the attribute information of the logistics product and its supported query mode.
[0057] Specifically, the query mode includes but is not limited to matching query, exact matching query, range query, compound query, analyzer query, fuzzy query, combined query, multi-condition query, and full-text search query. The query mode table is used to store the query modes suitable for the attributes of each logistics service product. Different product attributes are suitable for different query modes. After obtaining the logistics product object information, the second user can input the query mode supported by the attribute information of the logistics product. Store the attribute information of the logistics product and its supported query mode in the query mode table.
[0058] Step 302: Store the object information in a pre-defined logistics product object table; store the attribute information in a pre-defined logistics product attribute table.
[0059] The logistics product object table is used to store the object information of the logistics product object, and the logistics product attribute table is used to store the attribute information of the logistics product object. After obtaining the object information of the logistics product, store it in the logistics product object table. After obtaining the attribute information of the logistics product, store it in the logistics product attribute table. The logistics product object table and the logistics product attribute table in this solution are both stored in the local database. The logistics product object table and the logistics product attribute table are both composed of corresponding fields.
[0060] In the logistics product attribute table, one logistics product object corresponds to one attribute list, and the attribute list includes multiple attributes of the object. Exemplarily, it is defined that the attribute list of logistics product object A includes: Commodity category: Describes the type or category of goods (such as electronic products, textiles, or food, etc.). Transportation mode: Describes the transportation mode of the goods. (Such as sea transportation, air transportation, or land transportation, etc.). Import and export type: Describes whether the goods are imported or exported. (Such as import or export). Regulatory mode: Describes the regulatory mode of the goods. (Such as general trade, processing trade, or bonded area, etc.). Price information: Describes the price information of the goods. (Such as unit price, total price, or currency unit, etc.). Timing information: Describes the timing requirements of the goods (such as expected arrival time or latest shipping time, etc.).
[0061] Step 303: Synchronize the logistics product object table and the logistics product attribute table to the query engine.
[0062] Specifically, after obtaining the logistics product object table and the logistics product attribute table, it is necessary to store their data in the query engine so that the query engine can query data for users based on this. In this solution, optionally, synchronizing the logistics product object table and the logistics product attribute table to the query engine includes: determining the mapping relationship between the logistics product object information and the logistics product attribute information; generating a logistics product data table based on the logistics product object table, the logistics product attribute table, and the mapping relationship; and synchronizing the logistics product data table to the query engine according to a preset data synchronization mechanism.
[0063] Among them, the logistics product object table, the logistics product attribute table, and the logistics product data table are stored in the local database. After obtaining the physical product object table and the logistics product attribute table, determine the correspondence, that is, the mapping relationship, between each object in the logistics product object table and the attributes in the logistics product attribute table. Based on the mapping relationship, integrate the data in the logistics product object table and the logistics product attribute table into a new logistics product data table. The attribute fields of the logistics product data table in this solution are not all character types, but are divided into 3 basic types: character type, numeric type, and date type. The logistics product data in the logistics product data table contains all the necessary information of the logistics products. According to the mapping relationship, match the fields in the logistics product object table with the attributes in the logistics product attribute table, and import the matching data into the new logistics product data table. After obtaining the logistics product data table, synchronize it to the query engine through the data synchronization mechanism for efficient data query and analysis. The local database in this solution can be a MySQL database, and the data synchronization mechanism can be the Binlog synchronization mechanism in MySQL.
[0064] Through a pre-set data synchronization mechanism, changes to the logistics product object table and the logistics product attribute table can be synchronized to the query engine in real-time or periodically, which helps to ensure that the data in the query engine is consistent with the source data and avoid errors and confusion caused by data inconsistency. Determining the mapping relationship between the logistics product object information and the logistics product attribute information helps to maintain data integrity, enabling the query engine to understand and process data more accurately.
[0065] Figure 4 This is a schematic structural diagram of synchronizing logistics product information to the query engine provided by an embodiment of the present invention. As Figure 4 shown, the local database includes a logistics product object table and a logistics product attribute table. A logistics product data table is generated based on the logistics product object table and the logistics product attribute table, and the logistics product data table is synchronized to the query engine through a data synchronization mechanism.
[0066] The technical solution of this embodiment receives the logistics product information sent by the second user; wherein, the logistics product information includes the object information and attribute information of the logistics product; stores the object information into a pre-defined logistics product object table; stores the attribute information into a pre-defined logistics product attribute table; and synchronizes the logistics product object table and the logistics product attribute table to the query engine. The technical solution of this embodiment only requires three tables, namely the logistics product object table, the logistics product attribute table, and the logistics product data table, to complete the definition, storage, and retrieval of logistics products. This method simplifies the data structure, enabling developers to focus more on the implementation of business logic without having to concern themselves with complex data storage and retrieval mechanisms. At the same time, by synchronizing the data to the ES query engine, the standardization and generalization of query statements can be achieved, solving the problem of invalid database indexes and improving query efficiency and accuracy.
[0067] Figure 5 This is a flowchart of a method for updating a logistics product data table provided by an embodiment of the present invention. This embodiment is a refinement based on the above embodiment. The specific method can be as Figure 5 shown, and the method may include the following steps:
[0068] Step 501, receive logistics product service data in real-time through pre-set data interfaces.
[0069] Logistics product service data includes logistics product object information. Each data interface is used to connect the server and each logistics service point. During the entire cross-border logistics service process, each logistics service point (such as warehouses, transport vehicles, and customs brokers, etc.) will generate a large amount of real-time data. When an event occurs at a logistics service point (such as goods receipt, goods issue, or transportation status update, etc.), each logistics service point can generate logistics product service data. These data are crucial for monitoring the logistics process, optimizing resource allocation, and improving service quality. Therefore, it is necessary to update the query engine in real-time based on these data so that the query engine can provide query services for the first user more efficiently. Specifically, each data interface can receive the logistics product service data sent by each logistics service point in real-time, and the server can update the logistics product data table in the query engine according to the logistics product service data.
[0070] Step 502: Update the logistics product data table according to the logistics product attribute table and the logistics product service data, and synchronize the updated logistics product data table to the query engine according to the preset data synchronization mechanism.
[0071] Specifically, after obtaining the logistics product service data, the server can update the logistics product data table by combining the logistics product attribute table and the logistics product object information of the logistics product service data. Exemplarily, when the server receives the goods receipt information of a certain warehouse, the server can find the corresponding attributes of the logistics product service data in the logistics product attribute table, add the logistics product service data to the logistics product data table according to its corresponding attributes, and mark it as "received". Further, through the data synchronization mechanism, this data is synchronized to the query engine regularly or in real-time. So that the first user can query the latest status of the goods in real-time through the query engine, such as whether the goods have been received and the current location of the goods, etc.
[0072] The technical solution of this embodiment receives the logistics product service data in real-time through each preset data interface; the logistics product service data includes logistics product object information. Update the logistics product data table according to the logistics product attribute table and the logistics product object information, and synchronize the updated logistics product data table to the query engine according to the preset data synchronization mechanism. The technical solution of this embodiment can dynamically update the logistics product data table in real-time through each preset data interface, ensuring the accuracy and timeliness of the logistics product data, and providing a reliable data basis for subsequent queries and analyses.
[0073] Figure 6 It is a schematic structural diagram of the logistics service data query device provided by the embodiment of the present invention. This device is applicable to execute the logistics service data query method provided by the embodiment of the present invention. As Figure 6 shown, this device may specifically include:
[0074] A conditional access module 601, configured to receive a query condition sent by a first user;
[0075] A mode determination module 602, configured to determine a target query mode corresponding to the query condition according to a query mode table pre-stored in a local database; the query mode table is used to store query modes corresponding to attributes of each logistics product;
[0076] A result determination module 603, configured to obtain a query result corresponding to the query condition based on the query condition, the target query mode, and logistics product data stored in the query engine through a predefined query engine;
[0077] A result display module 604, configured to generate result display information according to the query result and display the result display information to the first user.
[0078] Optionally, the mode determination module 602 is specifically configured to: parse the query condition to obtain a query product attribute corresponding to the query condition;
[0079] Search for a target product attribute identical to the query product attribute in the query mode table, and determine the query mode corresponding to the target product attribute as the target query mode.
[0080] Optionally, the result determination module 603 is specifically configured to: construct an engine query statement according to the query condition and the target query mode, and input the engine query statement into the query engine;
[0081] Determine the query result from the logistics product data through the query engine according to the engine query statement in accordance with the target query mode, wherein the storage format of the logistics product data is a metadata format.
[0082] Optionally, the result determination module 603 is further configured to: receive logistics product information sent by a second user; wherein the logistics product information includes object information and attribute information of the logistics product;
[0083] Store the object information into a predefined logistics product object table; store the attribute information into a predefined logistics product attribute table;
[0084] Synchronize the logistics product object table and the logistics product attribute table to the query engine.
[0085] Optionally, the result determination module 603 is further configured to: determine a mapping relationship between the logistics product object information and the logistics product attribute information;
[0086] Generate a logistics product data table based on the logistics product object table, the logistics product attribute table, and the mapping relationship; wherein, the logistics product object table, the logistics product attribute table, and the logistics product data table are stored in the local database;
[0087] Synchronize the logistics product data table to the query engine according to a preset data synchronization mechanism.
[0088] Optionally, the result determination module 603 is further configured to: receive logistics product service data in real time through each preset data interface; the logistics product service data includes logistics product object information;
[0089] Update the logistics product data table according to the logistics product attribute table and the logistics product service data, and synchronize the updated logistics product data table to the query engine according to a preset data synchronization mechanism.
[0090] Optionally, the mode determination module 602 is further configured to: obtain the query modes supported by the attribute information of the logistics product, and establish the query mode table according to the attribute information of the logistics product and the query modes it supports.
[0091] The logistics service data query device provided by the embodiments of the present invention can execute the logistics service data query method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the method. The content not described in detail in this embodiment can be referred to the description in any method embodiment of the present invention.
[0092] Figure 7 It is a schematic structural diagram of an electronic device provided by an embodiment of the present invention. Refer to Figure 7 , Figure 7 The electronic device 12 shown is only an example, and should not bring any limitation to the functions and usage scope of the embodiments of the present application. As Figure 7 shown, the electronic device 12 is presented in the form of a general-purpose computing device. The components of the electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 connecting different system components (including the system memory 28 and the processing unit 16).
[0093] The bus 18 represents one or more of several types of bus structures, including a memory bus or a memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the multiple bus structures. For example, these architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
[0094] The electronic device 12 typically includes a variety of computer system readable media. These media can be any available media accessible by the electronic device 12, including volatile and non-volatile media, removable and non-removable media.
[0095] The system memory 28 can include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The electronic device 12 can further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 can be used for reading and writing on non-removable, non-volatile magnetic media ( Figure 7 not shown, typically referred to as a "hard disk drive"). Although Figure 7 not shown in the figure, a disk drive for reading and writing on removable non-volatile disks (such as "floppy disks") and an optical disk drive for reading and writing on removable non-volatile optical disks (such as CD-ROM, DVD-ROM or other optical media) can be provided. In these cases, each drive can be connected to the bus 18 through one or more data media interfaces. The memory 28 can include at least one program product having a set (such as at least one) of program modules configured to perform the functions of the embodiments of the present application.
[0096] A program / utility 40 having a set (at least one) of program modules 46 can be stored, for example, in the memory 28. Such program modules 46 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include the implementation of a network environment. The program modules 46 generally perform the functions and / or methods in the embodiments described in the present application.
[0097] The electronic device 12 can also communicate with one or more external devices 14 (such as a keyboard, a pointing device, a display 24, etc.), and can also communicate with one or more devices that enable a user to interact with the electronic device 12, and / or communicate with any device that enables the electronic device 12 to communicate with one or more other computing devices (such as a network card, a modem, etc.). Such communication can be carried out through the input / output (I / O) interface 22. Moreover, the electronic device 12 can also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through the network adapter 20. As shown in the figure, the network adapter 20 communicates with other modules of the electronic device 12 through the bus 18. It should be understood that although Figure 7which is not shown in the figure, other hardware and / or software modules can be used in combination with the electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0098] The processing unit 16 executes various functional applications and data processing by running the programs stored in the system memory 28. For example, it implements a logistics service data query method provided by an embodiment of the present invention: receiving a query condition sent by a first user; determining a target query mode corresponding to the query condition according to a pre-stored query mode table in the local database; the query mode table is used to store query modes corresponding to the attributes of each logistics product; through a predefined query engine, obtaining a query result corresponding to the query condition based on the query condition, the target query mode, and the logistics product data stored in the query engine; generating result display information according to the query result, and displaying the result display information to the first user.
[0099] An embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, it implements a logistics service data query method provided by all embodiments of the present invention: receiving a query condition sent by a first user; determining a target query mode corresponding to the query condition according to a pre-stored query mode table in the local database; the query mode table is used to store query modes corresponding to the attributes of each logistics product; through a predefined query engine, obtaining a query result corresponding to the query condition based on the query condition, the target query mode, and the logistics product data stored in the query engine; generating result display information according to the query result, and displaying the result display information to the first user. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, electronic devices, devices, or components of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of the computer-readable storage medium include: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above. In this document, the computer-readable storage medium can be any tangible medium that contains or stores a program, and this program can be used by or combined with an instruction execution electronic device, device, or component.
[0100] A computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction-executing electronic device, apparatus, or device.
[0101] The program code contained on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, and the like, or any suitable combination of the foregoing.
[0102] The computer program code for performing the operations of the present invention may be written in one or more programming languages or combinations thereof. The programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, executed as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0103] Note that the above is only the preferred embodiment of the present invention and the applied technical principle. Those skilled in the art will understand that the present invention is not limited to the specific embodiments here. Various obvious changes, re-adjustments, and substitutions can be made by those skilled in the art without departing from the protection scope of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments. Without departing from the concept of the present invention, more other equivalent embodiments may be included, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A method for querying logistics service data, characterized in that, The method includes: Receiving a query condition sent by a first user; Determining a target query pattern corresponding to the query condition according to a pre-stored query pattern table in a local database; the query pattern table is used to store query patterns corresponding to attributes of each logistics product; Obtaining a query result corresponding to the query condition based on the query condition, the target query pattern, and logistics product data stored in a pre-defined query engine; Generating result display information according to the query result and displaying the result display information to the first user.
2. The method according to claim 1, wherein Determining a target query pattern corresponding to the query condition according to a pre-stored query pattern table in a local database includes: Parsing the query condition to obtain a query product attribute corresponding to the query condition; Searching in the query pattern table for a target product attribute identical to the query product attribute and determining the query pattern corresponding to the target product attribute as the target query pattern.
3. The method according to claim 1, wherein Obtaining a query result corresponding to the query condition based on the query condition, the target query pattern, and logistics product data stored in a pre-defined query engine includes: Constructing an engine query statement according to the query condition and the target query pattern and inputting the engine query statement into the query engine; Determining the query result in the logistics product data according to the engine query statement by the query engine according to the target query pattern, wherein the storage format of the logistics product data is a metadata format.
4. The method according to claim 1, wherein Before receiving the query condition sent by the first user, the method further includes: Receiving logistics product information sent by a second user; wherein the logistics product information includes object information and attribute information of the logistics product; Storing the object information into a pre-defined logistics product object table; storing the attribute information into a pre-defined logistics product attribute table; Synchronizing the logistics product object table and the logistics product attribute table to the query engine.
5. The method according to claim 4, wherein Synchronizing the logistics product object table and the logistics product attribute table to the query engine includes: Determining a mapping relationship between the logistics product object information and the logistics product attribute information; Generating a logistics product data table according to the logistics product object table, the logistics product attribute table, and the mapping relationship; wherein the logistics product object table, the logistics product attribute table, and the logistics product data table are stored in the local database; Synchronizing the logistics product data table to the query engine according to a pre-set data synchronization mechanism.
6. The method according to claim 1, wherein Before receiving the query condition sent by the first user, the method further includes: Receiving logistics product service data in real time through pre-set data interfaces; the logistics product service data includes logistics product object information; Updating the logistics product data table according to the logistics product attribute table and the logistics product service data and synchronizing the updated logistics product data table to the query engine according to a pre-set data synchronization mechanism.
7. The method according to claim 4, characterized in that, After receiving the logistics product object information sent by the second user, the method further includes: Obtain the query modes supported by the attribute information of the logistics product, and establish the query mode table according to the attribute information of the logistics product and the query modes it supports.
8. A logistics service data query device, characterized in that, Including: A conditional reception module, configured to receive a query condition sent by a first user; A mode determination module, configured to determine the target query mode corresponding to the query condition according to the query mode table prestored in the local database; The query mode table is used to store the query modes corresponding to the attributes of each logistics product; A result determination module, configured to obtain the query result corresponding to the query condition through a predefined query engine based on the query condition, the target query mode, and the logistics product data stored in the query engine; A result display module, configured to generate result display information according to the query result and display the result display information to the first user.
9. An electronic device, the electronic device includes a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the logistics service data query method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the logistics service data query method according to any one of claims 1 to 7.