Disclosure of Invention
Embodiments of the present invention provide a method and a system for creating a guest group, which can obtain a specific guest group through configuration, thereby reducing development workload.
In order to achieve the above purpose, the embodiment of the invention adopts the following technical scheme:
in a first aspect, an embodiment of the present invention provides a guest group creating method, including:
creating a base guest group pool, wherein the base guest group pool comprises at least one base guest group;
creating a rule checking base, wherein the rule checking base comprises at least one rule checker;
and according to configuration information, creating a demand guest group based on the basic guest group pool and the rule check library.
With reference to the first aspect, in a first possible implementation manner of the first aspect, the creating, according to the configuration information, a demand guest group based on the basic guest group pool and the rule check library specifically includes:
selecting a basic customer group from the basic customer group pool according to configuration information;
selecting a rule checker from the rule checking library according to configuration information;
and generating a guest group identification code, and establishing a corresponding relation between the guest group identification code and the basic guest group and the rule checker respectively.
With reference to the first possible implementation manner of the first aspect, in a second possible implementation manner of the first aspect, the method further includes:
acquiring a verification request of a user, wherein the verification request comprises a guest group identification code;
judging whether the user belongs to a basic guest group corresponding to the guest group identification code, if so, executing a rule checker corresponding to the guest group identification code to obtain a rule checking result;
and obtaining a verification result by combining the rule verification result.
With reference to the first aspect, in a third possible implementation manner of the first aspect, the creating a base guest group pool specifically includes:
acquiring group data of a basic guest group, wherein the group data comprises a group name of the basic guest group and a user number of a user belonging to the basic guest group;
and storing the group data to obtain a basic customer group pool.
With reference to the third possible implementation manner of the first aspect, in a fourth possible implementation manner of the first aspect, the acquiring group data of the basic guest group specifically includes:
acquiring group data of a basic customer group from an Excel resource server;
or receiving group data of the base guest group in the kafka message queue by using a Spark Streaming task.
In a second aspect, an embodiment of the present invention provides a guest group creation system, including:
the system comprises a guest group pool module, a guest group pool module and a guest group management module, wherein the guest group pool module is used for creating a basic guest group pool which comprises at least one basic guest group;
the rule base module is used for creating a rule checking base, and the rule checking base comprises at least one rule checker;
and the configuration module is used for creating the demand guest group based on the basic guest group pool and the rule checking library according to configuration information.
With reference to the second aspect, in a first possible implementation manner of the second aspect, the configuration module includes:
the basic guest group selecting unit is used for selecting a basic guest group from the basic guest group pool according to configuration information;
the checker selecting unit is used for selecting a rule checker from the rule checking library according to the configuration information;
and the association unit is used for generating a guest group identification code and establishing a corresponding relation between the guest group identification code and the basic guest group and the rule checker respectively.
With reference to the first possible implementation manner of the second aspect, in a second possible implementation manner of the second aspect, the system further includes:
the request module is used for acquiring a verification request of a user, wherein the verification request comprises a guest group identification code;
the verification module is used for judging whether the user belongs to a basic guest group corresponding to the guest group identification code, if so, executing a rule checker corresponding to the guest group identification code to obtain a rule checking result;
and the result module is used for combining the rule checking result to obtain a verification result.
With reference to the second aspect, in a third possible implementation manner of the second aspect, the guest group pool module includes:
an acquisition unit configured to acquire group data of a basic guest group, the group data including a group name of the basic guest group and a user number of a user belonging to the basic guest group;
and the storage unit is used for storing the group data to obtain a basic guest group pool.
With reference to the third possible implementation manner of the second aspect, in a fourth possible implementation manner of the second aspect, the obtaining unit further includes:
the import subunit is used for acquiring group data of the basic guest group from the Excel resource server;
and the interface subunit is used for receiving the group data of the basic guest group in the kafka message queue by adopting a Spark Streaming task.
The method and the system for creating the guest group can obtain the specific guest group through configuration, and reduce development workload. The method for creating the guest group comprises the steps of creating a basic guest group pool, wherein the basic guest group pool comprises at least one basic guest group; creating a rule checking base, wherein the rule checking base comprises at least one rule checker; and according to configuration information, creating a demand guest group based on the basic guest group pool and the rule check library. Compared with the prior art, the method and the device have the advantages that the basic customer group pool composed of the basic customer groups and the rule verification base composed of the rule verifiers are firstly created, the basic customer groups are selected from the basic customer group pool to be combined to obtain the specific customer groups through configuration based on different service scene requirements, the rule verifiers are selected from the rule verification base to limit the specific customer groups, the specific customer groups do not need to be obtained through customized development according to the service scene requirements, development workload is reduced, and online time is shortened. The basic guest groups in the basic guest group pool and the rule check devices in the rule check library can be multiplexed, repeated development is not needed, and development efficiency is improved.
Detailed Description
In order to make the technical solutions of the present invention better understood, the present invention will be described in further detail with reference to the accompanying drawings and specific embodiments. It is to be understood that the embodiments described are only a few embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, those skilled in the art can obtain the embodiments without any inventive step in advance, and the embodiments are within the protection scope of the present invention.
It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the prior art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
The guest group creation method flow provided by the embodiment of the present invention may specifically be run in the guest group management server shown in fig. 1.
The guest group management server comprises an input unit, a processor unit, an output unit, a communication unit, a storage unit, a peripheral unit and other components. These components communicate over one or more buses. Specifically, the method comprises the following steps:
the input unit is used for realizing interaction between a user and the guest group management server and/or inputting information into the guest group management server. For example, the input unit may receive numeric or character information input by a user to generate a signal input related to user setting or function control. In the embodiment of the present invention, the input unit may be a touch panel, or may be other human-computer interaction interfaces, such as a physical input key, a mouse, or a joystick.
The processor unit is a control center of the guest group management server, connects various parts of the whole server by using various interfaces and lines, and executes various functions and/or processes data of the guest group management server by running or executing software programs and/or modules stored in the storage unit and calling data stored in the storage unit. The processor unit may be composed of an Integrated Circuit (IC), for example, a single packaged IC, or a plurality of packaged ICs connected with the same or different functions. For example, the processor Unit may include only a Central Processing Unit (CPU), or may be a combination of a GPU, a Digital Signal Processor (DSP), and a control chip (e.g., a baseband chip) in the communication Unit. In the embodiment of the present invention, the CPU may be a single operation core, or may include multiple operation cores.
The communication unit is used for establishing a communication channel, so that the guest group management server is connected to the remote equipment through the communication channel and performs data interaction with the remote equipment.
The output unit includes, but is not limited to, an image output unit and a sound output unit. The image output unit is used for outputting characters, pictures and/or videos. The image output unit may include a display panel, such as a display panel configured in the form of an LCD (Liquid crystal display), an OLED (Organic Light-Emitting Diode), a Field Emission Display (FED), and the like.
The storage unit may be configured to store software programs and modules, and the processing unit executes various functional applications of the guest group management server and implements data processing by running the software programs and modules stored in the storage unit. The storage unit mainly comprises a program storage area and a data storage area, wherein the program storage area can store an operating system and an application program required by at least one function. In an embodiment of the invention, the Memory unit may include a volatile Memory, such as a Nonvolatile dynamic Random Access Memory (NVRAM), a Phase Change Random Access Memory (PRAM), a Magnetoresistive Random Access Memory (MRAM), and a non-volatile Memory, such as at least one magnetic disk Memory device, an Electrically Erasable Programmable Read-Only Memory (EEPROM), a flash Memory device, such as a NAND flash Memory, or a nor flash Memory. The nonvolatile memory stores an operating system and an application program executed by the processing unit. The processing unit loads the operating program and data from the non-volatile memory into the memory and stores the digital content in the mass storage device.
The power supply is used for supplying power to different parts of the guest group management server to maintain the operation of the guest group management server, and comprises an external power supply for directly supplying power to the guest group management server, such as an AC adapter and the like. In some embodiments of the invention, the power supply may be more broadly defined and may include, for example, a power management system, a charging system, a power failure detection circuit, a power converter or inverter, a power status indicator (e.g., a light emitting diode), and any other components associated with power generation, management, and distribution of the server.
The method for creating a guest group provided by the embodiment of the present invention may include the following steps, as shown in fig. 2:
step S10, creating a basic guest group pool, wherein the basic guest group pool comprises at least one basic guest group;
step S20, creating a rule checking base, wherein the rule checking base comprises at least one rule checker;
and step S30, creating a demand guest group based on the basic guest group pool and the rule check library according to the configuration information.
The embodiment of the invention firstly forms a basic customer group pool by a plurality of basic customer groups, forms a rule checking library by a plurality of rule checking devices, wherein the basic customer group and the rule checking device can be multiplexed, selects one or a plurality of basic customer groups from the basic customer group pool according to the configuration, adds the rule checking device selected from the rule checking library on the basis of the basic customer groups for limiting, obtains the required customer groups meeting the business requirements, reduces the development workload and the development repetition rate, accelerates the online time and improves the development efficiency.
According to an embodiment of the present invention, step S10 specifically includes:
acquiring group data of a basic guest group, wherein the group data comprises a group name of the basic guest group and a user number of a user belonging to the basic guest group;
and storing the group data (by taking the user number as a main key, the group name of the basic guest group to which the user belongs, and storing the basic guest group data in a database) to obtain a basic guest group pool.
In the embodiment of the invention, the basic customer group is a customer group consisting of a plurality of users, can be a customer group maintained by each business state, can be a customer group developed by each business in a customized manner, and can also be a custom customer group. For example, the guest group composed of the senior member is a basic guest group, and the guest group composed of the general member is a basic guest group, and the like. And storing the group data of each basic guest group to obtain a basic guest group pool.
Specifically, the guest group management system may receive group data of the basic guest group sent by another system through the Kafka interface, process the data received through the Kafka interface through a Spark Streaming task, and store the group data of the basic guest group in the Hbase database. The group data of the basic customer group can also be stored in an Excel resource server in an Excel form, and the customer group management system imports the Excel data into the Hbace database from the Excel resource server.
Preferably, the group data of the basic guest group is stored in the Hbase database by using the user number as the RowKey and the group name of the basic guest group to which the user belongs as a column. And when the group data of the new basic guest group is stored, adding a new user number or modifying a group list of the user number, and updating the Hbase database. By the storage mode, the group name of the basic guest group to which the user belongs can be searched for verification according to the user number during user verification, and the verification speed is increased.
In step S20, a rule checker is constructed according to the checking logic of the guest group checking rule, such as an age checker, a gender checker, a user level checker, and the like. The age checker is used for checking whether the age of the user accords with a preset age rule, the gender checker is used for checking whether the gender of the user accords with a preset gender rule, and the user grade checker is used for checking whether the grade of the user accords with a preset grade rule. And the constructed rule checker constitutes a rule checking library.
The embodiment of the invention aims at the customer group check rule logic to construct and generate a rule checker, so that the rule limitation of a specific customer group defined by the service requirement can be realized by executing one or more rule checkers, and one rule checker can also be used for the rule limitation of a plurality of different specific customer groups. When a business newly defines a restriction rule of a specific customer group, restriction can be realized by operating the existing rule checker, independent development of new restriction logic is not needed, if a new rule exists, only a new rule checker needs to be developed, development time and cost are reduced, only the code of the rule checker needs to be maintained, maintenance is simple, and workload is low. When defining a new specific customer group, if the rule checker in the rule checking library can be used to limit the specific customer group, the selected rule checker is associated after selecting a basic customer group from the basic customer group pool.
According to an embodiment of the present invention, step S30 specifically includes:
step S301, selecting a basic customer group from the basic customer group pool according to configuration information, and selecting a rule checker from the rule checking library.
Specifically, the configuration information includes a group name of the basic guest group, and the basic guest group is selected from the basic guest group pool according to the group name. And if the basic guest group does not exist in the basic guest group pool, acquiring group data of the basic guest group, and storing the group data into the basic guest group pool.
The configuration information further comprises a rule checker name and a logic relation of the rule checker, and the rule checker is selected from the rule checking library according to the rule checker name. If the rule checker does not exist in the rule checking base, the rule checker is firstly constructed and added into the rule checking base.
Step S302, combining the basic customer group and the rule checker to obtain a demand customer group.
The demand customer group is a customer group which is provided by the business system and accords with a certain rule. For example, the female senior member group is a demand group, the basic group of the senior member group is selected from the basic group pool according to the configuration information, the rule checker of the sex checker with female checking parameters is selected from the rule checking library, and the senior member group and the sex checker with female checking parameters form the female senior member group.
Step S303, generating a guest group identification code of the demand guest group, and establishing a corresponding relationship between the guest group identification code and the basic guest group and the rule checker respectively. The generation of the guest group identification code may be performed by a random method or according to a predetermined rule.
According to the method and the device, the basic guest group is selected from the basic guest group pool according to the configuration information of operators, the rule calibrator is selected from the rule calibration library, the rule calibrator is added based on the basic guest group, so that the demand guest group is obtained, the guest group identification code is generated and serves as the unique identification of the demand guest group and is provided for the peripheral system, the peripheral system positions the demand guest group through the guest group identification code, the peripheral system does not need to participate in guest group rule limiting processing, information interaction between the peripheral system and the guest group management system is simple, and development workload and development difficulty are reduced.
According to an embodiment of the present invention, further comprising:
step S401, a verification request of a user is obtained, wherein the verification request comprises a guest group identification code.
Under a specific service scene, the service system sends a verification request of a user to the guest group management system, and the guest group management system obtains a user number and a guest group identification code according to the verification request.
Step S402, judging whether the user belongs to the basic guest group corresponding to the guest group identification code, if so, executing a rule checker corresponding to the guest group identification code to obtain a rule checking result.
And the guest group management system finds the corresponding basic guest group according to the guest group identification code, inquires the group name of the basic guest group corresponding to the user number, if the group names of the two basic guest groups are different, the user does not belong to the basic guest group, and the user directly feeds back verification which does not pass the verification to the service system. If the group names of the two basic guest groups are the same, the user belongs to the basic guest group, a rule checker corresponding to the guest group identification code is executed, the rule checker calls an external RSF service interface to judge the rule, and a rule checking result is obtained. Among other things, external RSF service interfaces such as payment interfaces, order interfaces, shopping cart interfaces, etc.
And step S403, combining the rule checking result to obtain a verification result.
The configuration information also comprises a logical relation between the rule verifiers, and the rule verification results of the rule verifiers are subjected to logical operation according to the logical relation between the verifiers to obtain verification results for feeding back to the service system.
When the user verifies whether the user belongs to the demand guest group, the guest group identification code is used for verifying whether the user belongs to the basic guest group associated with the demand guest group, if the user belongs to the basic guest group associated with the demand guest group, one or more rule verifiers associated with the demand guest group are executed, and the rule verification is performed by executing the rule verifiers.
The following describes a flow of the guest group creation method according to an embodiment of the present invention with a specific example. The instance creates a demand guest group that is manually imported and has a user level of two.
The group management system receives the group data of the basic group introduced by hand, and stores the group data of the basic group into the database, namely, joins the basic group pool. And generating a specific guest group identification code according to the configuration information, and establishing a corresponding relation between the specific guest group identification code and the manually imported basic guest group and the user level verifier. When a user enters a service scene of a service system through a client, a guest group management system receives a verification request of the user sent by the service system, judges whether the user is manually led into a basic guest group again according to a specific guest group identification code and a user code, if not, sends verification failure to the service system, and if so, executes a user level checker, judges whether the user is in a second level, and obtains a verification result. And sending the verification result to the service system as a verification result.
The method for creating the guest group comprises the steps of creating a basic guest group pool, wherein the basic guest group pool comprises at least one basic guest group; creating a rule checking base, wherein the rule checking base comprises at least one rule checker; and according to configuration information, creating a demand guest group based on the basic guest group pool and the rule check library. Compared with the prior art, the method and the device have the advantages that the basic customer group pool composed of the basic customer groups and the rule verification base composed of the rule verifiers are firstly created, the basic customer groups are selected from the basic customer group pool to be combined to obtain the specific customer groups through configuration based on different service scene requirements, the rule verifiers are selected from the rule verification base to limit the specific customer groups, the specific customer groups do not need to be obtained through customized development according to the service scene requirements, development workload is reduced, and online time is shortened. The basic guest groups in the basic guest group pool and the rule check devices in the rule check library can be multiplexed, repeated development is not needed, and development efficiency is improved.
An embodiment of the present invention further provides a guest group creating system, as shown in fig. 3, including:
the system comprises a guest group pool module, a guest group pool module and a guest group management module, wherein the guest group pool module is used for creating a basic guest group pool which comprises at least one basic guest group;
the rule base module is used for creating a rule checking base, and the rule checking base comprises at least one rule checker;
and the configuration module is used for creating the demand guest group based on the basic guest group pool and the rule checking library according to configuration information.
According to one embodiment of the invention, the configuration module comprises:
the basic guest group selecting unit is used for selecting a basic guest group from the basic guest group pool according to configuration information;
the checker selecting unit is used for selecting a rule checker from the rule checking library according to the configuration information;
and the association unit is used for generating a guest group identification code and establishing a corresponding relation between the guest group identification code and the basic guest group and the rule checker respectively.
According to one embodiment of the invention, the system further comprises:
the request module is used for acquiring a verification request of a user, wherein the verification request comprises a guest group identification code;
the verification module is used for judging whether the user belongs to a basic guest group corresponding to the guest group identification code, if so, executing a rule checker corresponding to the guest group identification code to obtain a rule checking result;
and the result module is used for combining the rule checking result to obtain a verification result.
According to one embodiment of the invention, the guest group pool module comprises:
an acquisition unit configured to acquire group data of a basic guest group, the group data including a group name of the basic guest group and a user number of a user belonging to the basic guest group;
and the storage unit is used for storing the group data to obtain a basic guest group pool.
According to an embodiment of the present invention, the obtaining unit further includes:
the import subunit is used for acquiring group data of the basic guest group from the Excel resource server;
and the interface subunit is used for receiving the group data of the basic guest group in the kafka message queue by adopting a Spark Streaming task.
The guest group creation system provided by the embodiment of the invention can obtain a specific guest group through configuration, thereby reducing the development workload. In this embodiment, the guest group pool module creates a basic guest group pool, where the basic guest group pool includes at least one basic guest group; the rule base module creates a rule checking base, and the rule checking base comprises at least one rule checker; and the configuration module creates a demand guest group based on the basic guest group pool and the rule check library according to configuration information. Compared with the prior art, the method and the device have the advantages that the basic customer group pool composed of the basic customer groups and the rule verification base composed of the rule verifiers are firstly created, the basic customer groups are selected from the basic customer group pool to be combined to obtain the specific customer groups through configuration based on different service scene requirements, the rule verifiers are selected from the rule verification base to limit the specific customer groups, the specific customer groups do not need to be obtained through customized development according to the service scene requirements, development workload is reduced, and online time is shortened. The basic guest groups in the basic guest group pool and the rule check devices in the rule check library can be multiplexed, repeated development is not needed, and development efficiency is improved.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus embodiment, since it is substantially similar to the method embodiment, it is relatively simple to describe, and reference may be made to some descriptions of the method embodiment for relevant points. Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The above description is only for the specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.