CN112667659B - Feature processing method and related equipment - Google Patents

Feature processing method and related equipment Download PDF

Info

Publication number
CN112667659B
CN112667659B CN202011540114.7A CN202011540114A CN112667659B CN 112667659 B CN112667659 B CN 112667659B CN 202011540114 A CN202011540114 A CN 202011540114A CN 112667659 B CN112667659 B CN 112667659B
Authority
CN
China
Prior art keywords
processed
data
determining
parameter
feature processing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011540114.7A
Other languages
Chinese (zh)
Other versions
CN112667659A (en
Inventor
虢全勇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Puhui Enterprise Management Co Ltd
Original Assignee
Ping An Puhui Enterprise Management Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Puhui Enterprise Management Co Ltd filed Critical Ping An Puhui Enterprise Management Co Ltd
Priority to CN202011540114.7A priority Critical patent/CN112667659B/en
Publication of CN112667659A publication Critical patent/CN112667659A/en
Application granted granted Critical
Publication of CN112667659B publication Critical patent/CN112667659B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to data processing and provides a feature processing method and related equipment. The method can determine a data source to be processed according to the characteristic processing request when the characteristic processing request is received; acquiring data to be processed from the data source to be processed, and writing the data to be processed into a message queue; extracting parameters to be processed in the data to be processed; determining a demand parameter according to the feature processing request, and determining a code template according to the demand parameter; generating a structured query statement according to the parameters to be processed and the code template; and processing the data to be processed by using the structured query statement based on the priority of the feature processing request in the message queue to obtain a target feature. The invention can improve the processing efficiency of the characteristics. Furthermore, the present invention also relates to blockchain techniques, where the target features may be stored in the blockchain.

Description

Feature processing method and related equipment
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a feature processing method and related devices.
Background
In the field of big data, feature engineering refers to screening better data features from original data in a series of engineering modes so as to improve training effect of a model. In the actual feature processing process, a requirement is usually put forward by a requirement engineer, and then a developer develops new features according to the requirement, however, the inventor realizes that the developer needs to write and debug programs in a large amount of time, so that derivative features cannot be generated according to the rapid change of business logic.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a feature processing method and related apparatus that can improve the processing efficiency of features.
In one aspect, the present invention provides a feature processing method, including:
when a feature processing request is received, determining a data source to be processed according to the feature processing request;
acquiring data to be processed from the data source to be processed, and writing the data to be processed into a message queue;
extracting parameters to be processed in the data to be processed;
determining a demand parameter according to the feature processing request, and determining a code template according to the demand parameter;
generating a structured query statement according to the parameters to be processed and the code template;
and processing the data to be processed by using the structured query statement based on the priority of the feature processing request in the message queue to obtain a target feature.
According to a preferred embodiment of the present invention, the generating a structured query statement according to the parameters to be processed and the code template includes:
determining the parameter quantity of the parameter to be processed and determining the filling quantity of filling positions on the code template;
When the parameter quantity is larger than the filling quantity, determining a first difference value between the parameter quantity and the filling quantity, expanding the filling position on the code template according to the first difference value to obtain an expanded template, and writing the parameter to be processed into the expanded template to obtain the structured query statement; or alternatively
When the parameter quantity is smaller than the filling quantity, determining a second difference value between the parameter quantity and the filling quantity, deleting the filling position on the code template according to the second difference value to obtain a shrinkage limiting template, and writing the parameter to be processed into the shrinkage limiting template to obtain the structured query statement; or alternatively
And when the parameter quantity is equal to the filling quantity, writing the parameters to be processed into the code template to obtain the structured query statement.
According to a preferred embodiment of the present invention, the processing the data to be processed using the structured query statement based on the priority of the feature processing request in the message queue, and obtaining the target feature includes:
acquiring all requests in the message queue, wherein the all requests comprise the feature processing request;
Determining the request grades of all requests, and sequencing all requests according to the order of the request grades from big to small to obtain a request queue;
determining the priority of the feature processing request according to the position of the feature processing request in the request queue;
and after detecting that the request with higher priority finishes responding, processing the data to be processed by using the structured query statement to obtain the target feature.
According to a preferred embodiment of the present invention, the acquiring the data to be processed from the data to be processed source includes:
determining a triggering user of the feature processing request;
acquiring a user identification code of the triggering user, and determining a user role of the triggering user according to the user identification code;
determining a data table corresponding to the user role from the data source to be processed;
and extracting all data in the data table to obtain the data to be processed.
According to a preferred embodiment of the present invention, the writing the data to be processed into the message queue includes:
determining the data volume of the data to be processed, and determining a processing thread according to the data volume;
determining a data format of the data to be processed;
Detecting whether the data format is a preset format or not;
and when the data format is not the preset format, converting the data to be processed into the data with the preset format by using the processing thread, and writing the converted data into the message queue.
According to a preferred embodiment of the present invention, the determining a data source to be processed according to the characteristic processing request includes:
analyzing the message of the feature processing request to obtain message information carried by the message;
acquiring a first preset label from a configuration label library, wherein the first preset label is used for indicating a system identifier;
acquiring information corresponding to the first preset label from the message information as a system number;
determining a service system according to the system code;
and determining a database in the service system as the data source to be processed.
According to a preferred embodiment of the present invention, the determining a demand parameter according to the feature processing request, and determining a code template according to the demand parameter includes:
acquiring a second preset label from the configuration label library, wherein the second preset label is used for indicating the requirement;
acquiring information corresponding to the second preset label from the message information as the requirement parameter;
And acquiring a template corresponding to the requirement parameter from a preset template library as the code template.
In another aspect, the present invention also provides a feature processing apparatus, including:
the determining unit is used for determining a data source to be processed according to the characteristic processing request when the characteristic processing request is received;
the execution unit is used for acquiring the data to be processed from the data source to be processed and writing the data to be processed into the message queue;
the extraction unit is used for extracting parameters to be processed in the data to be processed;
the determining unit is further used for determining a demand parameter according to the feature processing request and determining a code template according to the demand parameter;
the generating unit is used for generating a structured query statement according to the parameters to be processed and the code template;
and the processing unit is used for processing the data to be processed by utilizing the structured query statement based on the priority of the feature processing request in the message queue to obtain the target feature.
In another aspect, the present invention also proposes an electronic device, including:
a memory storing computer readable instructions; and
And a processor executing computer readable instructions stored in the memory to implement the feature processing method.
In another aspect, the present invention also proposes a computer readable storage medium having stored therein computer readable instructions that are executed by a processor in an electronic device to implement the feature processing method.
According to the technical scheme, when the feature processing request is received, the data source to be processed can be determined according to the feature processing request, the data source of the data to be processed can be determined from the feature processing request, the data to be processed can be rapidly acquired through the data source, the data to be processed is acquired from the data source to be processed, the data to be processed is written into the message queue, the parameters to be processed in the data to be processed are extracted, the demand parameters are determined according to the feature processing request, the code template is determined according to the demand parameters, and due to the fact that the code template is not required to be written, the generation efficiency of the structured query statement can be improved, the data to be processed is processed according to the parameters to be processed and the code template, the target feature is obtained by utilizing the structured query statement based on the priority of the feature processing request in the message queue, the influence of other requests on the feature of the feature can be avoided, and the smooth generation of the feature request can be ensured. According to the method and the device for processing the target feature, the requirement parameters in the feature processing request are determined, the code module corresponding to the requirement parameters can be determined, the parameters to be processed and the code template are utilized, the structured query statement can be generated rapidly, and because a developer does not need to write and debug a program manually, the processing efficiency of the target feature can be improved, the timeliness of feature processing is improved, meanwhile, the range of applicable crowds of the feature processing mode can be improved, in addition, the data to be processed is written into the message queue, the data to be processed can be processed based on the priority of the feature processing request, so that the influence of other requests on the feature processing request is avoided, and smooth generation of the target feature is ensured.
Drawings
FIG. 1 is a flow chart of a preferred embodiment of the feature processing method of the present invention.
FIG. 2 is a flow diagram of one embodiment of the present invention for generating a structured query statement.
FIG. 3 is a flow chart of one embodiment of the present invention for generating a target feature.
Fig. 4 is a functional block diagram of a preferred embodiment of the feature processing apparatus of the present invention.
Fig. 5 is a schematic structural diagram of an electronic device according to a preferred embodiment of the present invention for implementing the feature processing method.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in detail with reference to the accompanying drawings and specific embodiments.
FIG. 1 is a flow chart of a preferred embodiment of the feature processing method of the present invention. The order of the steps in the flowchart may be changed and some steps may be omitted according to various needs.
The feature processing method is applied to one or more electronic devices, wherein the electronic devices are devices capable of automatically performing numerical calculation and/or information processing according to preset or stored computer readable instructions, and the hardware comprises, but is not limited to, microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASICs), programmable gate arrays (Field-Programmable Gate Array, FPGA), digital processors (Digital Signal Processor, DSP), embedded devices and the like.
The electronic device may be any electronic product that can interact with a user in a human-computer manner, such as a personal computer, tablet computer, smart phone, personal digital assistant (Personal Digital Assistant, PDA), game console, interactive internet protocol television (Internet Protocol Television, IPTV), smart wearable device, etc.
The electronic device may comprise a network device and/or a user device. Wherein the network device includes, but is not limited to, a single network electronic device, a group of electronic devices made up of multiple network electronic devices, or a Cloud based Cloud Computing (Cloud Computing) made up of a large number of hosts or network electronic devices.
The network on which the electronic device is located includes, but is not limited to: the internet, wide area networks, metropolitan area networks, local area networks, virtual private networks (Virtual Private Network, VPN), etc.
And S10, when a characteristic processing request is received, determining a data source to be processed according to the characteristic processing request.
In at least one embodiment of the invention, the feature processing request may be triggered by a data analyst. The information carried in the feature processing request includes, but is not limited to: system number, demand parameters, etc.
The data source to be processed can be a database in any business system.
In at least one embodiment of the present invention, the determining, by the electronic device, a data source to be processed according to the feature processing request includes:
analyzing the message of the feature processing request to obtain message information carried by the message;
acquiring a first preset label from a configuration label library, wherein the first preset label is used for indicating a system identifier;
acquiring information corresponding to the first preset label from the message information as a system number;
determining a service system according to the system code;
and determining a database in the service system as the data source to be processed.
Wherein, a plurality of predefined labels are stored in the configuration label library.
The system code is capable of uniquely identifying the business system.
The message information can be quickly obtained by analyzing the message of the feature processing request, and the system number can be accurately extracted from the message information through the first preset label.
S11, obtaining the data to be processed from the data source to be processed, and writing the data to be processed into a message queue.
In at least one embodiment of the present invention, the data to be processed refers to data that requires feature processing.
The message queue may be Kafka, where Kafka is a high throughput distributed publish-subscribe message system.
In at least one embodiment of the present invention, the electronic device obtaining the data to be processed from the data to be processed source includes:
determining a triggering user of the feature processing request;
acquiring a user identification code of the triggering user, and determining a user role of the triggering user according to the user identification code;
determining a data table corresponding to the user role from the data source to be processed;
and extracting all data in the data table to obtain the data to be processed.
The user identification code refers to a code capable of uniquely identifying the triggering user, and the user identification code can be the work number of the triggering user, an identity card of the triggering user and the like.
The user role refers to a role that the trigger user acts on, for example, the user role may be a role of the trigger user.
The data table may be a record of sales of a certain cell phone brand.
By determining the user role of the triggering user, the object to be processed in the feature processing request can be rapidly determined according to the user role.
In at least one embodiment of the present invention, the electronic device writing the data to be processed into a message queue includes:
determining the data volume of the data to be processed, and determining a processing thread according to the data volume;
determining a data format of the data to be processed;
detecting whether the data format is a preset format or not;
and when the data format is not the preset format, converting the data to be processed into the data with the preset format by using the processing thread, and writing the converted data into the message queue.
The preset format can be set according to an application scene.
By the embodiment, the format of the data written into the message queue can be ensured to meet the preset format so as to facilitate subsequent characteristic processing of the data, and in addition, the processing thread is determined according to the data quantity, so that the writing efficiency of the data can be improved.
S12, extracting parameters to be processed in the data to be processed.
In at least one embodiment of the present invention, the to-be-processed parameter refers to a field to be processed, for example, the to-be-processed parameter may be sales, price, etc.
In at least one embodiment of the present invention, the extracting, by the electronic device, a parameter to be processed in the data to be processed includes:
extracting all fields in the data table;
and determining all the fields as the parameters to be processed.
According to the embodiment, the field corresponding to the parameter to be processed is stored in the data table, so that the parameter to be processed can be rapidly determined.
S13, determining a demand parameter according to the feature processing request, and determining a code template according to the demand parameter.
In at least one embodiment of the present invention, the demand parameter is determined by the triggering user, and the demand parameter may be an average value or a sum.
The code template refers to a code statement corresponding to the requirement parameter.
In at least one embodiment of the present invention, the determining, by the electronic device, a demand parameter according to the feature processing request, and determining, by the electronic device, a code template according to the demand parameter includes:
Acquiring a second preset label from the configuration label library, wherein the second preset label is used for indicating the requirement;
acquiring information corresponding to the second preset label from the message information as the requirement parameter;
and acquiring a template corresponding to the requirement parameter from a preset template library as the code template.
And storing a plurality of templates in the preset module board.
Through the implementation mode, the code template corresponding to the requirement parameter can be rapidly determined.
S14, generating a structured query statement according to the parameters to be processed and the code template.
Referring to FIG. 2, FIG. 2 is a flow chart of one embodiment of the present invention for generating a structured query statement. In at least one embodiment of the present invention, the generating, by the electronic device, a structured query statement according to the parameters to be processed and the code template includes:
s140, determining the parameter quantity of the parameter to be processed, and determining the filling quantity of the filling position on the code template.
The parameter number refers to the number of the parameters to be processed.
The population quantity refers to the number of locations on the code template where population parameters can be performed.
And S141, when the parameter quantity is larger than the filling quantity, determining a first difference value between the parameter quantity and the filling quantity, expanding the filling position on the code template according to the first difference value to obtain an expanded template, and writing the parameter to be processed into the expanded template to obtain the structured query statement.
For example, the number of parameters is 8, the number of padding is 5, the first difference is 3 after calculation, and then 3 positions where padding parameters can be performed are extended on the code template.
And S142, when the parameter quantity is smaller than the filling quantity, determining a second difference value between the parameter quantity and the filling quantity, deleting the filling position on the code template according to the second difference value to obtain a shrinkage limiting template, and writing the parameter to be processed into the shrinkage limiting template to obtain the structured query statement.
And S143, when the parameter quantity is equal to the filling quantity, writing the parameters to be processed into the code template to obtain the structured query statement.
According to the embodiment, the code template can be adjusted according to the parameters to be processed, the applicability of the code template is improved, and in addition, the parameters to be processed are written into the code template, and the code template part does not need to be written, so that the generation efficiency of the structured query statement can be improved.
And S15, processing the data to be processed by using the structured query statement based on the priority of the feature processing request in the message queue to obtain target features.
It is emphasized that the target features may also be stored in nodes of a blockchain in order to further guarantee privacy and security of the target features.
In at least one embodiment of the present invention, the target feature is determined according to the to-be-processed parameter, the to-be-processed data, and the demand parameter, for example: the target characteristic may be a total sales of handsets in a certain area.
Referring to fig. 3, fig. 3 is a flow chart of one embodiment of the present invention for generating target features. In at least one embodiment of the present invention, the processing, by the electronic device, the data to be processed using the structured query statement based on the priority of the feature processing request in the message queue, to obtain the target feature includes:
s150, acquiring all requests in the message queue, wherein the all requests comprise the feature processing request.
All requests refer to requests that are not processed in the message queue.
S151, determining the request grades of all the requests, and sequencing all the requests according to the order of the request grades from big to small to obtain a request queue.
The request level refers to the degree of urgency in processing each request.
S152, determining the priority of the feature processing request according to the position of the feature processing request in the request queue.
And S153, processing the data to be processed by using the structured query statement after detecting that the request with the priority is finished responding to the request, and obtaining the target feature.
By the method, the influence of other requests on the feature processing request can be avoided, and smooth generation of the target feature is ensured.
In at least one embodiment of the present invention, after obtaining the target feature, the method further comprises:
acquiring a request number of the feature processing request;
generating prompt information according to the request number and the target characteristics;
encrypting the prompt information by adopting a symmetric encryption algorithm to obtain a ciphertext;
and sending the ciphertext to the terminal equipment of the triggering user.
Through the implementation mode, the prompt information can be generated in time after the target feature is generated, and then the trigger user can be informed of receiving in time.
According to the technical scheme, when the feature processing request is received, the data source to be processed can be determined according to the feature processing request, the data source of the data to be processed can be determined from the feature processing request, the data to be processed can be rapidly acquired through the data source, the data to be processed is acquired from the data source to be processed, the data to be processed is written into the message queue, the parameters to be processed in the data to be processed are extracted, the demand parameters are determined according to the feature processing request, the code template is determined according to the demand parameters, and due to the fact that the code template is not required to be written, the generation efficiency of the structured query statement can be improved, the data to be processed is processed according to the parameters to be processed and the code template, the target feature is obtained by utilizing the structured query statement based on the priority of the feature processing request in the message queue, the influence of other requests on the feature of the feature can be avoided, and the smooth generation of the feature request can be ensured. According to the method and the device for processing the target feature, the requirement parameters in the feature processing request are determined, the code module corresponding to the requirement parameters can be determined, the parameters to be processed and the code template are utilized, the structured query statement can be generated rapidly, and because a developer does not need to write and debug a program manually, the processing efficiency of the target feature can be improved, the timeliness of feature processing is improved, meanwhile, the range of applicable crowds of the feature processing mode can be improved, in addition, the data to be processed is written into the message queue, the data to be processed can be processed based on the priority of the feature processing request, so that the influence of other requests on the feature processing request is avoided, and smooth generation of the target feature is ensured.
Fig. 4 is a functional block diagram of a preferred embodiment of the feature processing apparatus of the present invention. The feature processing apparatus 11 includes a determination unit 110, an execution unit 111, an extraction unit 112, a generation unit 113, a processing unit 114, an acquisition unit 115, an encryption unit 116, and a transmission unit 117. The module/unit referred to herein is a series of computer readable instructions capable of being retrieved by the processor 13 and performing a fixed function and stored in the memory 12. In the present embodiment, the functions of the respective modules/units will be described in detail in the following embodiments.
When a feature processing request is received, the determining unit 110 determines a data source to be processed according to the feature processing request.
In at least one embodiment of the invention, the feature processing request may be triggered by a data analyst. The information carried in the feature processing request includes, but is not limited to: system number, demand parameters, etc.
The data source to be processed can be a database in any business system.
In at least one embodiment of the present invention, the determining unit 110 determines the data source to be processed according to the feature processing request includes:
Analyzing the message of the feature processing request to obtain message information carried by the message;
acquiring a first preset label from a configuration label library, wherein the first preset label is used for indicating a system identifier;
acquiring information corresponding to the first preset label from the message information as a system number;
determining a service system according to the system code;
and determining a database in the service system as the data source to be processed.
Wherein, a plurality of predefined labels are stored in the configuration label library.
The system code is capable of uniquely identifying the business system.
The message information can be quickly obtained by analyzing the message of the feature processing request, and the system number can be accurately extracted from the message information through the first preset label.
The execution unit 111 obtains the data to be processed from the data source to be processed, and writes the data to be processed into a message queue.
In at least one embodiment of the present invention, the data to be processed refers to data that requires feature processing.
The message queue may be Kafka, where Kafka is a high throughput distributed publish-subscribe message system.
In at least one embodiment of the present invention, the obtaining, by the execution unit 111, data to be processed from the data to be processed source includes:
determining a triggering user of the feature processing request;
acquiring a user identification code of the triggering user, and determining a user role of the triggering user according to the user identification code;
determining a data table corresponding to the user role from the data source to be processed;
and extracting all data in the data table to obtain the data to be processed.
The user identification code refers to a code capable of uniquely identifying the triggering user, and the user identification code can be the work number of the triggering user, an identity card of the triggering user and the like.
The user role refers to a role that the trigger user acts on, for example, the user role may be a role of the trigger user.
The data table may be a record of sales of a certain cell phone brand.
By determining the user role of the triggering user, the object to be processed in the feature processing request can be rapidly determined according to the user role.
In at least one embodiment of the present invention, the writing the data to be processed into the message queue by the execution unit 111 includes:
determining the data volume of the data to be processed, and determining a processing thread according to the data volume;
determining a data format of the data to be processed;
detecting whether the data format is a preset format or not;
and when the data format is not the preset format, converting the data to be processed into the data with the preset format by using the processing thread, and writing the converted data into the message queue.
The preset format can be set according to an application scene.
By the embodiment, the format of the data written into the message queue can be ensured to meet the preset format so as to facilitate subsequent characteristic processing of the data, and in addition, the processing thread is determined according to the data quantity, so that the writing efficiency of the data can be improved.
The extraction unit 112 extracts parameters to be processed in the data to be processed.
In at least one embodiment of the present invention, the to-be-processed parameter refers to a field to be processed, for example, the to-be-processed parameter may be sales, price, etc.
In at least one embodiment of the present invention, the extracting unit 112 extracts the parameters to be processed in the data to be processed, including:
extracting all fields in the data table;
and determining all the fields as the parameters to be processed.
According to the embodiment, the field corresponding to the parameter to be processed is stored in the data table, so that the parameter to be processed can be rapidly determined.
The determining unit 110 determines a demand parameter according to the feature processing request, and determines a code template according to the demand parameter.
In at least one embodiment of the present invention, the demand parameter is determined by the triggering user, and the demand parameter may be an average value or a sum.
The code template refers to a code statement corresponding to the requirement parameter.
In at least one embodiment of the present invention, the determining unit 110 determines a demand parameter according to the feature processing request, and determining a code template according to the demand parameter includes:
acquiring a second preset label from the configuration label library, wherein the second preset label is used for indicating the requirement;
acquiring information corresponding to the second preset label from the message information as the requirement parameter;
And acquiring a template corresponding to the requirement parameter from a preset template library as the code template.
And storing a plurality of templates in the preset module board.
Through the implementation mode, the code template corresponding to the requirement parameter can be rapidly determined.
The generating unit 113 generates a structured query statement according to the parameters to be processed and the code template.
In at least one embodiment of the present invention, the generating unit 113 generates a structured query statement according to the parameters to be processed and the code template includes:
and determining the parameter quantity of the parameter to be processed and determining the filling quantity of filling positions on the code template.
The parameter number refers to the number of the parameters to be processed.
The population quantity refers to the number of locations on the code template where population parameters can be performed.
When the parameter number is larger than the filling number, determining a first difference value between the parameter number and the filling number, expanding the filling position on the code template according to the first difference value to obtain an expanded template, and writing the parameter to be processed into the expanded template to obtain the structured query statement.
For example, the number of parameters is 8, the number of padding is 5, the first difference is 3 after calculation, and then 3 positions where padding parameters can be performed are extended on the code template.
And when the parameter quantity is smaller than the filling quantity, determining a second difference value between the parameter quantity and the filling quantity, deleting the filling position on the code template according to the second difference value to obtain a shrinkage limiting template, and writing the parameter to be processed into the shrinkage limiting template to obtain the structured query statement.
And when the parameter quantity is equal to the filling quantity, writing the parameters to be processed into the code template to obtain the structured query statement.
According to the embodiment, the code template can be adjusted according to the parameters to be processed, the applicability of the code template is improved, and in addition, the parameters to be processed are written into the code template, and the code template part does not need to be written, so that the generation efficiency of the structured query statement can be improved.
The processing unit 114 processes the data to be processed by using the structured query statement based on the priority of the feature processing request in the message queue, so as to obtain a target feature.
It is emphasized that the target features may also be stored in nodes of a blockchain in order to further guarantee privacy and security of the target features.
In at least one embodiment of the present invention, the target feature is determined according to the to-be-processed parameter, the to-be-processed data, and the demand parameter, for example: the target characteristic may be a total sales of handsets in a certain area.
In at least one embodiment of the present invention, the processing unit 114 processes the data to be processed using the structured query statement based on the priority of the feature processing request in the message queue, and obtaining the target feature includes:
and acquiring all requests in the message queue, wherein the all requests comprise the feature processing request.
All requests refer to requests that are not processed in the message queue.
And determining the request grades of all the requests, and sequencing all the requests according to the order of the request grades from big to small to obtain a request queue.
The request level refers to the degree of urgency in processing each request.
And determining the priority of the feature processing request according to the position of the feature processing request in the request queue.
And after detecting that the request with higher priority finishes responding, processing the data to be processed by using the structured query statement to obtain the target feature.
By the method, the influence of other requests on the feature processing request can be avoided, and smooth generation of the target feature is ensured.
In at least one embodiment of the present invention, after obtaining the target feature, the obtaining unit 115 obtains the request number of the feature processing request;
the generating unit 113 generates prompt information according to the request number and the target feature;
the encryption unit 116 encrypts the prompt information by adopting a symmetric encryption algorithm to obtain ciphertext;
the transmitting unit 117 transmits the ciphertext to the terminal device of the triggering user.
Through the implementation mode, the prompt information can be generated in time after the target feature is generated, and then the trigger user can be informed of receiving in time.
According to the technical scheme, when the feature processing request is received, the data source to be processed can be determined according to the feature processing request, the data source of the data to be processed can be determined from the feature processing request, the data to be processed can be rapidly acquired through the data source, the data to be processed is acquired from the data source to be processed, the data to be processed is written into the message queue, the parameters to be processed in the data to be processed are extracted, the demand parameters are determined according to the feature processing request, the code template is determined according to the demand parameters, and due to the fact that the code template is not required to be written, the generation efficiency of the structured query statement can be improved, the data to be processed is processed according to the parameters to be processed and the code template, the target feature is obtained by utilizing the structured query statement based on the priority of the feature processing request in the message queue, the influence of other requests on the feature of the feature can be avoided, and the smooth generation of the feature request can be ensured. According to the method and the device for processing the target feature, the requirement parameters in the feature processing request are determined, the code module corresponding to the requirement parameters can be determined, the parameters to be processed and the code template are utilized, the structured query statement can be generated rapidly, and because a developer does not need to write and debug a program manually, the processing efficiency of the target feature can be improved, the timeliness of feature processing is improved, meanwhile, the range of applicable crowds of the feature processing mode can be improved, in addition, the data to be processed is written into the message queue, the data to be processed can be processed based on the priority of the feature processing request, so that the influence of other requests on the feature processing request is avoided, and smooth generation of the target feature is ensured.
Fig. 5 is a schematic structural diagram of an electronic device according to a preferred embodiment of the present invention for implementing the feature processing method.
In one embodiment of the invention, the electronic device 1 includes, but is not limited to, a memory 12, a processor 13, and computer readable instructions, such as a feature processor, stored in the memory 12 and executable on the processor 13.
It will be appreciated by those skilled in the art that the schematic diagram is merely an example of the electronic device 1 and does not constitute a limitation of the electronic device 1, and may include more or less components than illustrated, or may combine certain components, or different components, e.g. the electronic device 1 may further include input-output devices, network access devices, buses, etc.
The processor 13 may be a central processing unit (Central Processing Unit, CPU), but may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. The general purpose processor may be a microprocessor or the processor may be any conventional processor, etc., and the processor 13 is an operation core and a control center of the electronic device 1, connects various parts of the entire electronic device 1 using various interfaces and lines, and executes an operating system of the electronic device 1 and various installed applications, program codes, etc.
Illustratively, the computer readable instructions may be partitioned into one or more modules/units that are stored in the memory 12 and executed by the processor 13 to complete the present invention. The one or more modules/units may be a series of computer readable instructions capable of performing a specific function, the computer readable instructions describing a process of executing the computer readable instructions in the electronic device 1. For example, the computer-readable instructions may be divided into a determining unit 110, an executing unit 111, an extracting unit 112, a generating unit 113, a processing unit 114, an acquiring unit 115, an encrypting unit 116, and a transmitting unit 117.
The memory 12 may be used to store the computer readable instructions and/or modules, and the processor 13 may implement various functions of the electronic device 1 by executing or executing the computer readable instructions and/or modules stored in the memory 12 and invoking data stored in the memory 12. The memory 12 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like; the storage data area may store data created according to the use of the electronic device, etc. Memory 12 may include non-volatile and volatile memory, such as: a hard disk, memory, plug-in hard disk, smart Media Card (SMC), secure Digital (SD) Card, flash Card (Flash Card), at least one disk storage device, flash memory device, or other storage device.
The memory 12 may be an external memory and/or an internal memory of the electronic device 1. Further, the memory 12 may be a physical memory, such as a memory bank, a TF Card (Trans-flash Card), or the like.
The integrated modules/units of the electronic device 1 may be stored in a computer readable storage medium if implemented in the form of software functional units and sold or used as separate products. Based on such understanding, the present invention may also be implemented by implementing all or part of the processes in the methods of the embodiments described above, by instructing the associated hardware by means of computer readable instructions, which may be stored in a computer readable storage medium, the computer readable instructions, when executed by a processor, implementing the steps of the respective method embodiments described above.
Wherein the computer readable instructions comprise computer readable instruction code which may be in the form of source code, object code, executable files, or in some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying the computer readable instruction code, a recording medium, a USB flash disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory).
The blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm and the like. The Blockchain (Blockchain), which is essentially a decentralised database, is a string of data blocks that are generated by cryptographic means in association, each data block containing a batch of information of network transactions for verifying the validity of the information (anti-counterfeiting) and generating the next block. The blockchain may include a blockchain underlying platform, a platform product services layer, an application services layer, and the like.
In connection with fig. 1, the memory 12 in the electronic device 1 stores computer readable instructions implementing a feature processing method, the processor 13 being executable to implement:
when a feature processing request is received, determining a data source to be processed according to the feature processing request;
acquiring data to be processed from the data source to be processed, and writing the data to be processed into a message queue;
extracting parameters to be processed in the data to be processed;
determining a demand parameter according to the feature processing request, and determining a code template according to the demand parameter;
Generating a structured query statement according to the parameters to be processed and the code template;
and processing the data to be processed by using the structured query statement based on the priority of the feature processing request in the message queue to obtain a target feature.
In particular, the specific implementation method of the processor 13 on the computer readable instructions may refer to the description of the relevant steps in the corresponding embodiment of fig. 1, which is not repeated herein.
In the several embodiments provided in the present invention, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical function division, and there may be other manners of division when actually implemented.
The computer readable storage medium has stored thereon computer readable instructions, wherein the computer readable instructions when executed by the processor 13 are configured to implement the steps of:
when a feature processing request is received, determining a data source to be processed according to the feature processing request;
acquiring data to be processed from the data source to be processed, and writing the data to be processed into a message queue;
Extracting parameters to be processed in the data to be processed;
determining a demand parameter according to the feature processing request, and determining a code template according to the demand parameter;
generating a structured query statement according to the parameters to be processed and the code template;
and processing the data to be processed by using the structured query statement based on the priority of the feature processing request in the message queue to obtain a target feature.
The modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical units, may be located in one place, or may be distributed over 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.
In addition, each functional module in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units can be realized in a form of hardware or a form of hardware and a form of software functional modules.
The present embodiments are, therefore, to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
Furthermore, it is evident that the word "comprising" does not exclude other elements or steps, and that the singular does not exclude a plurality. The units or means may also be implemented by one unit or means in software or hardware. The terms first, second, etc. are used to denote a name, but not any particular order.
Finally, it should be noted that the above-mentioned embodiments are merely for illustrating the technical solution of the present invention and not for limiting the same, and although the present invention has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications and equivalents may be made to the technical solution of the present invention without departing from the spirit and scope of the technical solution of the present invention.

Claims (8)

1. A feature processing method, characterized in that the feature processing method comprises:
When a feature processing request is received, determining a data source to be processed according to the feature processing request;
acquiring data to be processed from the data source to be processed, and writing the data to be processed into a message queue;
extracting parameters to be processed in the data to be processed;
determining a demand parameter according to the feature processing request, and determining a code template according to the demand parameter, wherein the method comprises the following steps: acquiring a second preset label from a configuration label library, wherein the second preset label is used for indicating the requirement; acquiring information corresponding to the second preset label from the message information as the requirement parameter; acquiring a template corresponding to the requirement parameter from a preset template library as the code template;
generating a structured query statement according to the parameters to be processed and the code template, including: determining the parameter quantity of the parameter to be processed and determining the filling quantity of filling positions on the code template; when the parameter quantity is larger than the filling quantity, determining a first difference value between the parameter quantity and the filling quantity, expanding the filling position on the code template according to the first difference value to obtain an expanded template, and writing the parameter to be processed into the expanded template to obtain the structured query statement; or when the parameter quantity is smaller than the filling quantity, determining a second difference value between the parameter quantity and the filling quantity, deleting the filling position on the code template according to the second difference value to obtain a shrinkage limiting template, and writing the parameter to be processed into the shrinkage limiting template to obtain the structured query statement; or when the parameter quantity is equal to the filling quantity, writing the parameter to be processed into the code template to obtain the structured query statement;
And processing the data to be processed by using the structured query statement based on the priority of the feature processing request in the message queue to obtain a target feature.
2. The feature processing method of claim 1, wherein the processing the data to be processed using the structured query statement based on the priority of the feature processing request in the message queue, the obtaining the target feature comprises:
acquiring all requests in the message queue, wherein the all requests comprise the feature processing request;
determining the request grades of all requests, and sequencing all requests according to the order of the request grades from big to small to obtain a request queue;
determining the priority of the feature processing request according to the position of the feature processing request in the request queue;
and after detecting that the request with higher priority finishes responding, processing the data to be processed by using the structured query statement to obtain the target feature.
3. The feature processing method of claim 1, wherein the obtaining the data to be processed from the data to be processed source comprises:
Determining a triggering user of the feature processing request;
acquiring a user identification code of the triggering user, and determining a user role of the triggering user according to the user identification code;
determining a data table corresponding to the user role from the data source to be processed;
and extracting all data in the data table to obtain the data to be processed.
4. The feature processing method of claim 1, wherein the writing the data to be processed into a message queue comprises:
determining the data volume of the data to be processed, and determining a processing thread according to the data volume;
determining a data format of the data to be processed;
detecting whether the data format is a preset format or not;
and when the data format is not the preset format, converting the data to be processed into the data with the preset format by using the processing thread, and writing the converted data into the message queue.
5. The feature processing method of claim 1, wherein said determining a source of data to be processed from said feature processing request comprises:
analyzing the message of the feature processing request to obtain the message information carried by the message;
Acquiring a first preset label from the configuration label library, wherein the first preset label is used for indicating a system identifier;
acquiring information corresponding to the first preset label from the message information as a system number;
determining a service system according to the system number;
and determining a database in the service system as the data source to be processed.
6. A feature processing apparatus, characterized in that the feature processing apparatus comprises:
the determining unit is used for determining a data source to be processed according to the characteristic processing request when the characteristic processing request is received;
the execution unit is used for acquiring the data to be processed from the data source to be processed and writing the data to be processed into the message queue;
the extraction unit is used for extracting parameters to be processed in the data to be processed;
the determining unit is further configured to determine a requirement parameter according to the feature processing request, and determine a code template according to the requirement parameter, and includes: acquiring a second preset label from a configuration label library, wherein the second preset label is used for indicating the requirement; acquiring information corresponding to the second preset label from the message information as the requirement parameter; acquiring a template corresponding to the requirement parameter from a preset template library as the code template;
The generating unit is used for generating a structured query statement according to the parameters to be processed and the code template, and comprises the following steps: determining the parameter quantity of the parameter to be processed and determining the filling quantity of filling positions on the code template; when the parameter quantity is larger than the filling quantity, determining a first difference value between the parameter quantity and the filling quantity, expanding the filling position on the code template according to the first difference value to obtain an expanded template, and writing the parameter to be processed into the expanded template to obtain the structured query statement; or when the parameter quantity is smaller than the filling quantity, determining a second difference value between the parameter quantity and the filling quantity, deleting the filling position on the code template according to the second difference value to obtain a shrinkage limiting template, and writing the parameter to be processed into the shrinkage limiting template to obtain the structured query statement; or when the parameter quantity is equal to the filling quantity, writing the parameter to be processed into the code template to obtain the structured query statement;
and the processing unit is used for processing the data to be processed by utilizing the structured query statement based on the priority of the feature processing request in the message queue to obtain the target feature.
7. An electronic device, the electronic device comprising:
a memory storing computer readable instructions; and
A processor executing computer readable instructions stored in the memory to implement the feature processing method of any one of claims 1 to 5.
8. A computer-readable storage medium, characterized by: the computer-readable storage medium has stored therein computer-readable instructions that are executed by a processor in an electronic device to implement the feature processing method of any one of claims 1 to 5.
CN202011540114.7A 2020-12-23 2020-12-23 Feature processing method and related equipment Active CN112667659B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011540114.7A CN112667659B (en) 2020-12-23 2020-12-23 Feature processing method and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011540114.7A CN112667659B (en) 2020-12-23 2020-12-23 Feature processing method and related equipment

Publications (2)

Publication Number Publication Date
CN112667659A CN112667659A (en) 2021-04-16
CN112667659B true CN112667659B (en) 2024-04-02

Family

ID=75408912

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011540114.7A Active CN112667659B (en) 2020-12-23 2020-12-23 Feature processing method and related equipment

Country Status (1)

Country Link
CN (1) CN112667659B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103064950A (en) * 2012-12-27 2013-04-24 北京思特奇信息技术股份有限公司 Database client construction method and database client system
CN106293664A (en) * 2015-05-27 2017-01-04 交通银行股份有限公司 Code generating method and device
CN107480280A (en) * 2017-08-22 2017-12-15 金蝶软件(中国)有限公司 The method and relevant device of a kind of data processing

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090125892A1 (en) * 2005-11-18 2009-05-14 Robert Arthur Crewdson Computer Software Development System and Method
US8145655B2 (en) * 2007-06-22 2012-03-27 International Business Machines Corporation Generating information on database queries in source code into object code compiled from the source code
US10656919B2 (en) * 2016-10-25 2020-05-19 Paypal, Inc. Matching programming variables across different data domains

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103064950A (en) * 2012-12-27 2013-04-24 北京思特奇信息技术股份有限公司 Database client construction method and database client system
CN106293664A (en) * 2015-05-27 2017-01-04 交通银行股份有限公司 Code generating method and device
CN107480280A (en) * 2017-08-22 2017-12-15 金蝶软件(中国)有限公司 The method and relevant device of a kind of data processing

Also Published As

Publication number Publication date
CN112667659A (en) 2021-04-16

Similar Documents

Publication Publication Date Title
CN112669138B (en) Data processing method and related equipment
CN112541009B (en) Data query method, device, electronic equipment and storage medium
CN111797351A (en) Page data management method and device, electronic equipment and medium
CN112632163B (en) Big data report export method and related equipment
CN112163412B (en) Data verification method and device, electronic equipment and storage medium
CN112053143B (en) Fund routing method, apparatus, electronic device and storage medium
CN112711398A (en) Method, device and equipment for generating buried point file and storage medium
CN112948418A (en) Dynamic query method, device, equipment and storage medium
CN111796936A (en) Request processing method and device, electronic equipment and medium
CN111814045A (en) Data query method and device, electronic equipment and storage medium
CN112784566A (en) Document generation method, device, equipment and storage medium
CN112947911A (en) Interface script generation method, device, equipment and storage medium
CN112434062A (en) Quasi-real-time data processing method, device, server and storage medium
CN111680483A (en) Document template updating method and device, electronic equipment and medium
CN116360769A (en) Code generation method, device, equipment and storage medium
CN116629423A (en) User behavior prediction method, device, equipment and storage medium
CN112667659B (en) Feature processing method and related equipment
CN112817742B (en) Data migration method, device, equipment and storage medium
CN116089535A (en) Data synchronization method, device, equipment and storage medium
CN112395319B (en) Cache sharing method and device, server and storage medium
CN112181485B (en) Script execution method and device, electronic equipment and storage medium
CN112950154B (en) Flow information matching method, device, equipment and storage medium
CN112102205B (en) Image deblurring method and device, electronic equipment and storage medium
CN114238296A (en) Product index data display method, device, equipment and storage medium
CN114329095A (en) System logic diagram generation method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant