Attribute query method and device, computer equipment and computer readable storage medium
By identifying and processing the attribute query method of virtual attribute expressions, the problem of inflexible and inefficient attribute query in the prior art is solved, and a more flexible and efficient attribute query function is achieved.
Patent Information
- Application Number
- CN202411663526.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-20
- Publication Date
- 2025-03-14
AI Technical Summary
The existing multidimensional big data analysis platform has poor functions in attribute query and cannot customize query virtual attributes, resulting in inflexible query functions and low efficiency. The existing attribute dimension query is complex, making it difficult to meet the complex attribute calculations of different application scenarios.
Provides an attribute query method. By identifying the target attribute identifier, if it is a virtual attribute, the virtual attribute expression is queried in the database and the statement is processed, a statement to be queried is generated, the statement is executed to obtain the query result, and the result is sent to the user terminal.
By customizing virtual attributes, users can perform analysis and query more flexibly, avoid selecting multiple basic attributes, improve query efficiency, and maintaining virtual attributes to meet complex attribute calculations in different application scenarios, making attribute query more flexible and efficient.
Smart Images

Figure CN119622056A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of smart medical care, and in particular to an attribute query method, device, computer equipment, and computer-readable storage medium. Background Art
[0002] With the rapid development of computer data processing technology, the requirements for attribute query on multi-dimensional big data analysis platforms are getting higher and higher. In real life, the application scenarios of attributes are quite extensive. For example, a drug sales system pays more attention to female consumers who spend more than 200 yuan on a certain drug per month. In this case, a virtual attribute can be established in the membership system to quickly screen and analyze these users and their behavior data through virtual attributes. Among them, attributes include basic attributes and virtual attributes. Virtual attributes refer to a new comprehensive indicator formed by custom calculations of multiple basic attributes based on basic attributes, such as relational operations, logical operations, and regular matching.
[0003] In the related art, traditional multi-dimensional big data analysis platforms perform queries based on a single basic attribute or multiple basic attributes together. However, the applicants realized that it is difficult to customize the query of virtual attributes according to the actual scenario requirements in this way, which makes the query function of the analysis platform weak. In addition, the existing attribute dimension query is quite complex and cannot meet the calculation of complex attributes in different application scenarios, resulting in inflexible and inefficient attribute query. Summary of the invention
[0004] In view of this, the present application provides an attribute query method, apparatus, computer device and computer-readable storage medium, the main purpose of which is to solve the problem that the query function of the analysis platform is not strong, and the existing attribute dimension query is quite complex and cannot meet the calculation of complex attributes in different application scenarios, resulting in the problem that the attribute query is not flexible enough and the efficiency is low.
[0005] According to a first aspect of the present application, a property query method is provided, the method comprising:
[0006] In response to an attribute query request, obtaining a target attribute field carried in the attribute query request, determining a target attribute identifier corresponding to the target attribute field, and identifying the target attribute identifier;
[0007] When it is identified that the target attribute identifier indicates that the target attribute field is a virtual attribute, querying a database for a virtual attribute expression corresponding to the target attribute field, and performing a statement processing operation on the virtual attribute expression to obtain a statement to be queried;
[0008] The query statement is executed to obtain a target attribute query result, and the target attribute query result is sent to a terminal held by a user who initiates the attribute query request.
[0009] Optionally, before obtaining the target attribute field carried in the attribute query request in response to the attribute query request, the method further includes:
[0010] In response to a virtual attribute setting request, target virtual attribute setting information and a plurality of target basic attributes are obtained, wherein the target virtual attribute setting information includes a target attribute type, the target attribute type corresponds to a selection event, and each of the target basic attributes corresponds to a target operator;
[0011] Obtain a statement conversion tool, use the statement conversion tool to convert the multiple target basic attributes into multiple target character strings, use the statement conversion tool to convert the target operator corresponding to each of the target basic attributes into a logical operator, and obtain the logical operator corresponding to each of the target character strings;
[0012] Based on the logical operator corresponding to each of the target strings, the multiple target strings are concatenated to obtain a virtual attribute expression to be stored;
[0013] A virtual attribute identifier is obtained, the virtual attribute identifier is used to mark the virtual attribute expression to be stored, and the marked virtual attribute expression to be stored and the target virtual attribute setting information are stored in the database, wherein the virtual attribute identifier is used to indicate that the attribute category corresponding to the virtual attribute expression to be stored is a virtual attribute.
[0014] Optionally, the obtaining of target virtual attribute setting information and a plurality of target basic attributes includes:
[0015] Acquire the virtual attribute setting information selected by the user based on the terminal held by the user as the target virtual attribute setting information;
[0016] Determine a plurality of preset basic attributes, and determine a plurality of preset operators corresponding to each of the preset basic attributes;
[0017] A plurality of preset basic attributes selected by the user based on the terminal held by the user are determined from among the plurality of preset basic attributes as the plurality of target basic attributes, and a preset operator selected by the user based on the terminal held by the user is determined from among the plurality of preset operators corresponding to each of the target basic attributes as the target operator corresponding to each of the target basic attributes.
[0018] Optionally, after identifying the target attribute identifier, the method further includes:
[0019] When it is identified that the target attribute identifier indicates that the target attribute field is a basic attribute, a query operation is performed in the database using the target attribute field to obtain a first attribute query result, and the first attribute query result is sent to the terminal held by the user.
[0020] Optionally, the querying of the virtual attribute expression corresponding to the target attribute field in the database, and performing statement processing operation on the virtual attribute expression to obtain the statement to be queried, includes:
[0021] Obtaining a preset configuration table in the database, and reading a virtual attribute expression corresponding to the target attribute field in the preset configuration table, wherein the preset configuration table is used to store a plurality of virtual attribute expressions and each virtual attribute expression stored in the preset configuration table corresponds to an attribute field;
[0022] Obtaining the alias field carried in the attribute query request and obtaining a preset concatenation statement;
[0023] The preset concatenation statement is used to sort the alias field and the virtual attribute expression to obtain the statement to be queried.
[0024] Optionally, the method further comprises:
[0025] In response to an attribute dimension query request, obtaining a specified attribute type carried in the attribute dimension query request, and determining a selection event corresponding to the specified attribute type;
[0026] Obtaining a preset grouping statement, using the preset grouping statement to read a plurality of target data corresponding to the specified attribute type in the database, and determining the target data indicated by the selection event as a second attribute query result from the plurality of target data;
[0027] Determine the user who initiated the attribute dimension query request, and send the second attribute query result to the terminal held by the user.
[0028] Optionally, the method further comprises:
[0029] In response to the attribute information modification request, obtaining the identifier of the information to be modified carried in the attribute information modification request;
[0030] Reading target attribute configuration information corresponding to the information identifier to be modified in the database, and sending the target attribute configuration information to a terminal held by a user who initiates the attribute information modification request;
[0031] When the adjusted target attribute configuration information fed back by the user based on the terminal held by the user is obtained, the adjusted target attribute configuration information is used as the attribute configuration information to be updated;
[0032] Acquire an attribute identifier, use the attribute identifier to mark the attribute configuration information to be updated, and store the marked attribute configuration information to be updated in the database, wherein the attribute identifier is used to indicate whether the attribute category corresponding to the target attribute configuration information is a basic attribute or a virtual attribute.
[0033] According to a second aspect of the present application, there is provided an attribute query device, the device comprising:
[0034] an identification module, configured to, in response to an attribute query request, obtain a target attribute field carried in the attribute query request, determine a target attribute identifier corresponding to the target attribute field, and identify the target attribute identifier;
[0035] A processing module, configured to, when it is identified that the target attribute identifier indicates that the target attribute field is a virtual attribute, query the database for a virtual attribute expression corresponding to the target attribute field, and perform statement processing operations on the virtual attribute expression to obtain a statement to be queried;
[0036] The first query module is used to execute the query statement to obtain a target attribute query result, and send the target attribute query result to a terminal held by a user who initiates the attribute query request.
[0037] Optionally, the processing module is used to obtain a preset configuration table in the database, read the virtual attribute expression corresponding to the target attribute field in the preset configuration table, the preset configuration table is used to store multiple virtual attribute expressions and each virtual attribute expression stored in the preset configuration table corresponds to an attribute field; obtain the alias field carried by the attribute query request, and obtain a preset concatenation statement; use the preset concatenation statement to sort the alias field and the virtual attribute expression to obtain the statement to be queried.
[0038] Optionally, the device further comprises:
[0039] A setting module is used to respond to a virtual attribute setting request, obtain target virtual attribute setting information and multiple target basic attributes, wherein the target virtual attribute setting information includes a target attribute type, the target attribute type corresponds to a selection event, and each of the target basic attributes corresponds to a target operator; obtain a statement conversion tool, use the statement conversion tool to convert the multiple target basic attributes into multiple target strings, use the statement conversion tool to convert the target operator corresponding to each of the target basic attributes into a logical operator, and obtain the logical operator corresponding to each of the target strings; based on the logical operator corresponding to each of the target strings, splice the multiple target strings to obtain a virtual attribute expression to be stored; obtain a virtual attribute identifier, use the virtual attribute identifier to mark the virtual attribute expression to be stored, and store the marked virtual attribute expression to be stored and the target virtual attribute setting information in the database, the virtual attribute identifier is used to indicate that the attribute category corresponding to the virtual attribute expression to be stored is a virtual attribute.
[0040] The second query module is used to perform a query operation in the database using the target attribute field when it is recognized that the target attribute identifier indicates that the target attribute field is a basic attribute, obtain a first attribute query result, and send the first attribute query result to the terminal held by the user.
[0041] The third query module is used to respond to an attribute dimension query request, obtain the specified attribute type carried by the attribute dimension query request, and determine the selection event corresponding to the specified attribute type; obtain a preset grouping statement, use the preset grouping statement to read multiple target data corresponding to the specified attribute type in the database, and determine the target data indicated by the selection event in the multiple target data as the second attribute query result; determine the user who initiated the attribute dimension query request, and send the second attribute query result to the terminal held by the user.
[0042] A modification module is used to respond to an attribute information modification request, obtain an information identifier to be modified carried by the attribute information modification request; read target attribute configuration information corresponding to the information identifier to be modified in the database, and send the target attribute configuration information to the terminal held by the user who initiated the attribute information modification request; when the adjusted target attribute configuration information based on the feedback from the terminal held by the user is obtained, use the adjusted target attribute configuration information as the attribute configuration information to be updated; obtain an attribute identifier, use the attribute identifier to mark the attribute configuration information to be updated, and store the marked attribute configuration information to be updated in the database, wherein the attribute identifier is used to indicate whether the attribute category corresponding to the target attribute configuration information is a basic attribute or a virtual attribute.
[0043] Optionally, the setting module is used to obtain virtual attribute setting information selected by the user based on the terminal held as the target virtual attribute setting information; determine multiple preset basic attributes, and determine multiple preset operators corresponding to each of the preset basic attributes; determine the multiple preset basic attributes selected by the user based on the terminal held as the multiple target basic attributes among the multiple preset basic attributes, and determine the preset operator selected by the user based on the terminal held as the target operator corresponding to each of the target basic attributes among the multiple preset operators corresponding to each of the target basic attributes.
[0044] According to a third aspect of the present application, a computer device is provided, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any one of the methods described in the first aspect when executing the computer program.
[0045] According to a fourth aspect of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of any one of the methods described in the first aspect are implemented.
[0046] By means of the above technical scheme, the present application provides an attribute query method, apparatus, computer equipment and computer-readable storage medium. The present application responds to an attribute query request, obtains a target attribute field carried by the attribute query request, determines a target attribute identifier corresponding to the target attribute field, and identifies the target attribute identifier. When it is identified that the target attribute identifier indicates that the target attribute field is a virtual attribute, the virtual attribute expression corresponding to the target attribute field is queried in the database, and a statement processing operation is performed on the virtual attribute expression to obtain a statement to be queried, execute the statement to be queried, obtain a target attribute query result, and send the target attribute query result to a terminal held by a user who initiates the attribute query request. By customizing virtual attributes, users can use virtual attributes more flexibly for analysis and query, without selecting multiple basic attributes, thereby improving query efficiency. Moreover, by maintaining virtual attributes, it can meet the calculation of complex attributes in different application scenarios, making attribute query more flexible and efficient.
[0047] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present application. Also, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0049] Figure 1 A schematic diagram of a flow chart of an attribute query method provided in an embodiment of the present application is shown;
[0050] Figure 2A A schematic diagram of a flow chart of an attribute query method provided in an embodiment of the present application is shown;
[0051] Figure 2B A schematic diagram of the structure of attribute configuration information provided by an embodiment of the present application is shown;
[0052] Figure 2C A schematic diagram of attribute configuration information provided by an embodiment of the present application is shown;
[0053] Figure 2D A schematic diagram of an architecture for creating virtual attributes provided by an embodiment of the present application is shown;
[0054] Figure 2E A schematic diagram of event attributes provided by an embodiment of the present application is shown;
[0055] Figure 2F A schematic diagram of a flow chart of an attribute query method provided in an embodiment of the present application is shown;
[0056] Figure 3A A schematic diagram of the structure of an attribute query provided by an embodiment of the present application is shown;
[0057] Figure 3B A schematic diagram of the structure of an attribute query provided by an embodiment of the present application is shown;
[0058] Figure 4 A schematic diagram of the device structure of a computer device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0059] The exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present application and to fully convey the scope of the present application to those skilled in the art.
[0060] The present application embodiment provides a property query method, such as Figure 1 As shown, the method includes:
[0061] 101. In response to an attribute query request, obtain a target attribute field carried in the attribute query request, determine a target attribute identifier corresponding to the target attribute field, and identify the target attribute identifier.
[0062] In traditional multi-dimensional big data analysis platforms, it is difficult for users to perform queries based on actual usage scenario requirements, and queries on actual attribute dimensions are also quite complex, requiring users to perform associated queries through multiple dimension tables such as default attributes, user attributes, public attributes, user tags, etc., resulting in low query efficiency and accuracy.
[0063] To solve this problem, the present application proposes an attribute query method, in which the user pre-sets virtual attributes, and then determines the virtual attribute expression through the virtual attributes and then performs the query, so that the user only needs to select one virtual attribute each time for query, and the user does not need to select too many basic attributes for query, thereby improving the query efficiency. The execution subject of the present application can be an attribute query system, which provides a front-end application for the user, that is, provides a client, and the user (such as a staff member) can perform attribute query based on the front-end application request, so that the attribute query system provides services to the user based on the computing power of the server. The server can be an independent server, or it can provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms and other basic cloud computing servers, so that the attribute query system can set and maintain virtual attributes and improve the query efficiency of attributes.
[0064] In an embodiment of the present application, the attribute query system responds to the attribute query request and obtains the target attribute field carried by the attribute query request. For example, if a user queries for consumers who have medical consumption within a month, he can enter recent consumption in the attribute query system and request an attribute query, and the attribute query system will respond to the attribute query request and obtain the target attribute field entered by the user, that is, the recent consumption field. Next, the attribute query system determines the target attribute identifier corresponding to the target attribute field and identifies the target attribute identifier. For example, the attribute query system identifies the attribute identifier corresponding to the recent consumption field and determines whether the field belongs to a basic attribute or a virtual attribute. In this way, the attribute query system can adopt different query methods based on different attribute identifiers, which can not only improve the query accuracy, but also improve the efficiency of the attribute query.
[0065] 102. When it is identified that the target attribute identifier indicates that the target attribute field is a virtual attribute, a virtual attribute expression corresponding to the target attribute field is queried in a database, and a statement processing operation is performed on the virtual attribute expression to obtain a statement to be queried.
[0066] Virtual attributes refer to a new calculated comprehensive index formed by custom calculations such as relational operations, logical operations, regular matching, etc. on the basis of basic attributes. Therefore, users can establish virtual attributes according to actual application scenarios, making it more convenient to query and filter through virtual attributes, and also improving the query analysis function of the attribute query system. In an embodiment of the present application, when the attribute query system recognizes that the target attribute identifier indicates that the target attribute field is a virtual attribute, it will query the virtual attribute expression corresponding to the target attribute field in the database, and perform statement processing operations on the virtual attribute expression to obtain the query statement. For example, if the attribute query system determines that recent consumption is a virtual attribute, it will query the virtual attribute expression corresponding to the virtual attribute in the database, that is, drug price * drug quantity + inspection price * number of inspections + registration price * number of registrations, and then convert the virtual expression into SQL (Structured Query Language, database language) statement, so that the attribute query system can quickly query.
[0067] 103. Execute the query statement to obtain a target attribute query result, and send the target attribute query result to a terminal held by a user who initiates the attribute query request.
[0068] In the embodiment of the present application, the attribute query system executes the query statement to be queried, obtains the target attribute query result, and sends the target attribute query result to the terminal held by the user who initiated the attribute query request. For example, the attribute query system obtains and executes the SQL statement, and will filter out the list of consumers who have made medical consumption within one month and the specific medical consumption items in the database. In this way, users can more flexibly use virtual attributes to meet their own complex business analysis queries, and generate a virtual attribute for some frequently queried indicator filtering conditions, without having to select multiple basic attributes each time they query, thereby improving the user's query efficiency.
[0069] The method provided in the embodiment of the present application responds to an attribute query request, obtains a target attribute field carried by the attribute query request, determines a target attribute identifier corresponding to the target attribute field, and identifies the target attribute identifier. When it is identified that the target attribute identifier indicates that the target attribute field is a virtual attribute, a virtual attribute expression corresponding to the target attribute field is queried in a database, and a statement processing operation is performed on the virtual attribute expression to obtain a statement to be queried, execute the statement to be queried, obtain a target attribute query result, and send the target attribute query result to a terminal held by a user who initiates the attribute query request. By customizing virtual attributes, users can use virtual attributes more flexibly for analysis and query, without selecting multiple basic attributes, thereby improving query efficiency. Moreover, by maintaining virtual attributes, it is possible to meet the calculation of complex attributes in different application scenarios, making attribute query more flexible and efficient.
[0070] Further, as a refinement and extension of the specific implementation of the above embodiment, in order to fully illustrate the specific implementation process of this embodiment, the embodiment of the present application provides another attribute query method, such as Figure 2A As shown, the method includes:
[0071] 201. In response to an attribute query request, obtain a target attribute field carried in the attribute query request, determine a target attribute identifier corresponding to the target attribute field, and identify the target attribute identifier; when it is identified that the target attribute identifier indicates that the target attribute field is a basic attribute, execute the following step 202; when it is identified that the target attribute identifier indicates that the target attribute field is a virtual attribute, execute the following step 203.
[0072] In an embodiment of the present application, the attribute query system responds to the attribute query request and obtains the target attribute field carried by the attribute query request, such as the usage of each drug, the drug supplier, etc. Next, the attribute query system determines the target attribute identifier corresponding to the target attribute field and identifies the target attribute identifier. When the attribute identification system identifies that the target attribute identifier indicates that the target attribute field is a basic attribute, such as querying the drug supplier of the hospital, then execute the following step 202; when the attribute query system identifies that the target attribute identifier indicates that the target attribute field is a virtual attribute, such as querying the usage of each drug in the hospital, then execute the following step 203.
[0073] In an optional implementation scheme, in order to satisfy the calculation and filtering of complex attributes in different application scenarios, the attribute query system can establish and maintain virtual attributes, so that users can directly select virtual attributes for query when performing queries, thereby improving query efficiency. The attribute query system responds to virtual attribute setting requests, such as when a user wants to establish a virtual attribute for querying the usage of each drug in the hospital. Specifically, the process of obtaining target virtual attribute setting information and multiple target basic attributes is as follows:
[0074] First, the attribute query system obtains the virtual attribute setting information selected by the user based on the terminal held as the target virtual attribute setting information. The virtual attribute setting information may include the attribute name, attribute display name, data type, attribute type, attribute identifier, status information, etc. of the basic attribute, and the target attribute type corresponds to a selection event. By selecting an event, the created virtual attribute can be more in line with the actual application scenario, thereby improving the accuracy of the query result. For example, a user creates a virtual attribute for querying the usage of each drug in the hospital. The attribute name can be set to the drug usage, the attribute display name to the usage of each drug, the data type to an integer type, the attribute type to an event attribute, the attribute identifier to a virtual attribute, and the status information to an effective status. The following describes the structure of an attribute configuration information:
[0075] like Figure 2B As shown, the attribute query system will store the basic attributes in the relational database and provide query selection functions so that users can set and maintain the basic attributes. And the configuration information of each attribute includes number, attribute name, attribute display name, attribute data type, attribute type, attribute identifier, and status information. The attribute data type includes string type, numerical string type, date string type, and Boolean type. The attribute type includes user attribute, default attribute, and label attribute. The attribute identifier includes basic attribute and virtual attribute. The status information includes effective status and invalid status. If the attribute is a virtual attribute, the database expression of the attribute will also be stored. Since there are many attributes for user behavior analysis, the attribute type is classified according to the different attributes of user behavior. User attributes are user-related attributes of the event. For example, in the event of clicking to buy medicines, user attributes include consumer gender, age, name, etc. The default attribute can be the attribute commonly present in the event such as the time of occurrence. The label attribute can be active users, user level, etc. In this way, the attribute query system can perform multi-dimensional data analysis on user behavior according to different categories.
[0076] Therefore, a schematic diagram of attribute configuration information proposed in an embodiment of the present application is as follows:
[0077] like Figure 2CAs shown, the attribute query system sets 5 basic attributes. The attribute name of attribute 1 is creation time, the attribute display name is case creation time, the attribute description is the creation time of the patient case, the data type is time type, and the status is effective status; the attribute name of attribute 2 is value, the attribute display name is patient number, the attribute description is the number of patients consulted on the day, the data type is value type, and the status is effective status; the attribute name of attribute 3 is whether to meet, the attribute display name is whether to meet the consumption amount, the attribute description is whether the drug purchase meets the consumption amount, the data type is Boolean type, and the status is invalid status; the attribute name of attribute 4 is remarks, the attribute display name is case remarks, the attribute description is remarks on the patient's medical record, the data type is string type, and the status is effective status; the attribute name of attribute 5 is public attribute symbol, the attribute display name is public attribute symbol, the attribute description is to create a public attribute symbol, the data type is string type, and the status is invalid status. Among them, the attribute name is the field name stored in the database, the attribute display name is the name that is easy to understand displayed to the user, and the attribute name and the attribute display name are one-to-one corresponding.
[0078] Next, the attribute query system determines multiple preset basic attributes, and determines multiple preset operators corresponding to each preset basic attribute, such as the preset basic attributes include drugs, doctors, departments, and diagnostic prescriptions, wherein the preset operators are set based on the data type of the basic attribute, because the data types include string type, integer type, date string type, and Boolean type, etc., so the preset operators corresponding to the string type can include equal, not equal, valued, no value, contain, and not contain, the logical operators corresponding to the integer type can include greater than, less than, equal, interval, valued, no value, and digital operators, the logical operators corresponding to the date string type can include interval, valued, and no value, and the logical operators corresponding to the Boolean type can include correct, wrong, valued, and no value. Subsequently, the attribute query system determines multiple preset basic attributes selected by the user based on the held terminal as multiple target basic attributes among the multiple preset basic attributes, and determines the preset operator selected by the user based on the held terminal as the target operator corresponding to each target basic attribute among the multiple preset operators corresponding to each target basic attribute. For example, the target basic attributes selected by the user are drugs and diagnostic prescriptions, and the corresponding target operators are valued and contained. In this way, the user can select different types of basic attributes and select corresponding operators, so that the attribute query system can quickly generate virtual attribute expressions. Below, an architecture for creating virtual attributes is described:
[0079] like Figure 2DAs shown in the figure, the user selects whether the created virtual attribute belongs to the event attribute or the user attribute, and the input event is the purchase of medicines, the attribute name is the total amount of medicines consumed, the remarks are the total amount of a certain medicine purchased after the patient creates a case, the data type is a numeric type, and the SQL expression is price 1*num1+price 2*num 1. It should be noted that since users may not have a basic knowledge of SQL, users only need to select basic attributes, then select operators, and customize the virtual attributes. The attribute query system will process the SQL expression entered by the user and then store it.
[0080] Based on the above process, a schematic diagram of event attributes proposed in the embodiment of the present application is as follows:
[0081] like Figure 2E As shown, the classification of event attributes and user attributes is different. For example, in the tracking system, the event attributes of the event order payment for medical devices may include overall, city, operator, channel, screen size, device model, country, province, operating system, network, device brand, system version, language, and version. The user attributes of order payment for medical devices may include user name, age, gender, mobile phone number, registration time and other user-related attributes. Therefore, the occurrence of an event has attributes related to the event, as well as attributes of the user who caused the event. In this way, users will make detailed classifications when creating virtual attributes, so that the query results obtained by the attribute query system are more in line with user needs and the query accuracy is higher.
[0082] After obtaining the target virtual attribute setting information and multiple target basic attributes through the above process, the attribute query system obtains a statement conversion tool, such as the SQLBuildutil (SQL statement builder) tool, which maintains all types and supported function calculations in the enumeration class, and can automatically form an SQL statement based on the basic attributes and operators selected by the user and store it in the database for subsequent calculations by the attribute query system. Subsequently, the attribute query system uses the statement conversion tool to convert multiple target basic attributes into multiple target strings, and uses the statement conversion tool to convert the target operator corresponding to each target basic attribute into a logical operator to obtain the logical operator corresponding to each target string. Then, the attribute query system splices multiple target strings based on the logical operator corresponding to each target string to obtain the virtual attribute expression to be stored. In this way, the user does not need to have SQL-related knowledge reserves. The attribute query system will process the basic attributes and operators selected by the user through the statement conversion tool to avoid errors in the storage process and affect subsequent attribute queries. Finally, the attribute query system obtains the virtual attribute identifier, uses the virtual attribute identifier to mark the virtual attribute expression to be stored, and stores the marked virtual attribute expression to be stored and the target virtual attribute setting information in the database, wherein the virtual attribute identifier is used to indicate that the attribute category corresponding to the virtual attribute expression to be stored is a virtual attribute. In this way, the attribute query system maintains the user-defined virtual attributes, so that the user can select the corresponding virtual attribute according to the application scenario to query directly, without selecting too many basic attributes, thereby improving the efficiency of attribute query.
[0083] 202. When it is identified that the target attribute identifier indicates that the target attribute field is a basic attribute, a query operation is performed in a database using the target attribute field to obtain a first attribute query result, and the first attribute query result is sent to a terminal held by the user.
[0084] In an embodiment of the present application, when the attribute query system recognizes that the target attribute identifier indicates that the target attribute field is a basic attribute, the target attribute field is used to perform a query operation in the database to obtain a first attribute query result. For example, if a user wants to inquire about the drug suppliers of the hospital, he / she enters the drug suppliers in the attribute query system. The attribute query system recognizes and confirms that the drug supplier field is a basic attribute, then directly uses this field to query in the database to obtain a list of drug suppliers. Then, the attribute query system sends the first attribute query result to the terminal held by the user. In this way, for simple attribute queries, users can directly query through basic attributes.
[0085] 203. When it is identified that the target attribute identifier indicates that the target attribute field is a virtual attribute, a virtual attribute expression corresponding to the target attribute field is queried in a database, and a statement processing operation is performed on the virtual attribute expression to obtain a statement to be queried.
[0086] In an embodiment of the present application, the attribute query system obtains a preset configuration table in a database, where the preset configuration table is used to store multiple virtual attribute expressions, and each virtual attribute expression stored in the preset configuration table corresponds to an attribute field. Next, the attribute query system reads the virtual attribute expression corresponding to the target attribute field in the preset configuration table, wherein the virtual attribute expression is generated by the attribute query system according to the basic attributes and operators selected by the user when the user creates the virtual attribute. Subsequently, the attribute query system obtains the alias field carried by the attribute query request, and obtains a preset concatenation statement. Finally, the attribute query system uses the preset concatenation statement to sort the alias field and the virtual attribute expression to obtain the statement to be queried. The statement to be queried is an SQL query statement, and the attribute query system uses the statement to be queried to directly query in the database, which can improve the query speed of the attribute.
[0087] 204. Execute the query statement to obtain a target attribute query result, and send the target attribute query result to a terminal held by the user who initiated the attribute query request.
[0088] In the embodiment of the present application, the attribute query system executes the query statement to be queried, obtains the target attribute query result, and sends the target attribute query result to the terminal held by the user who initiated the attribute query request. By customizing virtual attributes, users can use virtual attributes more flexibly for analysis and query, without having to select multiple basic attributes, improving query efficiency, and being able to meet the calculation of complex attributes in different application scenarios, making attribute query more flexible and efficient.
[0089] In an optional implementation scheme, the user can query through the attribute dimension, and the user selects an event attribute or a selection event of the user attribute for group query when querying. Specifically, the attribute query system responds to the attribute dimension query request, obtains the specified attribute type carried by the attribute dimension query request, and determines the selection event corresponding to the specified attribute type. Next, the attribute query system obtains a preset grouping statement, uses the preset grouping statement to read multiple target data corresponding to the specified attribute type in the database, and determines the target data indicated by the selection event in the multiple target data as the second attribute query result. Finally, the attribute query system determines the user who initiated the attribute dimension query request and sends the second attribute query result to the terminal held by the user. For example, if the user selects the gender group in the user attribute to query the number of times a certain drug is purchased, it can be obtained that the number of times male consumers purchase the drug is 100 times, and the number of times female consumers purchase the drug is 50 times. In this way, the attribute query system can perform summary queries according to different dimensions to enhance the query and screening function of the attribute query system.
[0090] In an optional implementation scheme, in order to meet the calculation and filtering of more complex attributes in more different application scenarios, users can modify and maintain attribute information. Specifically, the attribute query system responds to the attribute information modification request and obtains the information identifier to be modified carried by the attribute information modification request, and the information identifier to be modified indicates the basic attribute or virtual attribute that the user wants to modify. Then, the attribute query system reads the target attribute configuration information corresponding to the information identifier to be modified in the database, and sends the target attribute configuration information to the terminal held by the user who initiated the attribute information modification request. Subsequently, when the attribute query system obtains the adjusted target attribute configuration information based on the feedback of the user's terminal, the adjusted target attribute configuration information is used as the attribute configuration information to be updated. Then, the attribute query system obtains the attribute identifier, which is used to indicate that the attribute category corresponding to the target attribute configuration information is a basic attribute or a virtual attribute. If the user modifies the virtual attribute to a basic attribute, the attribute identifier changes, and the attribute needs to be re-annotated to make the attribute information more accurate. Finally, the attribute query system uses the attribute identifier to mark the attribute configuration information to be updated, and stores the marked attribute configuration information to be updated in the database. In this way, users can adjust basic attributes and virtual attributes according to actual application scenarios to improve the efficiency of attribute queries.
[0091] Therefore, a flow chart of an attribute query method proposed in an embodiment of the present application is as follows:
[0092] like Figure 2FAs shown in the figure, the user customizes multiple basic attributes, and then customizes virtual attributes based on the basic attributes. Subsequently, the attribute query system will parse the virtual attribute and store it in the database as a SQL statement expression. When the user performs an attribute query, the attribute query system will identify whether the attribute selected by the user is a virtual attribute; if it is not a virtual attribute, the attribute will be directly used for query; if it is a virtual attribute, the virtual attribute expression corresponding to the attribute will be queried, and the virtual attribute expression will be converted into an SQL query statement, and the SQL query statement will be used to query in the database. Finally, the attribute query system sends the query results to the user.
[0093] The method provided in the embodiment of the present application responds to an attribute query request, obtains a target attribute field carried by the attribute query request, determines a target attribute identifier corresponding to the target attribute field, and identifies the target attribute identifier. When it is identified that the target attribute identifier indicates that the target attribute field is a virtual attribute, a virtual attribute expression corresponding to the target attribute field is queried in a database, and a statement processing operation is performed on the virtual attribute expression to obtain a statement to be queried, execute the statement to be queried, obtain a target attribute query result, and send the target attribute query result to a terminal held by a user who initiates the attribute query request. By customizing virtual attributes, users can use virtual attributes more flexibly for analysis and query, without selecting multiple basic attributes, thereby improving query efficiency. Moreover, by maintaining virtual attributes, it is possible to meet the calculation of complex attributes in different application scenarios, making attribute query more flexible and efficient.
[0094] Further, as Figure 1 In a specific implementation of the method, the present application provides an attribute query device, such as Figure 3A As shown, the device includes: an identification module 301, a processing module 302 and a first query module 303.
[0095] The identification module 301 is used to respond to an attribute query request, obtain a target attribute field carried in the attribute query request, determine a target attribute identifier corresponding to the target attribute field, and identify the target attribute identifier;
[0096] The processing module 302 is used for, when it is recognized that the target attribute identifier indicates that the target attribute field is a virtual attribute, searching the database for a virtual attribute expression corresponding to the target attribute field, and performing a statement processing operation on the virtual attribute expression to obtain a statement to be queried;
[0097] The first query module 303 is used to execute the query statement to obtain a target attribute query result, and send the target attribute query result to the terminal held by the user who initiated the attribute query request.
[0098] In a specific application scenario, the processing module 302 is used to obtain a preset configuration table in the database, read the virtual attribute expression corresponding to the target attribute field in the preset configuration table, the preset configuration table is used to store multiple virtual attribute expressions and each virtual attribute expression stored in the preset configuration table corresponds to an attribute field; obtain the alias field carried by the attribute query request, and obtain a preset concatenation statement; use the preset concatenation statement to sort the alias field and the virtual attribute expression to obtain the statement to be queried.
[0099] In specific application scenarios, such as Figure 3B As shown, the device further includes: a setting module 304 , a second query module 305 , a third query module 306 and a modification module 307 .
[0100] The setting module 304 is used to obtain target virtual attribute setting information and multiple target basic attributes in response to a virtual attribute setting request, wherein the target virtual attribute setting information includes a target attribute type, the target attribute type corresponds to a selection event, and each of the target basic attributes corresponds to a target operator; obtain a statement conversion tool, use the statement conversion tool to convert the multiple target basic attributes into multiple target strings, use the statement conversion tool to convert the target operator corresponding to each of the target basic attributes into a logical operator, and obtain the logical operator corresponding to each of the target strings; based on the logical operator corresponding to each of the target strings, splice the multiple target strings to obtain a virtual attribute expression to be stored; obtain a virtual attribute identifier, use the virtual attribute identifier to mark the virtual attribute expression to be stored, and store the marked virtual attribute expression to be stored and the target virtual attribute setting information in the database, the virtual attribute identifier is used to indicate that the attribute category corresponding to the virtual attribute expression to be stored is a virtual attribute.
[0101] The second query module 305 is used to perform a query operation in the database using the target attribute field when it is recognized that the target attribute identifier indicates that the target attribute field is a basic attribute, obtain a first attribute query result, and send the first attribute query result to the terminal held by the user.
[0102] The third query module 306 is used to respond to an attribute dimension query request, obtain the specified attribute type carried by the attribute dimension query request, and determine the selection event corresponding to the specified attribute type; obtain a preset grouping statement, use the preset grouping statement to read multiple target data corresponding to the specified attribute type in the database, and determine the target data indicated by the selection event in the multiple target data as the second attribute query result; determine the user who initiated the attribute dimension query request, and send the second attribute query result to the terminal held by the user.
[0103] The modification module 307 is used to respond to an attribute information modification request and obtain the information identifier to be modified carried by the attribute information modification request; read the target attribute configuration information corresponding to the information identifier to be modified in the database, and send the target attribute configuration information to the terminal held by the user who initiated the attribute information modification request; when the adjusted target attribute configuration information based on the feedback from the terminal held by the user is obtained, the adjusted target attribute configuration information is used as the attribute configuration information to be updated; obtain the attribute identifier, use the attribute identifier to mark the attribute configuration information to be updated, and store the marked attribute configuration information to be updated in the database, wherein the attribute identifier is used to indicate whether the attribute category corresponding to the target attribute configuration information is a basic attribute or a virtual attribute.
[0104] In a specific application scenario, the setting module 304 is used to obtain the virtual attribute setting information selected by the user based on the terminal held as the target virtual attribute setting information; determine multiple preset basic attributes, and determine multiple preset operators corresponding to each of the preset basic attributes; determine the multiple preset basic attributes selected by the user based on the terminal held as the multiple target basic attributes among the multiple preset basic attributes, and determine the preset operator selected by the user based on the terminal held as the target operator corresponding to each of the target basic attributes among the multiple preset operators corresponding to each of the target basic attributes.
[0105] The device provided in the embodiment of the present application responds to an attribute query request, obtains a target attribute field carried by the attribute query request, determines a target attribute identifier corresponding to the target attribute field, and identifies the target attribute identifier. When it is identified that the target attribute identifier indicates that the target attribute field is a virtual attribute, the virtual attribute expression corresponding to the target attribute field is queried in the database, and a statement processing operation is performed on the virtual attribute expression to obtain a statement to be queried, execute the statement to be queried, obtain a target attribute query result, and send the target attribute query result to a terminal held by a user who initiates the attribute query request. By customizing virtual attributes, users can use virtual attributes more flexibly for analysis and query, without selecting multiple basic attributes, thereby improving query efficiency. Moreover, by maintaining virtual attributes, it can meet the calculation of complex attributes in different application scenarios, making attribute query more flexible and efficient.
[0106] It should be noted that for other corresponding descriptions of the functional units involved in the attribute query device provided in the embodiment of the present application, reference can be made to Figure 1 and FIG. 2A to FIG. 2F The corresponding description in will not be repeated here.
[0107] In an exemplary embodiment, see Figure 4 , and also provides a computer device, which includes a bus, a processor, a memory and a communication interface, and may also include an input and output interface and a display device, wherein each functional unit can communicate with each other through the bus. The memory stores a computer program, and the processor is used to execute the program stored in the memory and execute the attribute query method in the above embodiment.
[0108] A computer-readable storage medium stores a computer program, which implements the steps of the attribute query method when executed by a processor.
[0109] Through the description of the above implementation methods, those skilled in the art can clearly understand that the present application can be implemented by hardware, or by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each implementation scenario of the present application.
[0110] Those skilled in the art will appreciate that the accompanying drawings are merely schematic diagrams of a preferred implementation scenario, and the modules or processes in the accompanying drawings are not necessarily required for implementing the present application.
[0111] Those skilled in the art will appreciate that the modules in the device in the implementation scenario can be distributed in the device in the implementation scenario according to the implementation scenario description, or can be changed accordingly and located in one or more devices different from the implementation scenario. The modules in the above implementation scenario can be combined into one module, or can be further split into multiple sub-modules.
[0112] The above application serial numbers are for description only and do not represent the advantages or disadvantages of the implementation scenarios.
[0113] The above disclosure only discloses several specific implementation scenarios of the present application. However, the present application is not limited thereto, and any changes that can be conceived by technicians in this field should fall within the scope of protection of the present application.
Claims
1. A property query method, characterized in that: include: In response to an attribute query request, obtaining a target attribute field carried in the attribute query request, determining a target attribute identifier corresponding to the target attribute field, and identifying the target attribute identifier; When it is identified that the target attribute identifier indicates that the target attribute field is a virtual attribute, querying a database for a virtual attribute expression corresponding to the target attribute field, and performing a statement processing operation on the virtual attribute expression to obtain a statement to be queried; The query statement is executed to obtain a target attribute query result, and the target attribute query result is sent to a terminal held by a user who initiates the attribute query request.
2. The method according to claim 1, characterized in that Before obtaining the target attribute field carried in the attribute query request in response to the attribute query request, the method further includes: In response to a virtual attribute setting request, target virtual attribute setting information and a plurality of target basic attributes are obtained, wherein the target virtual attribute setting information includes a target attribute type, the target attribute type corresponds to a selection event, and each of the target basic attributes corresponds to a target operator; Obtain a statement conversion tool, use the statement conversion tool to convert the multiple target basic attributes into multiple target character strings, use the statement conversion tool to convert the target operator corresponding to each of the target basic attributes into a logical operator, and obtain the logical operator corresponding to each of the target character strings; Based on the logical operator corresponding to each of the target strings, the multiple target strings are concatenated to obtain a virtual attribute expression to be stored; A virtual attribute identifier is obtained, the virtual attribute identifier is used to mark the virtual attribute expression to be stored, and the marked virtual attribute expression to be stored and the target virtual attribute setting information are stored in the database, wherein the virtual attribute identifier is used to indicate that the attribute category corresponding to the virtual attribute expression to be stored is a virtual attribute.
3. The method according to claim 2, characterized in that The step of obtaining target virtual attribute setting information and multiple target basic attributes includes: Acquire the virtual attribute setting information selected by the user based on the terminal held by the user as the target virtual attribute setting information; Determine a plurality of preset basic attributes, and determine a plurality of preset operators corresponding to each of the preset basic attributes; A plurality of preset basic attributes selected by the user based on the terminal held by the user are determined from among the plurality of preset basic attributes as the plurality of target basic attributes, and a preset operator selected by the user based on the terminal held by the user is determined from among the plurality of preset operators corresponding to each of the target basic attributes as the target operator corresponding to each of the target basic attributes.
4. The method according to claim 1, characterized in that: After identifying the target attribute identifier, the method further includes: When it is identified that the target attribute identifier indicates that the target attribute field is a basic attribute, a query operation is performed in the database using the target attribute field to obtain a first attribute query result, and the first attribute query result is sent to the terminal held by the user.
5. The method according to claim 1, characterized in that The step of querying the virtual attribute expression corresponding to the target attribute field in the database and performing statement processing operation on the virtual attribute expression to obtain a statement to be queried includes: Obtaining a preset configuration table in the database, and reading a virtual attribute expression corresponding to the target attribute field in the preset configuration table, wherein the preset configuration table is used to store a plurality of virtual attribute expressions and each virtual attribute expression stored in the preset configuration table corresponds to an attribute field; Obtaining the alias field carried in the attribute query request and obtaining a preset concatenation statement; The preset concatenation statement is used to sort the alias field and the virtual attribute expression to obtain the statement to be queried.
6. The method according to claim 1, characterized in that The method further comprises: In response to an attribute dimension query request, obtaining a specified attribute type carried in the attribute dimension query request, and determining a selection event corresponding to the specified attribute type; Obtaining a preset grouping statement, using the preset grouping statement to read a plurality of target data corresponding to the specified attribute type in the database, and determining the target data indicated by the selection event as a second attribute query result from the plurality of target data; Determine the user who initiated the attribute dimension query request, and send the second attribute query result to the terminal held by the user.
7. The method according to claim 1, characterized in that The method further comprises: In response to the attribute information modification request, obtaining the identifier of the information to be modified carried in the attribute information modification request; Reading target attribute configuration information corresponding to the information identifier to be modified in the database, and sending the target attribute configuration information to a terminal held by a user who initiates the attribute information modification request; When the adjusted target attribute configuration information fed back by the user based on the terminal held by the user is obtained, the adjusted target attribute configuration information is used as the attribute configuration information to be updated; Acquire an attribute identifier, use the attribute identifier to mark the attribute configuration information to be updated, and store the marked attribute configuration information to be updated in the database, wherein the attribute identifier is used to indicate whether the attribute category corresponding to the target attribute configuration information is a basic attribute or a virtual attribute.
8. An attribute query device, characterized in that: include: an identification module, configured to, in response to an attribute query request, obtain a target attribute field carried in the attribute query request, determine a target attribute identifier corresponding to the target attribute field, and identify the target attribute identifier; A processing module, configured to, when it is identified that the target attribute identifier indicates that the target attribute field is a virtual attribute, query the database for a virtual attribute expression corresponding to the target attribute field, and perform statement processing operations on the virtual attribute expression to obtain a statement to be queried; The query module is used to execute the query statement to obtain a target attribute query result, and send the target attribute query result to a terminal held by a user who initiates the attribute query request.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.