Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The method provided by the embodiment of the application can be executed in a computer terminal, a computer terminal or a similar operation device. Taking the example of being operated on a computer terminal, fig. 1 is a hardware structure block diagram of a computer terminal of a data request processing method according to an embodiment of the present invention. As shown in fig. 1, the computer terminal may include one or more (only one shown in fig. 1) processors 102 (the processors 102 may include, but are not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, and in an exemplary embodiment, may also include a transmission device 106 for communication functions and an input-output device 108. It will be understood by those skilled in the art that the structure shown in fig. 1 is only an illustration and is not intended to limit the structure of the computer terminal. For example, the computer terminal may also include more or fewer components than shown in FIG. 1, or have a different configuration with equivalent functionality to that shown in FIG. 1 or with more functionality than that shown in FIG. 1.
The memory 104 may be used to store computer programs, for example, software programs and modules of application software, such as computer programs corresponding to the data request processing method in the embodiment of the present invention, and the processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, so as to implement the above-mentioned method. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory located remotely from the processor 102, which may be connected to a computer terminal over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used for receiving or transmitting data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the computer terminal. In one example, the transmission device 106 includes a Network adapter (NIC), which can be connected to other Network devices through a base station so as to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
In this embodiment, a method for processing a data request is provided, which is applied to the computer terminal, and fig. 2 is a schematic diagram of a method for processing a data request according to an embodiment of the present invention, and includes the following steps:
step S102, receiving a data request, wherein the data request carries a dynamic rule, user mark information and first label information;
step S104, analyzing the first label information to obtain second label information;
step S106, acquiring first data based on the second label information and the user mark information;
step S106, analyzing the dynamic rule to obtain a tag matching rule;
and S108, determining whether the first data is legal or not based on the label matching rule, and generating preset information.
In the data request processing method, a data request is received, wherein the data request carries a dynamic rule, user identification information and first tag information; analyzing the first label information to obtain second label information; acquiring first data based on the second tag information and the user identification information; analyzing the dynamic rule to obtain a tag matching rule; and determining whether the first data is legal or not based on the tag matching rule, and generating preset information. First data is obtained based on second tag information generated after the first tag information is analyzed and user mark information carried in a data request, and finally whether the first data is legal or not is determined based on a tag matching rule generated by analyzing a dynamic rule. By adopting the technical scheme, the problem of low data request response efficiency in the related technology is solved, the data request response efficiency is effectively improved, and the capability of processing high-concurrency data requests is greatly improved.
In step 102, a data request is sent by a terminal, where the terminal may be an APP terminal of an intelligent device or other intelligent network appliances, and the intelligent network appliances include, but are not limited to, a router, a smart phone, a smart television, and other appliances. The data request carries a dynamic rule, user identification information and first label information, wherein the dynamic rule is used for representing a method for judging the validity of the second data, the user identification information is identification information only generated at a current terminal, and the first label information is a user label set generated by the terminal.
In step 104, the step of analyzing the first tag information to obtain the second tag information may be understood as analyzing the first tag information, and the first tag information is analyzed to generate the second tag information, where the first tag information is a user tag set generated by the terminal, and the second tag information is a user tag set existing in a digital form.
In step S106, parsing the dynamic rule to obtain the tag matching rule may be understood as parsing the dynamic rule, and the tag matching rule is generated after the dynamic rule is parsed.
In step S108, whether the first data is legal is determined based on the tag matching rule, and generating the preset information may be understood as matching the first data with the tag matching rule, where if matching is successful, the first data is legal, and the corresponding preset information is generated, and if matching is unsuccessful, the first data is illegal, and the corresponding preset information is generated.
In one exemplary embodiment, parsing the dynamic rule to obtain the tag matching rule includes: and invoking a rule engine service to analyze the dynamic rule to obtain a tag matching rule.
Specifically, the rule engine service is called to analyze the dynamic rule, and the label matching rule is generated after the dynamic rule is analyzed, wherein the response of the data request is quicker and more flexible by introducing the lightweight rule engine, and the time delay is not remarkably increased.
In one exemplary embodiment, determining whether the first data is legitimate based on the tag matching rule, and generating the preset information includes: generating first preset information under the condition that the first data is determined to be legal; and generating second preset information under the condition that the first data is determined to be illegal.
That is, the first data is matched with the tag matching rule, if the first data is matched with the tag matching rule, the first data is determined to be legal, and if the first data is not matched with the tag matching rule, the first data is determined to be illegal. Further, in a case where it is determined that the first data is legitimate, first preset information may be preset to "yes", and in a case where it is determined that the first data is not legitimate, second preset information may be generated, and the first preset information may be preset to "no". The first preset information and the second preset information are both sent to the terminal, and the terminal determines whether the user label is accurate or not and provides accurate service according to the first preset information and the second preset information.
In one exemplary embodiment, parsing the first tag information to obtain the second tag information includes: and calling a label inquiry service to analyze the first label information so as to obtain second label information.
In other words, the tag query service parses the first tag information, and the first tag information is parsed to generate the second tag information.
In one exemplary embodiment, the acquiring the first data based on the second tag information and the user identification information includes: calling a tag query service based on the second tag information, wherein the tag query service calls a data query service through a first interface; the data query service accesses a database to obtain the first data based on the second tag information and the user identification information.
Further, the label query service calls a data query service through the dubbo interface to route the bottom layer DB, the data query service calls a bottom layer DB interface to access the database and obtain first data, the database comprises the first data, the first data is a specified label set of a specified user existing in a value form, and the database retrieves the first data according to the second label information and the user mark information.
In an exemplary embodiment, after the first data is obtained based on the second tag information and the user flag information, before the dynamic rule is parsed to obtain the tag matching rule, the method further includes: after the first data is returned to the data query service, the data query service returns the first data to the tag query service; the dynamic rule and the first data are sent to a rule engine service.
In other words, the data request processing method firstly obtains first data according to the second tag information and the user mark information, then returns the obtained first data to the data query service, the data query service returns the first data to the tag query service, and sends the dynamic rule and the first data to the rule engine service, and the rule engine service analyzes the dynamic rule to obtain the tag matching rule.
In one exemplary embodiment, before receiving the data request, the method further comprises: acquiring an authentication request; and determining whether the authentication request is legal or not, and returning an authentication voucher under the condition of determining that the authentication request is legal.
Further, the terminal initiates an authentication request and requests an authentication voucher through an http rest interface, wherein the authentication request is verified by the authentication service, and the authentication request is determined to be legal under the condition that the verification is passed.
In an exemplary embodiment, before parsing the first tag information to obtain the second tag information, the method further includes: acquiring a verification request; and determining whether the verification request is legal, responding to the verification request under the condition that the verification request is legal, and refusing to respond to the verification request under the condition that the verification request is illegal.
Specifically, the method includes the steps that firstly, under the condition that an authentication request is determined to be legal, an authentication certificate is returned, then a tag inquiry service initiates a verification request, the authentication service acquires the verification request and determines whether the verification request is legal or not, under the condition that the verification request is determined to be legal, the verification request is responded, a first verification result is generated and returned to the tag inquiry service, under the condition that the verification request is determined to be legal, the verification request is refused to be responded, a second verification result is generated and returned to the tag inquiry service, and finally, the tag inquiry service analyzes first tag information to generate second tag information only when the first verification result is received.
In order to better understand the process of the data request processing method, the following describes an implementation method flow of the data request processing with reference to an optional embodiment, but the technical solution of the embodiment of the present invention is not limited thereto.
In the present embodiment, a method for processing a data request is provided, and fig. 3 is a flowchart of a method for processing a data request according to an embodiment of the present invention, as shown in fig. 3, the flowchart includes the following steps:
step 301: acquiring an authentication request, and determining whether the authentication request is legal or not;
that is, the terminal initiates an authentication request, the authentication service determines whether the authentication request is legal, and returns an authentication voucher under the condition that the authentication request is legal, wherein the terminal is an intelligent network device or an APP. The data request to be responded is guaranteed to be legal by the arrangement, and the safety problems of data leakage and the like are avoided.
Step 302: receiving a data request, wherein the data request carries a dynamic rule, first tag information and user mark information;
it should be noted that the data request is generated by the terminal, and the dynamic rule, the first tag information, and the user identification information are generated by the terminal.
Step 303: obtaining a verification request and returning a verification result;
step 304: calling a tag query service to analyze the first tag information;
further, the tag query service is invoked to parse the first tag information to generate second tag information.
Step 305: the tag query service calls a data query service;
step 306: a data query service accesses a database to obtain first data;
step 307: returning the first data to the data query service, returning the first data to the tag query service by the data query service, and sending the dynamic rule and the first data to the rule engine service;
step 308: the rule engine analyzes the dynamic rule to obtain a tag matching rule;
step 309: and determining the legality of the first data according to the tag matching rule, and generating preset information.
And generating first preset information under the condition that the first data is determined to be legal, and generating second preset information under the condition that the first data is determined to be illegal.
Further, the steps are all completed in the cloud brain server.
According to the data request processing method, whether the data request is legal or not is verified firstly, namely, the data request is responded to the authentication request and the verification request, the condition that data are leaked or illegally logged is avoided, then the database is accessed through the tag query service, the data query service and relevant information, the first data are obtained and returned to the data query service and the tag query service, finally the tag query service calls a rule engine according to the first data and carrying dynamic rules, the rule engine analyzes the dynamic rules to generate tag matching rules, whether the first data are legal or not is determined according to the tag matching rules, and preset information is generated and sent to a terminal. By adopting the technical scheme, the problem of low data request response efficiency in the related technology is solved, the data request response efficiency is effectively improved, and the capability of processing high-concurrency data requests is greatly improved.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
An embodiment of the present invention further provides a processing apparatus for a data request, where the processing apparatus includes: the receiving module is used for receiving a data request, wherein the data request carries a dynamic rule, user mark information and first label information; the query module is used for querying the first data according to the second label information and the user mark information; and the determining module is used for determining whether the first data is legal or not and generating preset information.
As shown in fig. 4, in an exemplary embodiment, an intelligent network device or APP as a terminal initiates a data request and obtains a tag result returned by a rule engine, where the tag result is preset information, a tag list is first tag information, tag data is first data, a tag rule is a tag matching rule, and Hbase is a preset database for storing the first data.
FIG. 5 is a block diagram of an apparatus for processing a data request according to an embodiment of the present invention; as shown in fig. 5, includes:
a receiving module 42, configured to receive a data request, where the data request carries a dynamic rule, user identifier information, and first tag information;
a query module 44, configured to query the first data according to the second tag information and the user identification information;
a determining module 46, configured to determine whether the first data is legal, and generate preset information;
an authentication module 48 for determining whether the data request is legitimate;
a data storage module 50 for storing a user data set, the user data set comprising first data.
The data storage module 50 may be different kinds of databases, and the user data sets are collected by the server in advance and stored in the database.
Receiving a data request through the device, wherein the data request carries a dynamic rule, user identifier information and first label information; analyzing the first label information to obtain second label information; acquiring first data based on the second tag information and the user identification information; analyzing the dynamic rule to obtain a tag matching rule; and determining whether the first data is legal or not based on the tag matching rule, and generating preset information. First data is obtained based on second tag information generated after the first tag information is analyzed and user mark information carried in a data request, and finally whether the first data is legal or not is determined based on a tag matching rule generated by analyzing a dynamic rule. By adopting the technical scheme, the problem of low data request response efficiency in the related technology is solved, the data request response efficiency is effectively improved, and the capability of processing high-concurrency data requests is greatly improved.
In one exemplary embodiment, the processing apparatus further comprises: the authentication module is used for determining whether the data request is legal or not; the data storage module is used for storing a user data set, and the user data set comprises first data.
Embodiments of the invention also provide a storage medium comprising a stored program, wherein the program performs any of the above methods when executed.
Alternatively, in the present embodiment, the storage medium may be configured to store program codes for performing the following steps:
s1, receiving a data request, wherein the data request carries a dynamic rule, user identification information and first label information;
s2, analyzing the first label information to obtain second label information;
s3, acquiring first data based on the second label information and the user mark information;
s4, analyzing the dynamic rule to obtain a label matching rule;
and S5, determining whether the first data is legal based on the label matching rule, and generating preset information.
Embodiments of the present invention also provide an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the above method embodiments.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
s1, receiving a data request, wherein the data request carries a dynamic rule, user identification information and first label information;
s2, analyzing the first label information to obtain second label information;
s3, acquiring first data based on the second label information and the user mark information;
s4, analyzing the dynamic rule to obtain a label matching rule;
and S5, determining whether the first data is legal based on the label matching rule, and generating preset information.
Optionally, in this embodiment, the storage medium may include, but is not limited to: various media capable of storing program codes, such as a usb disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation manners, and this embodiment is not described herein again.
It will be apparent to those skilled in the art that the modules or steps of the present invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
For example, the APP sends an authentication request to an authentication service, the authentication service determines whether the authentication request is legal, and returns an authentication voucher under the condition that the authentication request is legal; receiving a data request, wherein the data request carries a dynamic rule, user identification information and first tag information (for example, the first tag information comprises a tag of a high-value crowd generated by a terminal), calling a tag query service, the tag query service initiates a verification request, and an authentication service determines whether the verification request is legal and sends a verification result to the tag query service; the tag query service analyzes the first tag information (such as a tag 'high-value crowd' generated by a terminal), generates second tag information (such as a tag 'high-value crowd' in a digital form), and calls a data query service through a dubbo interface, wherein the data query service calls an underlying DB interface to access a database to obtain second data (such as a tag 'high-value crowd' in a numerical form), and the second data is a tag set of a specific user in the numerical form; and returning the second data to a data query service, returning the second data to a tag query service by the data query service, accessing a rule engine service according to the second data and carrying a dynamic rule by the tag query service, analyzing the dynamic rule by the rule engine service and generating a tag matching rule, determining whether the second data is legal according to the tag matching rule, determining whether the first data is legal according to the tag matching rule, generating preset information, wherein the generation of the preset information can be understood as matching the first data with the tag matching rule, if the matching is successful, the preset information is legal, and if the matching is unsuccessful, the corresponding preset information is illegal, and the corresponding preset information is generated. And under the condition that the second data is determined to be legal, generating first preset information and returning the first preset information to the APP.
In another embodiment, the smart television sends an authentication request to an authentication service, the authentication service determines whether the authentication request is legal, and returns an authentication voucher under the condition that the authentication request is legal; receiving a data request, wherein the data request carries a dynamic rule, user identification information and first tag information (for example, the first tag information comprises a tag of a high-value crowd generated by a terminal), calling a tag query service, the tag query service initiates a verification request, and an authentication service determines whether the verification request is legal and sends a verification result to the tag query service; the tag query service analyzes the first tag information (such as a tag 'high-value crowd' generated by a terminal), generates second tag information (such as a tag 'high-value crowd' in a digital form), and calls a data query service through a dubbo interface, wherein the data query service calls an underlying DB interface to access a database to obtain second data (such as a tag 'high-value crowd' in a numerical form), and the second data is a tag set of a specific user in the numerical form; and returning the second data to a data query service, returning the second data to a tag query service by the data query service, accessing a rule engine service according to the second data and carrying a dynamic rule by the tag query service, analyzing the dynamic rule by the rule engine service to generate a tag matching rule, determining whether the second data is legal according to the tag matching rule, determining whether the first data is legal according to the tag matching rule, generating preset information, wherein the generation of the preset information can be understood as matching the first data with the tag matching rule, if the matching is successful, the preset information is legal, and if the matching is unsuccessful, the corresponding preset information is illegal, and the corresponding preset information is generated. And under the condition that the second data is determined to be legal, generating first preset information and returning the first preset information to the intelligent television, and under the condition that the second data is determined to be illegal, generating the first preset information and returning the first preset information to the intelligent television. The intelligent television receives the preset information and provides precise services (such as luxury goods matched with 'high-value people') for the client according to the preset information.
In another embodiment, the smart speaker sends an authentication request to an authentication service, the authentication service determines whether the authentication request is legal, and returns an authentication voucher under the condition that the authentication request is legal; receiving a data request, wherein the data request carries a dynamic rule, user identification information and first tag information, calling a tag inquiry service, the tag inquiry service initiates a verification request, and an authentication service determines whether the verification request is legal and sends a verification result to the tag inquiry service; the tag query service analyzes the first tag information to generate second tag information, and calls a data query service through a dubbo interface, the data query service calls a bottom DB interface to access a database to obtain second data, and the second data is a tag set of a specific user in a numerical form; and returning the second data to a data query service, returning the second data to a tag query service by the data query service, accessing a rule engine service according to the second data and carrying a dynamic rule by the tag query service, analyzing the dynamic rule by the rule engine service and generating a tag matching rule, determining whether the second data is legal according to the tag matching rule, determining whether the first data is legal according to the tag matching rule, generating preset information, wherein the generation of the preset information can be understood as matching the first data with the tag matching rule, if the matching is successful, the preset information is legal, and if the matching is unsuccessful, the corresponding preset information is illegal, and the corresponding preset information is generated. And under the condition that the second data is determined to be legal, generating first preset information and returning the first preset information to the intelligent sound box, and under the condition that the second data is determined to be illegal, generating the first preset information and returning the first preset information to the intelligent sound box. And the intelligent sound box receives the preset information and provides accurate service for the client according to the preset information.
Along with the gradual development of the internet of things, the use behaviors of customers are concerned by manufacturers of intelligent network devices, the manufacturers acquire the behavior data of the customers by acquiring ecological multi-source data, construct all-around customer figures in the cloud, and support multiple channels by means of the customer figures to perform differentiated services. The data request processing method can meet the access requirements of high concurrency and low time delay of the terminal equipment by improving the existing capability. The data request processing method switches the original data flow in the cloud brain service, and can better process increasingly huge terminal access requests by means of the filtering effect generated by the rule engine, so that the terminal equipment is helped, needed user portraits are obtained quickly and accurately, efficient and accurate customer service is provided for the support terminal, furthermore, the data request processing method further peels off the logic of data query and rule matching, efficient and light-weight service capability is generated, and the rule check of the intelligent equipment on the customer portraits is supported, wherein the light weight can be understood as higher efficiency of responding to the data request.
According to the data request processing method, through service transformation of data query, high-concurrency query data requests of terminal equipment and internet of things equipment are supported, and a lightweight rule engine is introduced, so that the client portrait spot-checking capability is more flexible without obvious increase of time delay, and the client portrait spot-checking can be understood as searching for a specific label of a specific user and judging the validity. Furthermore, the data request processing method has a decoupling effect on the data query and tag matching service by setting the tag query service, the data query service and the rule engine, so that the portrait spot query service has higher expansibility, and a basis is provided for containerization transformation of the service.
In an exemplary embodiment, the processing method of the data request may also be used in an intelligent appliance. The intellectualization of home appliances has become a trend of home appliance development, and with the continuous growth of intelligent network device devices, the intelligent network device puts higher requirements on the capability of providing efficient and accurate services for users. The processing method of the data request is used for transmitting data of the user or the equipment portrait in the checking scene by introducing a light rule engine mode, so that the time delay of the existing service is greatly reduced, the requirement of higher concurrent data requests is supported, the logic of data query and rule matching is stripped, the design concept of high cohesion and low coupling of an API (application program interface) object is met, the reusability of the decomposed object is improved, and a foundation is laid for subsequent containerization transformation and service management.
The above is only a preferred embodiment of the present invention, and is not intended to limit the present invention, and various modifications and changes will occur to those skilled in the art. Any modification, equivalent replacement, or improvement made within the principle of the present invention should be included in the protection scope of the present invention.