Data acquisition method and device, electronic equipment and storage medium
By receiving service data query requests and matching the service name in the dimension table, and obtaining database data based on filtering conditions and business encoding, the problem of low efficiency in business data acquisition in the existing technology is solved, and efficient data acquisition and reduced query difficulty is achieved.
Patent Information
- Application Number
- CN202411758262.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-02
- Publication Date
- 2025-03-14
AI Technical Summary
When obtaining business data, the prior art faces the problem of different fields between tables and difficult to associate, resulting in low data acquisition efficiency.
By receiving service data query requests, match the target service name and the service name in the preconfigured dimension table, and obtain data related to the target service from the database based on the filtering conditions and the matching service code.
It improves the efficiency of obtaining business data, reduces the difficulty of querying, and effectively determines whether the target business data is stored in the database through the pre-configured dimension table, and directly obtains data from the database.
Smart Images

Figure CN119621726A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a data acquisition method, device, electronic device and storage medium. Background Art
[0002] With the diversified development of business scenarios, business data of different business scenarios are generated, and business data is increasing explosively.
[0003] At present, relational databases are often used. Business data will be recorded in different data tables. Tables are linked by keys. Usually, when obtaining data tables from relational databases, data cleaning, association pulling, code value conversion and other operations are performed to form a wide table.
[0004] New tables will be used to record business data for new business processes. The fields between different tables are different and difficult to associate. When obtaining business data, the query difficulty is increased, making data acquisition efficiency low. Summary of the invention
[0005] The main purpose of the embodiments of the present application is to provide a data acquisition method, device, electronic device and storage medium, aiming to improve the efficiency of business data acquisition.
[0006] To achieve the above object, a first aspect of an embodiment of the present application proposes a data acquisition method, the method comprising:
[0007] receiving a business data query request, wherein the business data query request includes a screening condition and a target business name of a target business;
[0008] Matching the target service name with a service name in a preconfigured dimension table to obtain a matching result, wherein the dimension table includes multiple service names and a service code corresponding to each service name;
[0009] When the matching result indicates that the target service name corresponds to a first service code, data related to the target service is acquired from a database according to the screening condition and the first service code.
[0010] In some embodiments, the database includes N behavior data tables, each of which includes a business code corresponding to at least one business name in the dimension table, and data generated by the business behavior;
[0011] When the matching result indicates that the target service name corresponds to a first service code, acquiring data related to the target service from a database according to the screening condition and the first service code includes:
[0012] When the matching result indicates that the target service name corresponds to the first service code, the N behavior data tables are screened according to the screening condition and the first service code to obtain M behavior data tables, and the service code of each behavior data table in the M behavior data tables is the first service code;
[0013] The data generated by the business behaviors recorded in the M behavior data tables are obtained.
[0014] In some embodiments, the data generated by the business behavior includes business activity time, business activity name, identification of persons participating in the business activity, and business activity number; the screening condition includes at least one of the following: business activity time, business activity name, identification of persons participating in the business activity, and business activity number;
[0015] When the matching result indicates that the target service name corresponds to the first service code, the N behavior data tables are screened according to the screening condition and the first service code to obtain M behavior data tables, including:
[0016] When the matching result indicates that the target service name corresponds to a first service code, the N behavior data tables are screened according to the first service code to obtain a behavior data table related to the first service code;
[0017] The behavior data tables related to the first service code are screened according to the screening condition to obtain M behavior data tables.
[0018] In some embodiments, the method further comprises:
[0019] If the matching result does not indicate that the target service name corresponds to the first service code, generating a second service code for the target service name;
[0020] The correspondence between the target service name and the second service code is recorded in the dimension table.
[0021] In some embodiments, recording the correspondence between the target service name and the second service code in the dimension table includes:
[0022] The preconfigured script is triggered to run, so as to record the corresponding relationship between the target service name and the second service code in the dimension table.
[0023] In some embodiments, after recording the correspondence between the target service name and the second service code in the dimension table, the method further includes:
[0024] Receive a business data storage request, the business data storage request including the target business name and data generated by the target business behavior;
[0025] A target behavior data table is created from the database, and the second service code and data generated by the target service behavior are recorded in the target behavior data table.
[0026] In some embodiments, when the matching result does not indicate that the target service name corresponds to the first service code, generating a second service code for the target service name includes:
[0027] Encode the service name according to a preset encoding rule to obtain an encoding result;
[0028] When the dimension table does not contain the encoding result, the encoding result is used as the second service code.
[0029] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application provides a data acquisition device, the device comprising:
[0030] A transceiver module, used to receive a service data query request, wherein the service data query request includes a screening condition and a target service name of a target service;
[0031] A matching module, used to match the target service name with a service name in a pre-configured dimension table to obtain a matching result, wherein the dimension table includes multiple service names and a service code corresponding to each service name;
[0032] An acquisition unit is used to acquire data related to the target service from a database according to the screening condition and the first service code when the matching result indicates that the target service name corresponds to the first service code.
[0033] In some embodiments, the matching module is also used to filter the N behavior data tables according to the filtering conditions and the first business code to obtain M behavior data tables, when the matching result indicates that the target business name corresponds to the first business code, and the business code of each behavior data table in the M behavior data tables is the first business code; and obtain the data generated by the business behavior recorded in the M behavior data tables.
[0034] In some embodiments, the matching module is also used to filter the N behavior data tables according to the first business code to obtain a behavior data table related to the first business code when the matching result indicates that the target business name corresponds to the first business code; and filter the behavior data tables related to the first business code according to the filtering condition to obtain M behavior data tables.
[0035] In some embodiments, the data acquisition device further includes: a processing module;
[0036] A processing module is used to generate a second business code for the target business name when the matching result does not indicate that the target business name corresponds to the first business code; and record the corresponding relationship between the target business name and the second business code in the dimension table.
[0037] In some embodiments, the processing module is further used to trigger the execution of a preconfigured script to record the corresponding relationship between the target service name and the second service code in the dimension table.
[0038] In some embodiments, the transceiver module is further used to receive a business data storage request, the business data storage request includes the target business name and the data generated by the target business behavior. The processing module is further used to create a target behavior data table from the database, and record the second business code and the data generated by the target business behavior in the target behavior data table.
[0039] In some embodiments, the processing module is further used to encode the service name according to a preset encoding rule to obtain an encoding result; if the encoding result is not included in the dimension table, the encoding result is used as the second service code.
[0040] To achieve the above objectives, a third aspect of an embodiment of the present application proposes an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method described in the first aspect is implemented.
[0041] To achieve the above-mentioned purpose, the fourth aspect of an embodiment of the present application proposes a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in the first aspect is implemented.
[0042] To achieve the above-mentioned purpose, the fifth aspect of the embodiments of the present application proposes a computer program product. When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the method described in the first aspect.
[0043] The data acquisition method, device, electronic device and storage medium proposed in the present application receive a business data query request, which includes a screening condition and a target business name of a target business, match the target business name with the business name in a preconfigured dimension table to obtain a matching result, and when the matching result indicates a first business code corresponding to the target business name, obtain data related to the target business from a database based on the screening condition and the first business code. The preconfigured dimension table can effectively improve the efficiency of business data acquisition and reduce the difficulty of query. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 is a flow chart of the data acquisition method provided in the embodiment of the present application;
[0045] Figure 2 yes Figure 1 Flow chart of step S103 in FIG.
[0046] Figure 3 is another flow chart of the data acquisition method provided in an embodiment of the present application;
[0047] Figure 4 is another flow chart of the data acquisition method provided in the embodiment of the present application;
[0048] Figure 5 is a structural schematic diagram of a data acquisition device provided in an embodiment of the present application;
[0049] Figure 6 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0051] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0052] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0053] At present, relational databases are often used. Business data will be recorded in different data tables. Tables are linked by keys. Usually, when obtaining data tables from relational databases, data cleaning, association pulling, code value conversion and other operations are performed to form a wide table.
[0054] New tables will be used to record business data for new business processes. The fields between different tables are different and difficult to associate. When obtaining business data, the query difficulty is increased, making data acquisition efficiency low.
[0055] Based on this, the embodiments of the present application provide a data acquisition method, device, electronic device and storage medium, aiming to improve the efficiency of business data acquisition.
[0056] The data acquisition method, device, electronic device and storage medium provided in the embodiments of the present application are specifically described through the following embodiments. First, the method in the embodiments of the present application is described.
[0057] The data acquisition method provided in the embodiment of the present application relates to the field of data processing technology. The data acquisition method provided in the embodiment of the present application can be applied to a terminal, can be applied to a server side, or can be software running in a terminal or a server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the data acquisition method, etc., but is not limited to the above forms.
[0058] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0059] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to user identity or characteristics such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of these data will comply with relevant laws, regulations, and standards. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.
[0060] Figure 1 is a flow chart of a data acquisition method provided in an embodiment of the present application. Figure 1 The method may include but is not limited to steps S101 to S103.
[0061] Step S101: receiving a business data query request, where the business data query request includes a screening condition and a target business name of a target business.
[0062] In this embodiment, the execution subject is an electronic device, which receives a business data query request, parses the business data query request, and obtains screening conditions and a target business name of a target business. The business data query request may be sent by a user such as a business person through a terminal. For example, if a business person wants to know about the past business development, he can enter the business name of the business he wants to know, that is, the target business name of the above-mentioned target business, and enter the screening conditions, thereby sending a business data query request to the electronic device, wherein the target business name of the target business can be used for primary screening, and the screening conditions can be used for secondary screening.
[0063] Step S102, matching the target service name with the service name in the pre-configured dimension table to obtain a matching result, where the dimension table includes multiple service names and a service code corresponding to each service name.
[0064] In this embodiment, the dimension table is also called a dimension table, which usually includes a primary key column for uniquely identifying each dimension record. The preconfigured dimension table includes multiple business names and business codes corresponding to each business name, and the primary key in the preconfigured dimension table is the business code.
[0065] Specifically, the target business name is matched with the business name in the pre-configured dimension table to obtain a matching result. Through the content recorded in the pre-configured dimension table, it can be determined whether the relevant business data corresponding to the target business name is stored in the warehouse.
[0066] Step S103: when the matching result indicates that the target service name corresponds to the first service code, data related to the target service is obtained from the database according to the screening condition and the first service code.
[0067] In this embodiment, the matching result is used to indicate whether the target business name matches the business name in the preconfigured dimension table. When the matching result indicates that the target business name corresponds to the first business code, that is, the target business name matches the business name in the preconfigured dimension table, it means that the relevant business data has been stored in the database. According to the screening condition and the first business code, the data related to the target business is obtained from the database, where the database can be a hive database.
[0068] In steps S101 to S103 shown in the embodiment of the present application, a business data query request is received, and the business data query request includes a screening condition and a target business name of a target business. The target business name is matched with a business name in a preconfigured dimension table to obtain a matching result. When the matching result indicates a first business code corresponding to the target business name, data related to the target business is obtained from a database according to the screening condition and the first business code. Through the preconfigured dimension table, it can be determined whether the data related to the target business is stored in the database. When it is determined that the data is stored in the database, that is, when the matching result indicates that the target business name corresponds to the first business code, the data is directly obtained from the database, which can effectively improve the efficiency of business data acquisition and reduce the difficulty of query.
[0069] See also Figure 2 In some embodiments, the database includes N behavior data tables, each behavior data table includes a business code corresponding to at least one business name in the dimension table, and data generated by the business behavior; step S103 may include but is not limited to steps S201 to S202:
[0070] Step S201, when the matching result indicates that the target business name corresponds to the first business code, N behavior data tables are screened according to the screening conditions and the first business code to obtain M behavior data tables, and the business code of each behavior data table in the M behavior data tables is the first business code.
[0071] Specifically, the database includes N behavior data tables, each of which includes a business code corresponding to at least one business name in the dimension table, and data generated by the business behavior.
[0072] In the above steps, when the matching result indicates that the target business name corresponds to the first business code, it means that the data required by the user has been stored in the database, and the N behavior data tables are screened according to the screening condition and the first business code to obtain M behavior data tables, wherein the business code of each behavior data table in the M behavior data tables is the above first business code,
[0073] Step S202, obtaining data generated by business behaviors recorded in M behavior data tables.
[0074] In this embodiment, data generated by business behaviors recorded in M behavior data tables are obtained. The data generated by business behaviors include: business activity time, business activity name, identification of personnel participating in the business activity, and business activity number. Business personnel can refer to previous business-related data in order to carry out new business activities in a targeted manner.
[0075] In some embodiments, the data generated by the business behavior includes the business activity time, the business activity name, the identification of the person participating in the business activity, and the business activity number; the screening condition includes at least one of the following: the business activity time, the business activity name, the identification of the person participating in the business activity, and the business activity number; when the matching result indicates that the target business name corresponds to the first business code, the N behavior data tables are screened according to the screening condition and the first business code to obtain M behavior data tables, including:
[0076] When the matching result indicates that the target service name corresponds to the first service code, the N behavior data tables are screened according to the first service code to obtain a behavior data table related to the first service code;
[0077] The behavior data tables related to the first business code are screened according to the screening condition to obtain M behavior data tables.
[0078] Specifically, the data generated by the business behavior includes the business activity time, the business activity name, the identification of the person participating in the business activity, and the business activity number; the screening condition may be at least one of the business activity time, the business activity name, the identification of the person participating in the business activity, and the business activity number. Among them, the person participating in the business activity includes business personnel and users, and the identification of the person participating in the business activity includes a business person identification and a user identification.
[0079] For example, if a business person wants to obtain data related to the purchase of product A in November 2024, November 2024 is the business activity time, which is used as the screening condition, and the purchase of product A is the target business name. Two screenings are performed according to the first business code corresponding to the target business name and the screening condition. Specifically, N behavior data tables are screened according to the first business code to obtain the behavior data table related to the first business code, and then the behavior data table related to the first business code is screened again according to the screening condition to obtain M behavior data tables. Using the first business code corresponding to the target business name and the screening condition to perform two screenings can accurately locate the data table, thereby obtaining the data generated by the business behavior recorded in the M behavior data tables, so that business personnel can obtain the data generated by the required business behavior in a targeted manner.
[0080] Figure 3 is another flow chart of the data acquisition method provided in the embodiment of the present application, Figure 3 The method may include but is not limited to steps S301 to S305.
[0081] Step S301: receiving a business data query request, where the business data query request includes a screening condition and a target business name of a target business.
[0082] In this embodiment, the execution subject is an electronic device, which receives a business data query request, parses the business data query request, and obtains screening conditions and a target business name of a target business. The business data query request may be sent by a user such as a business person through a terminal. For example, if a business person wants to know about the previous business development, he can enter the business name of the business he wants to know, that is, the target business name of the above-mentioned target business, in the terminal, and enter the screening conditions, thereby sending a business data query request to the electronic device, wherein the target business name of the target business can be used for primary screening, and the screening conditions can be used for secondary screening. The business name includes a primary name, a secondary name, and a tertiary name, and the target business name can be at least one of the primary name, the secondary name, and the tertiary name.
[0083] Step S302, matching the target service name with the service name in the pre-configured dimension table to obtain a matching result, where the dimension table includes multiple service names and a service code corresponding to each service name.
[0084] In this embodiment, the dimension table is also called a dimension table, which usually includes a primary key column for uniquely identifying each dimension record. The preconfigured dimension table includes multiple business names and business codes corresponding to each business name, and the primary key in the preconfigured dimension table is the business code.
[0085] Specifically, the target business name is matched with the business name in the pre-configured dimension table to obtain a matching result. Through the content recorded in the pre-configured dimension table, it can be determined whether the relevant business data corresponding to the target business name is stored in the warehouse.
[0086] Step S303: when the matching result indicates that the target service name corresponds to the first service code, data related to the target service is obtained from the database according to the screening condition and the first service code.
[0087] In this embodiment, the result of the match is used to indicate whether the target business name matches the business name in the preconfigured dimension table. When the match result indicates that the target business name corresponds to the first business code, that is, the target business name matches the business name in the preconfigured dimension table, it means that the relevant business data has been stored in the database, and the data related to the target business is obtained from the database according to the screening condition and the first business code. Further, the data related to the target business is output, such as sending the data related to the target business to a corresponding terminal, such as a terminal that sends a business data query request, or displaying the data related to the target business.
[0088] Step S304, if the matching result does not indicate that the target service name corresponds to the first service code, generate a second service code for the target service name;
[0089] In this embodiment, when the matching result does not indicate that the target business name corresponds to the first business code, that is, the target business name does not match the multiple business names in the preconfigured dimension table, indicating that the relevant business data has not been stored in the database, in this case, a second business code is generated for the target business name.
[0090] Step S305: Record the correspondence between the target service name and the second service code in the dimension table.
[0091] In this embodiment, the correspondence between the target service name and the second service code is recorded in the dimension table to update the dimension table, so as to facilitate the subsequent storage of new service data corresponding to the target service name.
[0092] In the embodiment of the present application, when the matching result indicates that the target business name corresponds to the first business code, it means that there is relevant data in the database, and the data related to the target business can be directly obtained from the database. When the matching result does not indicate that the target business name corresponds to the first business code, it means that the corresponding data is not recorded in the database, and there is no need to call the database or query the data in the database. In this case, a second business code is generated, and the correspondence between the target business name and the second business code is recorded in the dimension table for subsequent storage of the corresponding business data. The pre-configured dimension table can be used to determine whether the data related to the target business is stored in the warehouse. When it is determined to be stored in the warehouse, that is, when the matching result indicates that the target business name corresponds to the first business code, the data is directly obtained from the database, which can effectively improve the efficiency of obtaining business data and reduce the difficulty of query.
[0093] In some embodiments, step S305 includes:
[0094] Trigger the running of the preconfigured script to record the correspondence between the target business name and the second business code in the dimension table.
[0095] In this embodiment, a script is pre-configured. When the script triggering condition is met, that is, when the matching result does not indicate that the target business name corresponds to the first business code, after the second business code is generated, the pre-configured script is triggered to run. By running the pre-configured script, the correspondence between the target business name and the second business code is automatically recorded in the dimension table, which can prompt writing efficiency.
[0096] The preset configuration script can directly write the corresponding relationship in the dimension table, automatically configure the dimension table, and eliminate the need for manual configuration.
[0097] In some embodiments, after step S305, the method further includes:
[0098] receiving a business data storage request, where the business data storage request includes a target business name and data generated by the target business behavior;
[0099] A target behavior data table is created from the database, and the data generated by the second business code and the target business behavior is recorded in the target behavior data table.
[0100] In this embodiment, a business data storage request is received, the business data storage request is parsed, the target business name and the data generated by the target business behavior are obtained, and the data generated by the target business behavior are the data related to the above-mentioned target business. Further, a target behavior data table is created from the database, such as the target behavior data table includes a foreign key and multiple fields, the foreign key is the business code, that is, the second business code, and the multiple fields include a first field, a second field, and a third field, each field corresponds to a respective field value, such as the first field corresponds to the business activity time, the field value corresponding to the first field is the business activity time, the second field corresponds to the business activity name, the field value corresponding to the second field is the business activity name, and the third field corresponds to the identification of the person participating in the business activity, and the field value corresponding to the third field is the identification of the person participating in the business activity. The data generated by the second business code and the target business behavior are recorded in the target behavior data table. Specifically, the second business code is written into the target behavior data table as the value of the foreign key, and the business activity time, the business activity name, and the identification of the person participating in the business activity are written into the target behavior data table as the field values of the first field, the second field, and the third field. The target business data is written into the target behavior data table created in the database so that the target business data can be queried later through the pre-configured dimension table.
[0101] In some embodiments, step S304 includes:
[0102] Encode the business name according to the preset encoding rules to obtain the encoding result;
[0103] When the dimension table does not contain the encoding result, the encoding result is used as the second service code.
[0104] In this embodiment, the service name is encoded according to the preset encoding rule to obtain the encoding result, and the encoding result is checked for uniqueness. Specifically, the dimension table is traversed to determine whether the dimension table contains the encoding result. If the dimension table does not contain the encoding result, it means that the encoding result is unique, and the encoding result is used as the second service code; if the dimension table contains the encoding result, it means that the encoding result is not unique, and the step of encoding the service name according to the preset encoding rule is continued until the dimension table does not contain the encoding result, and the encoding result is used as the second service code. When it is determined that the encoding result is unique, the encoding result is used as the second service code for subsequent data query.
[0105] The following is an example of the data acquisition method provided in the embodiment of the present application:
[0106] Business data can be abstractly understood as 5W1H, namely time (when), place (where), event (what), person (who), reason (why), and method (how). Based on the above factors, a behavior table (i.e., the behavior data table mentioned above) is designed, which includes the behavior time (when) (i.e., the business activity time mentioned above), behavior classification code (where) (i.e., the business code mentioned above), behavior action object code (what) (i.e., the business activity number mentioned above), customer mobile phone number (who) (i.e., the user ID in the identification of the person involved in the business activity mentioned above), agent work number (who) (i.e., the business person ID in the identification of the person involved in the business activity mentioned above) to record the behavior information (i.e., the data generated by the business behavior mentioned above), and the reason and method are recorded through reserved fields. The behavior table is partitioned using the behavior classification code (i.e. the business code mentioned above) to physically isolate different types of behavior data and avoid mutual interference between different data. A configuration dimension table (i.e. the pre-configured dimension table mentioned above) is designed for different behavior classifications. The behavior classification is configurable in combination with the portal report platform entry function. All types of behaviors are recorded in the dimension table and used as a query dictionary for the downstream behavior library and for adjusting data classification.
[0107] Among them, the configuration dimension table includes a primary key and multiple fields, the primary key is the behavior classification code (also called the channel number), and the multiple fields include a first-level channel name (i.e., the first-level name mentioned above), a second-level channel name (i.e., the second-level name mentioned above), and a third-level channel name (i.e., the third-level name mentioned above), see Table 1, Table 1 is a configuration dimension table, and the configuration dimension table records multiple channel names and the channel code corresponding to each channel name (i.e., the dimension table mentioned above includes multiple business names and the business code corresponding to each business name). For example, the business personnel want to query the relevant data of "free insurance" in 2024, and "free insurance" is the target channel name of the target business, which triggers a business data query request, which includes a screening condition, i.e., 2024 and the target channel name of the target business (i.e., the business data query request mentioned above includes a screening condition and the target business name of the target business), and matches the target channel name with the business name in the configuration dimension table to obtain a matching result (i.e., matching the target business name with the business name in the pre-configured dimension table to obtain a matching result).
[0108] Table 1
[0109]
[0110]
[0111] Through matching, it is determined that "free insurance" matches the free insurance in the secondary channel name, and the first channel code corresponding to the free insurance is qk001. Further, data related to the target business is obtained from the hive database according to the screening conditions and the first channel code, i.e., qk001 (i.e., in the above case where the matching result indicates that the target business name corresponds to the first business code, data related to the target business is obtained from the database according to the screening conditions and the first business code).
[0112] Specifically, the hive database includes N behavior tables, each behavior table includes a channel code corresponding to at least one business name in the configuration dimension table, and data generated by the business behavior, and the data generated by the business behavior includes: behavior time (also called action time), behavior classification code (also called channel code), behavior action object code (also called action object code), customer mobile phone number, agent work number, see Table 2, Table 2 is a field description of a behavior table, Table 2 includes multiple fields and a foreign key, the foreign key is the channel code, multiple fields include channel code (type_code), customer mobile phone number (phone_no), agent work number (empno), action time (action_time), action object code (action_code) and action object name (action_name), the action object code can be an activity number, and the action object name can be an activity name. The field type of the above fields is string type (string).
[0113] Table 2
[0114] Field Name Field Type Field comments type_code string Channel code (such as qk001) phone_no string Customer mobile phone number empno string Agent ID action_time string Action time action_code string Action object code (such as activity number) action_name string Action object name (such as activity name)
[0115] Specifically, when the matching result indicates that the target service name corresponds to the first channel code, data related to the target service is obtained from the hive database according to the screening condition and the first channel code (that is, when the matching result indicates that the target service name corresponds to the first service code, data related to the target service is obtained from the database according to the screening condition and the first service code), including:
[0116] When the matching result indicates that the target business name corresponds to the first channel code, N behavior tables are screened according to the screening conditions and the first channel code to obtain M behavior tables, and the channel code of each behavior table in the M behavior tables is the first channel code; the data generated by the business behavior recorded in the M behavior tables is obtained.
[0117] Specifically, when the matching result does not indicate that the target business name corresponds to the first channel code, a second channel code is generated for the target business name; the correspondence between the target business name and the second channel code is recorded in the configuration dimension table (that is, when the matching result does not indicate that the target business name corresponds to the first business code, a second business code is generated for the target business name; the correspondence between the target business name and the second business code is recorded in the dimension table) to facilitate subsequent storage of business data.
[0118] like Figure 4 As shown, the data acquisition method includes:
[0119] Step 401: receiving data requirements, where the data requirements include screening conditions and a target business name of a target business.
[0120] Step 402: Determine whether data related to the target business has been accessed to the behavior library.
[0121] In this embodiment, when a data demand is received, that is, when a business data query request is received, the target business name is matched with the business name in the configuration dimension table to obtain a matching result. The matching result is used to determine whether the data related to the target business has been connected to the behavior library (that is, the hive database). If the target business name matches the business name in the configuration dimension table, it is determined that the target business name corresponds to the first channel code.
[0122] Step 403: If the data related to the target business has been accessed to the behavior library, the configuration dimension table is searched to obtain data.
[0123] In this embodiment, if the data related to the target business has been connected to the behavior library, the configuration dimension table is searched to obtain data. Specifically: according to the filtering conditions and the first channel code, the data related to the target business is obtained from the behavior library (that is, when the matching result indicates that the target business name corresponds to the first business code, the data related to the target business is obtained from the database according to the filtering conditions and the first business code).
[0124] Step 404: If the data related to the target business is not accessed into the behavior library, the primary key is identified.
[0125] In this embodiment, if the data related to the target business is not accessed into the behavior database, the primary key is first identified, corresponding to the corresponding field in the behavior table (ie, the first channel code).
[0126] Step 405: Add a new behavior configuration information to the configuration dimension table.
[0127] In this embodiment, a data access script program is developed using a general template, and a behavior configuration information is entered into the behavior configuration dimension table using the script program (i.e., in the above text, when the matching result does not indicate that the target business name corresponds to the first business code, a second business code is generated for the target business name; the pre-configured script is triggered to run, so as to record the correspondence between the target business name and the second business code in the dimension table), so that a new behavior can be accessed; the connected behavior can directly search the behavior configuration dimension table to directly search for the corresponding channel code, without having to worry about the upstream complex processing logic, and the corresponding data can be quickly retrieved for analysis.
[0128] In this embodiment, by unifying the data acquisition caliber, only one copy of the same logic is retained to avoid the repetition of the same code. When the business scenario changes, only one script program needs to be adjusted to avoid the situation where multiple copies of the same code are not adjusted synchronously and cause caliber differences. It can reduce data redundancy, retain only one copy of the same business process data, reduce the waste of data storage hardware resources, and thus achieve the purpose of cost reduction. It has the advantages of convenient data acquisition, unified behavior library interface table, no need to pay attention to the complex business logic of the source system and the relationship between the source system tables, focus on data analysis needs, solve business pain points, enhance the value of data, and meet the goal of efficiency improvement. It can also be flexibly adjusted. To expand a new data source, you only need to adjust the configuration information table and add a new script to write the behavior data into different partitions of the behavior library, that is, different data tables. Improve the value of data, break through the data islands of different business processes, form a customer data behavior library, make data analysis more comprehensive and accurate, and provide more accurate data support for decision-making.
[0129] See also Figure 5 The embodiment of the present application further provides a data acquisition device, which can implement the above data acquisition method. The data acquisition device 510 includes:
[0130] The transceiver module 501 is used to receive a business data query request, where the business data query request includes a screening condition and a target business name of a target business;
[0131] A matching module 502 is used to match the target service name with the service name in the pre-configured dimension table to obtain a matching result, where the dimension table includes multiple service names and a service code corresponding to each service name;
[0132] The acquisition unit 503 is configured to acquire data related to the target service from a database according to a screening condition and the first service code when the matching result indicates that the target service name corresponds to the first service code.
[0133] In some embodiments, the matching module 502 is also used to filter N behavior data tables according to the filtering conditions and the first business code to obtain M behavior data tables when the matching result indicates that the target business name corresponds to the first business code, and the business code of each behavior data table in the M behavior data tables is the first business code; and obtain the data generated by the business behavior recorded in the M behavior data tables.
[0134] In some embodiments, the matching module 502 is also used to filter N behavior data tables according to the first business code to obtain a behavior data table related to the first business code when the matching result indicates that the target business name corresponds to the first business code; and filter the behavior data tables related to the first business code according to the filtering conditions to obtain M behavior data tables.
[0135] In some embodiments, the data acquisition device further includes: a processing module 504;
[0136] The processing module 504 is used to generate a second business code for the target business name if the matching result does not indicate that the target business name corresponds to the first business code; and record the correspondence between the target business name and the second business code in the dimension table.
[0137] In some embodiments, the processing module 504 is further used to trigger the execution of a preconfigured script to record the corresponding relationship between the target service name and the second service code in the dimension table.
[0138] In some embodiments, the transceiver module 501 is further used to receive a business data storage request, the business data storage request includes a target business name and data generated by the target business behavior. The processing module 504 is further used to create a target behavior data table from the database, and record the second business code and the data generated by the target business behavior in the target behavior data table.
[0139] In some embodiments, the processing module 504 is further used to encode the service name according to a preset encoding rule to obtain an encoding result; when the dimension table does not contain the encoding result, the encoding result is used as the second service code.
[0140] The specific implementation of the data acquisition device is substantially the same as the specific implementation of the above-mentioned data acquisition method, and will not be described in detail herein.
[0141] The embodiment of the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the above data acquisition method when executing the computer program. The electronic device can be any intelligent terminal including a tablet computer, a car computer, etc.
[0142] See also Figure 6 , Figure 6 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:
[0143] The processor 601 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;
[0144] The memory 602 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 602 can store an operating system and other applications. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 602, and the processor 601 calls and executes the data acquisition method of the embodiment of this application;
[0145] Input / output interface 603, used to implement information input and output;
[0146] Communication interface 604, used to realize communication interaction between the device and other devices, which can be realized by wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WIFI, Bluetooth, etc.);
[0147] Bus 605 , which transmits information between various components of the device (e.g., processor 601 , memory 602 , input / output interface 603 , and communication interface 604 );
[0148] The processor 601 , the memory 602 , the input / output interface 603 and the communication interface 604 are connected to each other in communication within the device via a bus 605 .
[0149] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program, and the computer program implements the above-mentioned data acquisition method when executed by a processor.
[0150] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0151] In addition, the embodiments of the present application may be implemented by providing a computer program product. When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device implements any one of the data acquisition methods in the above embodiments.
[0152] The data acquisition method, data acquisition device, electronic device and storage medium provided in the embodiments of the present application receive a business data query request, which includes a screening condition and a target business name of a target business, match the target business name with the business name in a preconfigured dimension table to obtain a matching result, and when the matching result indicates a first business code corresponding to the target business name, obtain data related to the target business from a database according to the screening condition and the first business code, and can effectively improve the efficiency of business data acquisition and reduce the difficulty of query through the preconfigured dimension table.
[0153] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0154] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0155] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0156] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0157] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0158] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0159] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0160] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0161] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0162] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.
[0163] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.
Claims
1. A data acquisition method, characterized in that: The method comprises: receiving a business data query request, wherein the business data query request includes a screening condition and a target business name of a target business; Matching the target service name with a service name in a preconfigured dimension table to obtain a matching result, wherein the dimension table includes multiple service names and a service code corresponding to each service name; When the matching result indicates that the target service name corresponds to a first service code, data related to the target service is acquired from a database according to the screening condition and the first service code.
2. The method according to claim 1, characterized in that The database includes N behavior data tables, each of which includes a business code corresponding to at least one business name in the dimension table, and data generated by the business behavior; When the matching result indicates that the target service name corresponds to a first service code, acquiring data related to the target service from a database according to the screening condition and the first service code includes: When the matching result indicates that the target service name corresponds to the first service code, the N behavior data tables are screened according to the screening condition and the first service code to obtain M behavior data tables, and the service code of each behavior data table in the M behavior data tables is the first service code; The data generated by the business behaviors recorded in the M behavior data tables are obtained.
3. The method according to claim 1, characterized in that The data generated by the business behavior includes the business activity time, the business activity name, the identification of the person participating in the business activity and the business activity number; the screening condition includes at least one of the following: the business activity time, the business activity name, the identification of the person participating in the business activity and the business activity number; When the matching result indicates that the target service name corresponds to the first service code, the N behavior data tables are screened according to the screening condition and the first service code to obtain M behavior data tables, including: When the matching result indicates that the target service name corresponds to a first service code, the N behavior data tables are screened according to the first service code to obtain a behavior data table related to the first service code; The behavior data tables related to the first service code are screened according to the screening condition to obtain M behavior data tables.
4. The method according to claim 1, characterized in that The method further comprises: If the matching result does not indicate that the target service name corresponds to the first service code, generating a second service code for the target service name; The correspondence between the target service name and the second service code is recorded in the dimension table.
5. The method according to claim 4, characterized in that The recording of the correspondence between the target service name and the second service code in the dimension table includes: The preconfigured script is triggered to run, so as to record the corresponding relationship between the target service name and the second service code in the dimension table.
6. The method according to claim 4, characterized in that After recording the correspondence between the target service name and the second service code in the dimension table, the method further includes: Receive a business data storage request, the business data storage request including the target business name and data generated by the target business behavior; A target behavior data table is created from the database, and the second service code and data generated by the target service behavior are recorded in the target behavior data table.
7. The method according to claim 4, characterized in that When the matching result does not indicate that the target service name corresponds to the first service code, generating a second service code for the target service name includes: Encode the service name according to a preset encoding rule to obtain an encoding result; When the dimension table does not contain the encoding result, the encoding result is used as the second service code.
8. A data acquisition device, characterized in that: The device comprises: A transceiver module, used to receive a service data query request, wherein the service data query request includes a screening condition and a target service name of a target service; A matching module, used to match the target service name with a service name in a pre-configured dimension table to obtain a matching result, wherein the dimension table includes multiple service names and a service code corresponding to each service name; An acquisition unit is used to acquire data related to the target service from a database according to the screening condition and the first service code when the matching result indicates that the target service name corresponds to the first service code.
9. An electronic device, characterized in that: The electronic device comprises a memory and a processor, the memory stores a computer program, and the processor implements the data acquisition method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the data acquisition method according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Data matching method and device, medium and electronic equipment
CN121786504A
A data matching method, device, medium and electronic equipment
CN121786504B