Data query method, device, electronic device and storage medium
By automatically generating and executing multi-application query requests through semantic analysis and a jump engine, the problem of low efficiency when users switch between multiple applications to query information is solved, and more efficient data query is achieved.
Patent Information
- Application Number
- CN202311253523.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-26
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2043-09-26
AI Technical Summary
In the prior art, users need to manually switch between multiple applications to query information, resulting in low efficiency in electronic device data query.
The semantic analysis engine parses the query information entered by the user, generates a query file containing query requests and sequences of multiple applications, and passes it to the last application through the jump engine, automatically executing the query operation to obtain the results.
There is no need for users to manually switch applications, which improves the efficiency of electronic device data query.
Smart Images

Figure CN117290397B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of communication technology, and specifically relates to a data query method, device, electronic device and storage medium. Background Art
[0002] Currently, users often use different apps together to query some information. For example, if a user wants to know the weather on the Dragon Boat Festival, he or she can use the calendar app and the weather app together. The calendar app can be used to query the date of the Dragon Boat Festival, and then the weather app can be used to query the weather on the day corresponding to the date to obtain the weather on the Dragon Boat Festival.
[0003] However, in the above process, the user needs to first open the calendar application, input in the calendar application to query the date of the Dragon Boat Festival, and then open another weather application based on this date, input in the weather application to query the weather on the Dragon Boat Festival; in this way, the efficiency of electronic device data query is low. Summary of the Invention
[0004] The purpose of the embodiments of the present application is to provide a data query method, device, electronic device and storage medium, which can improve the efficiency of data query of electronic devices.
[0005] In a first aspect, an embodiment of the present application provides a data query method, the method comprising: performing semantic analysis on query information input by a user through a semantic analysis engine to obtain query operation information; generating a query file through the semantic analysis engine and the application characteristics and query operation information of each application in at least two applications, the query file comprising N query requests and a query order of the N query requests, each query request corresponding to one of the at least two applications, N being an integer greater than 1; passing the query file to a first application through a jump engine, the first application being the application corresponding to the last query request in the N query requests; parsing the N query requests and the query order in the query file through the first application, executing the query operations corresponding to each query request in turn, and obtaining the query results of the query information.
[0006] In the second aspect, an embodiment of the present application provides a data query device, which includes: a processing module, a generation module and a transmission module. The processing module is used to perform semantic analysis on the query information input by the user through a semantic analysis engine to obtain query operation information. The generation module is used to generate a query file through the semantic analysis engine and the application characteristics of each application in at least two applications and the query operation information obtained by processing the processing module. The query file includes N query requests and a query order of N query requests. Each query request corresponds to one application in at least two applications, and N is an integer greater than 1. The transmission module is also used to transmit the query file generated by the generation module to the first application through the jump engine. The first application is the application corresponding to the last query request among the N query requests. The processing module is also used to parse the N query requests and the query order in the query file transmitted by the transmission module through the first application, and execute the query operations corresponding to each query request in turn to obtain the query results of the query information.
[0007] In a third aspect, an embodiment of the present application provides an electronic device comprising a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.
[0008] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.
[0009] In a fifth aspect, an embodiment of the present application provides a chip, which includes a processor and a communication interface, the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the method described in the first aspect.
[0010] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the method described in the first aspect.
[0011] In an embodiment of the present application, a semantic analysis engine is used to perform semantic analysis on the query information input by the user to obtain query operation information; a query file is generated through the semantic analysis engine and the application characteristics and query operation information of each application in at least two applications, and the query file includes N query requests and a query order of N query requests, each query request corresponds to one application in at least two applications, and N is an integer greater than 1; the query file is passed to the first application through the jump engine, and the first application is the application corresponding to the last query request in the N query requests; the N query requests and the query order in the query file are parsed through the first application, and the query operations corresponding to each query request are executed in sequence to obtain the query results of the query information. In this solution, after the user inputs the query information, the electronic device can perform semantic analysis on the query information input by the user through the semantic analysis engine to obtain query operation information; and generate a query file through the semantic analysis engine and the application characteristics of each application in at least two applications and the above-mentioned query operation information, and then pass the generated query file to the first application corresponding to the last query request among the N query requests through the jump engine; therefore, the N query requests and query order in the query file can be parsed through the first application, and the query operations corresponding to each query request can be executed in sequence to obtain the query results of the query information input by the user, without the user having to manually open at least two applications for querying, thereby improving the efficiency of data query of the electronic device. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Figure 1 This is one of the flow charts of a data query method provided in an embodiment of the present application;
[0013] Figure 2 This is a second flow chart of a data query method provided in an embodiment of the present application;
[0014] Figure 3 This is a schematic diagram of an example of generating a query file provided in an embodiment of the present application;
[0015] Figure 4 This is a schematic diagram of an example of a data access method provided in an embodiment of the present application;
[0016] Figure 5 This is a schematic diagram of an example of a server query provided by an embodiment of the present application;
[0017] Figure 6 This is a schematic diagram of an example of thread data query provided by an embodiment of the present application;
[0018] Figure 7 This is a structural diagram of a data query device provided in an embodiment of the present application;
[0019] Figure 8This is one of the hardware structure diagrams of an electronic device provided in an embodiment of the present application;
[0020] Figure 9 This is the second hardware structure diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0021] The following will be combined with the accompanying drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the embodiments described are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field are within the scope of protection of this application.
[0022] The terms "first," "second," and the like in the specification and claims of this application are used to distinguish similar objects, and are not used to describe a specific order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of this application can be implemented in an order other than that illustrated or described herein, and that the objects distinguished by "first," "second," and the like are generally of the same type, and do not limit the number of objects; for example, the first object can be one or more. In addition, the term "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0023] The data query method provided in the embodiment of the present application is described in detail below through specific embodiments and their application scenarios in conjunction with the accompanying drawings.
[0024] The data query method in the embodiment of the present application can be applied to scenarios where information is queried through applications.
[0025] At present, users often use different APPs in conjunction to query some information. For example, if a user wants to watch other TV series starring the leading actor of the "XX" TV series, he can use a browser application and a video playback application in conjunction, query the name of the leading actor of the "XX" TV series through the browser application, and then search for other TV series starring the leading actor in the video playback application based on the name, and play them. Or, if a user wants to know the weather on the Dragon Boat Festival, he can use a calendar application and a weather application in conjunction, query the date of the Dragon Boat Festival through the calendar application, and then query the weather on the day corresponding to the date through the weather application. However, in the above process, the user needs to first open the calendar application, enter the information in the calendar application to query the date of the Dragon Boat Festival, and then open another weather application based on this date, and enter the information in the weather application to query the weather on the day of the Dragon Boat Festival. In this way, the efficiency of electronic device data query is low.
[0026] In the data query method, device, electronic device and storage medium provided in the embodiments of the present application, after the user inputs query information, the electronic device can perform semantic analysis on the query information input by the user through a semantic analysis engine to obtain query operation information; and generate a query file through the semantic analysis engine and the application characteristics of each application in at least two applications and the above-mentioned query operation information, and then pass the generated query file to the first application corresponding to the last query request among N query requests through the jump engine; therefore, the N query requests and query order in the query file can be parsed through the first application, and the query operations corresponding to each query request can be executed in sequence to obtain the query results of the query information input by the user, without the user having to manually open at least two applications for querying, thereby improving the efficiency of data query of the electronic device.
[0027] The execution subject of the data query method provided in the embodiment of the present application may be a data query device, which may be an electronic device, or a functional module or entity in the electronic device. The technical solution provided in the embodiment of the present application is described below using an electronic device as an example.
[0028] The present invention provides a data query method. Figure 1 FIG1 shows a flow chart of a data query method provided by an embodiment of the present application, which can be applied to electronic devices. Figure 1 As shown, the data query method provided in the embodiment of the present application may include the following steps 201 to 204.
[0029] Step 201: The electronic device performs semantic analysis on the query information input by the user through a semantic analysis engine to obtain query operation information.
[0030] In some embodiments of the present application, the query information may be text information or voice information, which is not limited in the embodiments of the present application.
[0031] For example, the query information may be "What is the weather like during the Dragon Boat Festival?".
[0032] In some embodiments of the present application, the query information may be query information input in a first interface, and the first interface may be a desktop, or an interface where query information can be input.
[0033] In some embodiments of the present application, the query information may be query information input in the first window, and the first window may be displayed when the electronic device displays the desktop and receives user input on the desktop.
[0034] In some embodiments of the present application, the query operation information includes query operation information corresponding to N query operation intentions; the query operation intention is the query operation intention corresponding to the query information input by the user.
[0035] For example, when the query information is "What is the weather like during the Dragon Boat Festival?", the query operation intent is to query the weather during the Dragon Boat Festival.
[0036] In some embodiments of the present application, the electronic device may perform semantic analysis on the query information input by the user to obtain query operation information.
[0037] In some embodiments of the present application, the electronic device can use a semantic analysis engine to segment the query information input by the user to obtain semantic information of the query information; then determine the user's query operation intention based on the semantic information, and then disassemble the user's query operation intention to determine N query operation intentions, thereby obtaining query operation information of N query operation intentions.
[0038] For example, when the query information input by the user is: "What's the weather like on the Dragon Boat Festival?", the semantic analysis engine can parse the query information input by the user to determine that the user's query operation intention is to query the weather on the Dragon Boat Festival, and then decompose the user's query operation intention to determine that the query operation intention corresponding to the query information is: query the date of the Dragon Boat Festival and query the weather on the Dragon Boat Festival, so as to obtain the query operation information, namely: "Check the date of the Dragon Boat Festival, check the weather on the Dragon Boat Festival".
[0039] Step 202: The electronic device generates a query file through a semantic analysis engine and application characteristics and query operation information of each application in at least two applications.
[0040] In an embodiment of the present application, the query file includes N query requests and a query order of the N query requests, each query request corresponds to one application of at least two applications, and N is an integer greater than 1.
[0041] In some embodiments of the present application, the application characteristics of the above applications can be understood as capabilities provided by the operating system to the applications. For example, the application characteristics of a calendar application are querying dates, and the application characteristics of a weather application are querying weather.
[0042] In some embodiments of the present application, the electronic device may parse the application package name and registration information within each of at least two applications through Package Manager Services (PMS) to obtain application characteristics of each of the at least two applications.
[0043] In some embodiments of the present application, the above registration information may be information registered in an Android Mainfest file.
[0044] In some embodiments of the present application, the at least two applications mentioned above may be applications selected by the user.
[0045] Exemplarily, the at least two applications mentioned above may be applications selected by the user by inputting application identifiers when the electronic device displays a desktop.
[0046] In some embodiments of the present application, the first window for inputting query information can be a window that is automatically displayed after the user selects an application, so that the user can enter query information in the first window, so that the electronic device can obtain the application characteristics of each application in at least two applications, as well as the query operation information corresponding to the query information.
[0047] In some embodiments of the present application, after the electronic device obtains the application characteristics of each application, it can pass the application characteristics of each application to the semantic analysis engine through the PMS, so that the semantic analysis engine can process the query operation information and the application characteristics of the application to generate a query file.
[0048] It should be noted that the detailed steps for generating the query file for the electronic device can be found in the description of the following embodiments and will not be repeated here.
[0049] In some embodiments of the present application, Figure 1 ,like Figure 2 As shown, the above step 202 can be specifically implemented through the following step 202a.
[0050] Step 202a: The electronic device analyzes the N query requests indicated by the query operation information through a semantic analysis engine, and determines a query order of the N query requests based on the N query requests and application characteristics of each application.
[0051] In some embodiments of the present application, the query operation information indicates N query operation intentions, and each query operation intention matches an application characteristic of one application in at least two applications.
[0052] In some embodiments of the present application, the electronic device can associate and match N query operation intentions with application characteristics of an application through a semantic analysis engine, thereby generating N query requests, each query request corresponding to a query operation intention, and each query operation intention is matched with an application.
[0053] For example: In the query operation Figure 1 To query the date of Dragon Boat Festival, the query operation means Figure 2 To query the weather for the Dragon Boat Festival, the user inputs the application characteristics of application 1 as the query date, and the user inputs the application characteristics of application 2 as the query weather. The semantic analysis engine can match the two query operation intentions with the application characteristics of the two applications, and the matching result is: the application characteristics of application 1 and the query operation intention Figure 1 Matching, application 2's application characteristics and query operation intention Figure 2 Match, resulting in two query requests: query the date of the Dragon Boat Festival through application 1, and query the weather of the Dragon Boat Festival through application 2.
[0054] In some embodiments of the present application, the electronic device may analyze application characteristics of an application corresponding to each query request to determine a query order of the N query requests.
[0055] For example, a calendar app has a date query feature, while a weather app has a weather query feature. The electronic device queries the weather for a specific day by first obtaining a date and then querying the weather for that date. This allows the electronic device to determine the order of N query requests: first querying the Dragon Boat Festival date through App 1, then querying the Dragon Boat Festival weather through App 2.
[0056] In some embodiments of the present application, the electronic device may encapsulate N query requests according to a determined query order through a semantic analysis engine to generate a query file.
[0057] In some embodiments of the present application, the query file may further include an application identifier of each of the at least two applications, for example, a domain name of the application.
[0058] For example, Figure 3 As shown, in step 1, the electronic device analyzes the application characteristics of at least two applications through the PMS, for example, the application characteristics of APP1 and APP2, that is, the application characteristics of the at least two applications mentioned above; at the same time, the electronic device executes step 2, in which the electronic device transmits the query information input by the user to the semantic analysis engine of the operating system framework layer (Framework), and parses the query information input by the user through the semantic analysis engine, analyzes the user's query operation intention, and obtains query operation information; in step 3, after the electronic device obtains the application characteristics of APP1 and APP2 through the PMS, the application characteristics of APP1 and APP2 can be transmitted to the semantic analysis engine through the PMS, and the application characteristics of the APP and the query operation information are assembled by the semantic analysis engine to obtain N query requests, such as what operation is performed first through APP1 and what operation is performed later through APP2, and then the N query requests are encapsulated into a query file through the semantic analysis engine; in step 4, the electronic device transmits the query file to the jump engine through the semantic analysis engine, which is located below the application layer and above the kernel layer and is newly added in the operating system Framework. After the jump engine parses the query file, the query file is transmitted to the first application through the jump engine.
[0059] In some embodiments of the present application, the first application is an application corresponding to the last query request among the N query requests.
[0060] In this way, since the electronic device can determine the user's query operation intention through the query information input by the user, and determine the query operation intention corresponding to each application through the application characteristics of each application in at least two applications selected by the user, N query requests can be generated, and thus a query file can be generated based on the N query requests and the query order of the N query requests, so as to obtain the target query results required by the user based on the query file, thereby improving the efficiency of data query of the electronic device.
[0061] Step 203: The electronic device transfers the query file to the first application via the jump engine.
[0062] In an embodiment of the present application, the first application is the application corresponding to the last query request among the N query requests.
[0063] In some embodiments of the present application, the electronic device can pass a query file to a jump engine. When the query file is parsed by the jump engine to include N query requests and a query order of the N query requests, the application corresponding to the last query request in the N query requests, that is, the first application mentioned above, can be obtained, thereby passing the query file to the first application through the jump engine.
[0064] For example, when at least two applications include a calendar application and a weather application, and the application corresponding to the last query request among N query requests is the weather application, the electronic device can pass the query file to the weather application through the jump engine, so that the query file is parsed by the weather application, thereby executing the query operation corresponding to the query request included in the query file.
[0065] Step 204: The electronic device parses the N query requests and query order in the query file through the first application, executes the query operations corresponding to the query requests in sequence, and obtains the query results of the query information.
[0066] In the embodiment of the present application, each query request corresponds to a query operation.
[0067] It is understandable that after the electronic device parses the query file through the first application and obtains N query requests and the query order of the N query requests included in the query file, it can sequentially execute the query operations corresponding to each query request to obtain the query results of the query information.
[0068] In some embodiments of the present application, the query file includes a query address, and the electronic device can use the query address to sequentially execute query operations corresponding to each query request to obtain query results of the query information.
[0069] In some embodiments of the present application, the query address is a data access address of an application corresponding to the query request, that is, a data query address.
[0070] In some embodiments of the present application, the above-mentioned query address is obtained by the semantic analysis engine requesting the application.
[0071] In some embodiments of the present application, when the electronic device executes the query operations corresponding to each query request in sequence, it can perform local queries, or server queries, that is, network queries; local queries can also be called local data access, and server queries can also be called network data access.
[0072] In some embodiments of the present application, when the electronic device sequentially executes query operations corresponding to each query request, local query may be performed first.
[0073] For example, Figure 4 As shown, the above-mentioned at least two applications include APP1 and APP2. The electronic device executes the query operations corresponding to each query request in turn, that is, when accessing data, there can be multiple access methods: 1. APP1 is local data access, and APP2 is network data access; 2. APP1 is local data access, and APP2 is also local data access; 3. APP1 is network data access, and APP2 is local data access; 4. APP1 is network data access, and APP2 is also network data access.
[0074] In some embodiments of the present application, the query file includes a query address corresponding to each query request, where the query address includes a local query address or a server address. The N query requests include a first query request and a second query request, with the first query request preceding the second query request in the query order. The aforementioned step 204, wherein "the electronic device sequentially executes the query operations corresponding to each query request to obtain query results for the query information," can be specifically implemented through the following steps 204a through 204c.
[0075] Step 204a: The electronic device executes a first query operation through the first application according to the first query address corresponding to the first query request to obtain a first query result.
[0076] It can be understood that after the first application parses the query file, it can obtain the above-mentioned N query requests, the query order of the N query requests and the query address of each query request in the N query requests, and then it can execute the first query operation in sequence according to the first query address corresponding to the first query request to obtain the first query result.
[0077] In some embodiments of the present application, the first query address may be a local query address or a server address.
[0078] In some embodiments of the present application, when the above-mentioned first query address is a local query address, the electronic device performs a first query operation through the first query address. When the query fails, the electronic device can access network data and perform the first query operation to obtain a first query result.
[0079] Exemplarily, when the first query address is a local query address, the first query address may be local: / / M, where local: / / M indicates access to local data of the application; or, when the first query address is a server address, the first query address may be https: / / N, where https: / / N indicates access to the server of the application.
[0080] In some embodiments of the present application, the electronic device may send the first query request to an application corresponding to the first query request to invoke the first application to perform the first query operation and obtain a first query result.
[0081] Step 204b: The electronic device embeds the first query result in the second query request.
[0082] It is understandable that after the first application obtains the first query result, it can embed the first query result into the second query request to continue to perform the second query operation.
[0083] Step 204c: The electronic device executes a second query operation through the first application according to the second query address corresponding to the second query request and based on the second query request embedded with the first query result, to obtain a second query result.
[0084] In an embodiment of the present application, the query result corresponding to the above query information includes a second query result.
[0085] Exemplarily, when the second query address is a local query address, the second query address may be local: / / P; or, when the second query address is a server address, the second query address may be https: / / X.
[0086] In some embodiments of the present application, when the N query requests include a first query request and a second query request, the second query result is a query result corresponding to the query information.
[0087] In some embodiments of the present application, when the above-mentioned N query requests include a first query request, a second query request, and a third query request, after obtaining the above-mentioned second query result, the second query result can be nested in the third query request; then, through the first application, according to the third query address corresponding to the third query request, based on the third query request nested with the second query result, a third query operation is performed to obtain a third query result, that is, a query result corresponding to the query information.
[0088] Exemplarily, the first query address and the second query address may be a combined address. For example, if the access data of the application corresponding to the first query request is A and the access data of the application corresponding to the second query request is B, the query address may be any of the following:
[0089] local: / / BA / / ;
[0090] local: / / B(https: / / A) / / ;
[0091] https: / / B(local: / / A) / / ;
[0092] https: / / BA / / .
[0093] Among them, local: / / indicates access to the local data of the application; https: / / indicates access to the application server, that is, network data.
[0094] When the query address is local: / / BA / / , it means that the local data of the first application is accessed first to perform the first query operation, and then the local data of the second application is accessed to perform the second query operation;
[0095] When the query address is local: / / B(https: / / A) / / , it means that the server of the first application is accessed first to perform the first query operation, and then the local data of the second application is accessed to perform the second query operation;
[0096] When the query address is https: / / B(local: / / A) / / , it means first accessing the local data of the first application to perform the first query operation, and then accessing the server of the second application to perform the second query operation;
[0097] When the query address is https: / / BA / / , it means that the server of the first application is accessed first, the first query operation is performed, and then the server of the second application is accessed to perform the second query operation.
[0098] In this way, since the electronic device can first execute the first query operation according to the first query address corresponding to the first query request to obtain the first query result, and then nest the first query result into the second query request to continue to execute the second query operation to obtain the query result corresponding to the query information, the efficiency of data query of the electronic device is improved.
[0099] In some embodiments of the present application, when each of the above-mentioned N query requests corresponds to a query operation intention, and each query operation intention matches the same application, the generated query file may include only one query address, that is, the above-mentioned N query operations are executed through this query address.
[0100] For example, when the semantic analysis engine analyzes the application characteristics of the calendar application and the weather application and finds that the weather application can check both the date and the weather, a query address can be generated to query the date and weather of the Dragon Boat Festival through the query address.
[0101] For example, the query address may be: https: / / weather / X?="Dragon Boat Festival"; where "X" represents a date, "X?" represents that the date of Dragon Boat Festival is unknown, and "https: / / weather / X?="'Dragon Boat Festival'" represents that both the date and weather of Dragon Boat Festival are queried through this address.
[0102] In some embodiments of the present application, the above-mentioned first query address includes the first server address of the second application corresponding to the first query request; the "electronic device executes the first query operation according to the first query address corresponding to the first query request to obtain the first query result" in the above-mentioned step 204a can be specifically implemented through the following step 204a1.
[0103] Step 204a1: The electronic device sends a first query request to the server of the second application based on the first server address, and receives a first query result sent by the server of the second application.
[0104] In some embodiments of the present application, the first query result is a query result corresponding to the first query request.
[0105] In some embodiments of the present application, the electronic device can pass the query file to the server of the first application through the first application, and then the server of the first application can obtain the first server address of the second application corresponding to the first query request in the query file, and send the first query request to the server of the second application based on the first server address. After the server of the second application obtains the first query result based on the first query request, the server of the second application can send the first query result to the server of the first application.
[0106] In some embodiments of the present application, the first server address of the second application may be the domain name of the second application.
[0107] In this way, the electronic device can directly perform query operations through the application server, further reducing power consumption and traffic consumption.
[0108] In some embodiments of the present application, the above-mentioned second query address includes the second server address of the third application corresponding to the second query request; in the above-mentioned step 204c, "the electronic device executes the second query operation according to the second query address corresponding to the second query request, based on the second query request nested with the first query result, to obtain the second query result" can be specifically implemented through the following step 204c1.
[0109] Step 204c1: The electronic device sends a second query request embedded with the first query result to the server of the third application according to the second server address, and receives the second query result sent by the server of the third application.
[0110] In some embodiments of the present application, the second query result is a query result corresponding to the second query request.
[0111] In some embodiments of the present application, when the first application and the third application are different, after the electronic device receives the first query result through the server of the first application, it can continue to obtain the second server address of the third application corresponding to the second query request in the query file, and send a second query request to the server of the third application through the server of the first application. After the server of the third application obtains the second query result based on the second query request, the server of the third application can send the second query result to the server of the first application.
[0112] In some embodiments of the present application, when the first application and the third application are the same, after the electronic device receives the first query result through the server of the first application, it can continue to obtain the second server address of the third application corresponding to the second query request in the query file, that is, the server address of the first application, and then perform a query within the server through the server of the first application to obtain the above-mentioned second query result.
[0113] For example, Figure 5 As shown, the at least two applications include APP1 and APP2, i.e., the second application and the first application. Step 1: The electronic device can transmit a query file to APP2's server via APP2. Step 2: APP2's server resolves the domain name address of the first application to determine APP1's server. Then, APP2's server directly sends a first query request to APP1's server. Step 3: APP2's server obtains the first query result and embeds the first query result in a second query request. Step 4: APP2's server executes a second query operation based on the first query result to obtain a second query result. APP2's server then transmits the second query result to APP2. This reduces power consumption and data traffic.
[0114] In some embodiments of the present application, in the above step 204, "the electronic device sequentially executes the query operations corresponding to the query requests to obtain the query results of the query information" can be specifically implemented through the following steps 204d and 204e.
[0115] Step 204d: The electronic device generates a query processing thread based on the N query requests through the first application according to the parsed query order.
[0116] In some embodiments of the present application, the electronic device may generate a query processing thread through an operating system Framework layer thread pool (ThreadPool).
[0117] Step 204e: The electronic device sequentially executes the query operations corresponding to the query requests through the query processing thread to obtain the query results corresponding to the query information.
[0118] In some embodiments of the present application, since the electronic device parses the query file through the first application, and then executes the query operations corresponding to each query request in sequence through the first application to obtain the query results of the query information, when executing the query operation, the query operation can be executed only through one query processing thread, and there is no need to start a thread each time a query operation is executed, thereby reducing the power consumption of the electronic device.
[0119] For example, Figure 6 As shown, in step 1, after the electronic device parses the query file through the first application, it knows that it needs to execute the first query operation first. At this time, the electronic device can notify the thread pool to start the query processing thread and notify the thread pool that this query is a nested query; step 2, the thread pool starts the query processing thread, and the electronic device executes the first query operation through the query processing thread; step 3, after obtaining the first query result, the thread pool knows based on the notification that the electronic device also needs to execute the second query operation, so it does not need to destroy the query processing thread, that is, retain the query processing thread, and the electronic device executes the second query operation based on the query processing thread; step 4, after obtaining the second query result, the thread pool closes the first thread and releases system resources. In this way, the power consumption of the electronic device is reduced.
[0120] In the data query method provided by the embodiment of the present application, after the user inputs the query information, the electronic device can perform semantic analysis on the query information input by the user through the semantic analysis engine to obtain query operation information; and generate a query file through the semantic analysis engine and the application characteristics of each application in at least two applications and the above-mentioned query operation information, and then pass the generated query file to the first application corresponding to the last query request among N query requests through the jump engine; therefore, the N query requests and query order in the query file can be parsed through the first application, and the query operations corresponding to each query request can be executed in sequence to obtain the query results of the query information input by the user, without the user having to manually open at least two applications for querying, thereby improving the efficiency of data query of the electronic device.
[0121] Figure 7 A possible structural diagram of the data query device involved in the embodiment of the present application is shown. Figure 7 As shown, the data query device 70 may include: a processing module 71 , a generating module 72 and a transmitting module 73 .
[0122] The processing module 71 is used to perform semantic analysis on the query information input by the user through a semantic analysis engine to obtain query operation information.
[0123] The generation module 72 is used to generate a query file based on the query operation information obtained by processing the semantic analysis engine and the application characteristics of each application in at least two applications and the processing module 71. The query file includes N query requests and a query order of N query requests. Each query request corresponds to one application in at least two applications, and N is an integer greater than 1.
[0124] The delivery module 73 is further configured to deliver the query file generated by the generation module 72 to the first application via the jump engine, where the first application is the application corresponding to the last query request among the N query requests;
[0125] The processing module 71 is further configured to parse, through the first application, the N query requests and query order in the query file transmitted by the transmission module 73, and sequentially execute the query operations corresponding to the query requests to obtain query results of the query information.
[0126] An embodiment of the present application provides a data query device. After a user inputs query information, the data query device can perform semantic analysis on the query information input by the user through a semantic analysis engine to obtain query operation information; and generate a query file through the semantic analysis engine and the application characteristics of each application in at least two applications and the above-mentioned query operation information, and then pass the generated query file to the first application corresponding to the last query request among N query requests through a jump engine; therefore, the N query requests and query order in the query file can be parsed through the first application, and the query operations corresponding to each query request can be executed in sequence to obtain the query results of the query information input by the user, without the user having to manually open at least two applications for querying, thereby improving the efficiency of data query of the data query device.
[0127] In a possible implementation, the generation module 72 is specifically configured to analyze the N query requests indicated by the query operation information through a semantic analysis engine, and determine a query order of the N query requests based on the N query requests and application characteristics of each application.
[0128] In one possible implementation, the query file includes a query address corresponding to each query request, where the query address includes a local query address or a server address; the N query requests include a first query request and a second query request, and the first query request precedes the second query request in the query order;
[0129] Processing module 71 is specifically used to execute a first query operation through a first application according to a first query address corresponding to a first query request to obtain a first query result; and nest the first query result in a second query request; and execute a second query operation through the first application according to a second query address corresponding to the second query request based on the second query request in which the first query result is nested to obtain a second query result; wherein the query result corresponding to the query information includes the second query result.
[0130] In one possible implementation, the first query address includes the first server address of the second application corresponding to the first query request; the processing module 71 is specifically used to send the first query request to the server of the second application based on the first server address, and receive the first query result sent by the server of the second application, where the first query result is the query result corresponding to the first query request.
[0131] In one possible implementation, the second query address includes the second server address of the third application corresponding to the second query request; the processing module 71 is specifically used to send the second query request nested with the first query result to the server of the third application according to the second server address, and receive the second query result sent by the server of the third application, where the second query result is the query result corresponding to the second query request.
[0132] In one possible implementation, generation module 72 is further configured to generate, via the first application, a query processing thread based on the N query requests according to the parsed query order. Processing module 71 is specifically configured to sequentially execute query operations corresponding to each query request via the query processing thread generated by generation module 72 to obtain query results corresponding to the query information.
[0133] The data query device in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or other devices other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a palmtop computer, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (Augmented Reality, AR) / virtual reality (Virtual Reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (Ultra-Mobile Personal Computer, UMPC), a netbook or a personal digital assistant (Personal Digital Assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (Personal Computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., and the embodiment of the present application is not specifically limited.
[0134] The data query device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0135] The data query device provided in the embodiment of the present application can implement each process implemented in the above method embodiment. To avoid repetition, it will not be described here.
[0136] Alternatively, as Figure 8 As shown, an embodiment of the present application also provides an electronic device 900, including a processor 901 and a memory 902, wherein the memory 902 stores a program or instruction that can be run on the processor 901, and when the program or instruction is executed by the processor 901, the various steps of the above-mentioned method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0137] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.
[0138] Figure 9 A schematic diagram of the hardware structure of an electronic device implementing an embodiment of the present application.
[0139] The electronic device 100 includes but is not limited to components such as a radio frequency unit 101 , a network module 102 , an audio output unit 103 , an input unit 104 , a sensor 105 , a display unit 106 , a user input unit 107 , an interface unit 108 , a memory 109 , and a processor 110 .
[0140] Those skilled in the art will understand that the electronic device 100 may also include a power source (such as a battery) to power each component, and the power source may be logically connected to the processor 110 through a power management system, thereby implementing functions such as charging, discharging, and power consumption management through the power management system. Figure 9 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be repeated here.
[0141] Among them, the processor 110 is used to perform semantic analysis on the query information input by the user through the semantic analysis engine to obtain query operation information; and generate a query file through the semantic analysis engine and the application characteristics and query operation information of each application in at least two applications, the query file including N query requests and a query order of N query requests, each query request corresponds to one application in at least two applications, and N is an integer greater than 1; and pass the query file to the first application through the jump engine, the first application being the application corresponding to the last query request among the N query requests; and through the first application, parse the N query requests and query order in the query file, execute the query operations corresponding to each query request in turn, and obtain the query results of the query information.
[0142] An embodiment of the present application provides an electronic device. After a user inputs query information, the electronic device can perform semantic analysis on the query information input by the user through a semantic analysis engine to obtain query operation information; and generate a query file through the semantic analysis engine and the application characteristics of each application in at least two applications and the above-mentioned query operation information, and then pass the generated query file to the first application corresponding to the last query request among N query requests through a jump engine; therefore, the N query requests and query order in the query file can be parsed through the first application, and the query operations corresponding to each query request can be executed in sequence to obtain the query results of the query information input by the user, without the user having to manually open at least two applications for querying, thereby improving the efficiency of data query of the electronic device.
[0143] In some embodiments of the present application, the processor 110 is specifically configured to analyze the N query requests indicated by the query operation information through a semantic analysis engine, and determine a query order of the N query requests based on the N query requests and application characteristics of each application.
[0144] In some embodiments of the present application, the query file includes a query address corresponding to each query request, and the query address includes a local query address or a server address; the N query requests include a first query request and a second query request, and the first query request is before the second query request in the query order; the processor 110 is specifically used to execute a first query operation through a first application according to a first query address corresponding to the first query request, to obtain a first query result; and nest the first query result in a second query request; and execute a second query operation through the first application according to a second query address corresponding to the second query request, based on the second query request nested with the first query result, to obtain a second query result; wherein the query result corresponding to the query information includes the second query result.
[0145] In some embodiments of the present application, the first query address includes the first server address of the second application corresponding to the first query request; the processor 110 is specifically used to send the first query request to the server of the second application based on the first server address, and receive the first query result sent by the server of the second application, where the first query result is the query result corresponding to the first query request.
[0146] In some embodiments of the present application, the second query address includes the second server address of the third application corresponding to the second query request; the processor 110 is specifically used to send a second query request nested with the first query result to the server of the third application according to the second server address, and receive the second query result sent by the server of the third application, where the second query result is the query result corresponding to the second query request.
[0147] In some embodiments of the present application, the processor 110 is further configured to generate a query processing thread based on the N query requests according to the parsed query order through the first application.
[0148] The processor 110 is specifically configured to sequentially execute query operations corresponding to each query request through a query processing thread to obtain a query result corresponding to the query information.
[0149] The electronic device provided in the embodiment of the present application can implement each process implemented in the above method embodiment and can achieve the same technical effect. To avoid repetition, it will not be described here.
[0150] The beneficial effects of various implementations in this embodiment can be specifically referred to the beneficial effects of the corresponding implementations in the above method embodiment. To avoid repetition, they will not be described here.
[0151] It should be understood that in an embodiment of the present application, the input unit 104 may include a graphics processing unit (GPU) 1041 and a microphone 1042, and the graphics processor 1041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 106 may include a display panel 1061, and the display panel 1061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 107 includes a touch panel 1071 and at least one of other input devices 1072. The touch panel 1071 is also called a touch screen. The touch panel 1071 may include two parts: a touch detection device and a touch controller. Other input devices 1072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and an operating stick, which will not be repeated here.
[0152] The memory 109 can be used to store software programs and various data. The memory 109 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, applications or instructions required for at least one function (such as a sound playback function, an image playback function, etc.). In addition, the memory 109 may include a volatile memory or a non-volatile memory, or the memory 109 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM), and a direct memory bus random access memory (DRRAM). The memory 109 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.
[0153] Processor 110 may include one or more processing units. Optionally, processor 110 integrates an application processor and a modem processor. The application processor primarily handles operations related to the operating system, user interface, and application programs, while the modem processor primarily processes wireless communication signals, such as a baseband processor. It is understood that the modem processor may not be integrated into processor 110.
[0154] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of the above-mentioned method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0155] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0156] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned method embodiment and achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0157] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0158] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0159] It should be noted that, in this article, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element. In addition, it should be noted that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in the opposite order according to the functions involved. For example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0160] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), including a number of instructions for enabling a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0161] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of this application, ordinary technicians in this field can also make many forms without departing from the purpose of this application and the scope of protection of the claims, all of which are within the protection of this application.
Claims
1. A data query method, characterized in that: The method comprises: The semantic analysis engine performs semantic analysis on the query information input by the user to obtain query operation information; Generate a query file using the semantic analysis engine and application characteristics of each of the at least two applications and the query operation information, the query file including N query requests and a query order of the N query requests, each query request corresponding to one of the at least two applications, where N is an integer greater than 1; Passing the query file to a first application through a jump engine, where the first application is an application corresponding to the last query request among the N query requests; The N query requests and the query order in the query file are parsed by the first application, and query operations corresponding to the query requests are executed in sequence to obtain query results of the query information.
2. The method according to claim 1, characterized in that The step of generating a query file by using the semantic analysis engine, the application characteristics of each of the at least two applications, and the query operation information includes: The semantic analysis engine analyzes the N query requests indicated by the query operation information, and determines a query order of the N query requests according to the N query requests and application characteristics of each application.
3. The method according to claim 1, characterized in that The query file includes a query address corresponding to each query request, and the query address includes a local query address or a server address; The N query requests include a first query request and a second query request, and the first query request is before the second query request in the query order; The step of sequentially executing the query operations corresponding to the query requests to obtain the query results of the query information includes: executing, by the first application, a first query operation according to a first query address corresponding to the first query request, to obtain a first query result; nesting the first query result in the second query request; executing, by the first application, a second query operation according to a second query address corresponding to the second query request and based on the second query request embedded with the first query result, to obtain a second query result; The query result corresponding to the query information includes the second query result.
4. The method according to claim 3, characterized in that The first query address includes a first server address of a second application corresponding to the first query request; The performing a first query operation according to the first query address corresponding to the first query request to obtain a first query result includes: The first query request is sent to the server of the second application based on the first server address, and a first query result sent by the server of the second application is received, where the first query result is a query result corresponding to the first query request.
5. The method according to claim 3 or 4, characterized in that The second query address includes a second server address of a third application corresponding to the second query request; The step of performing a second query operation according to a second query address corresponding to the second query request and based on the second query request embedded with the first query result to obtain a second query result includes: The second query request containing the first query result is sent to the server of the third application according to the second server address, and the second query result sent by the server of the third application is received, where the second query result is the query result corresponding to the second query request.
6. The method according to claim 1, characterized in that The step of sequentially executing the query operations corresponding to the query requests to obtain the query results of the query information includes: generating, by the first application, a query processing thread based on the N query requests in accordance with the parsed query order; The query processing thread sequentially executes the query operations corresponding to the query requests to obtain the query results corresponding to the query information.
7. A data query device, characterized in that: The device includes: a processing module, a generating module and a transmitting module; The processing module is used to perform semantic analysis on the query information input by the user through the semantic analysis engine to obtain query operation information; The generation module is configured to generate a query file using the semantic analysis engine and the application characteristics of each of the at least two applications and the query operation information processed by the processing module, wherein the query file includes N query requests and a query order of the N query requests, each query request corresponding to one of the at least two applications, where N is an integer greater than 1; The transfer module is further configured to transfer the query file generated by the generation module to a first application through a jump engine, where the first application is an application corresponding to the last query request among the N query requests; The processing module is further configured to parse, through the first application, the N query requests and the query order in the query file transmitted by the transmission module, and sequentially execute query operations corresponding to the query requests to obtain query results of the query information.
8. The device according to claim 7, characterized in that The query file includes a query address corresponding to each query request, and the query address includes a local query address or a server address; The N query requests include a first query request and a second query request, and the first query request is before the second query request in the query order; The processing module is specifically configured to execute a first query operation through the first application according to a first query address corresponding to the first query request to obtain a first query result; and nesting the first query result in the second query request; and performing, by the first application, a second query operation according to a second query address corresponding to the second query request and based on the second query request embedded with the first query result, to obtain a second query result; The query result corresponding to the query information includes the second query result.
9. The device according to claim 8, characterized in that The first query address includes a first server address of a second application corresponding to the first query request; The processing module is specifically configured to send the first query request to the server of the second application based on the first server address, and receive a first query result sent by the server of the second application, where the first query result is a query result corresponding to the first query request.
10. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the data query method according to any one of claims 1 to 6 are implemented.
11. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by the processor, the steps of the data query method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Cross-platform unified big data SQL query method
CN110059103A
Application - based query transformations
US20220300507A1