Recently, a big thing happened in the e-commerce circle, Pinduoduo attracted everyone’s attention again. On January 20, 2019, a huge wool Bug appeared on Pinduoduo, which was caused by a coupon with no threshold. The value of the coupon is 100 yuan, which can be used by all people (except for special products) and is valid for one year. There is nothing inherently wrong with defining such a coupon from a business perspective. Of course, some people say that such no-threshold coupons themselves should not be used to spend top-up, Q coin top-up and other goods almost equal to cash business, which is considered from the promotion level. Others mentioned the risk control problem. Why didn’t they discover the problem until the loss reached 20 billion yuan (the coupons involved tens of millions of yuan)? More people doubt that this is an ingenious hype.

From the fleece point of view, this Bug seems to be caused by the fact that the no-threshold coupons can be used an unlimited number of times. In essence, this is indeed a Bug, I do not understand how such a Bug is generated, is the test not in place, or the coupon itself is an internal test data, accidentally put into the production environment? As it happens, recently we are considering how to use analysis mode to establish the promotion model in the e-commerce system, which is appropriate.

Analysis of models to refine the model

In domain-driven design, a preliminary analysis model can be quickly obtained through the combination of unified language and “noun verbal morphology”. However, the model quality obtained by this method is limited by the writing skills of language description. The description of unified language is more reflected in the model description of the real world, and the lack of in-depth and accurate analysis and unified abstraction makes it difficult for us to find some important concepts hidden behind the unified language. In short, the analytical model derived from this needs further refinement.

When modeling and analyzing the same or similar domain, there must be rules and regulations to follow. For example, they are both e-commerce systems, and their domain models must have similarities. If they are all financial systems, they naturally have to follow universal accounting standards. It is not simple to use industry terms, but to abstract these same or similar models with the knowledge of domain experts, and form a conceptual model that can be referenced and reused. This is the analysis model proposed by Martin Fowler. “Analysis patterns are a set of concepts that reflect a common structure in business modeling,” Fowler says. It can be specific to a particular domain, or it can span multiple domains.” Because analysis patterns are independent of software technology, they are understood by domain experts, which is a key point in the analysis modeling process.

Each industry can define its own analysis model, of course, we can also refer to some of the analysis model has been summarized by others. For example, in Martin Fowler’s book Analytical Patterns, patterns cover areas such as organizational structure, number of units, financial models, inventory and accounting, planning, and contracts (options, futures, products, and trading). Eric Evans believes that by using these analysis patterns, “you can avoid the costly process of trial and error, and work directly from a model that is already well expressed and easy to implement, and solve subtle problems that may be difficult to learn. We can reconstruct and experiment from such a starting point.”

To achieve such an analysis pattern, it takes a combination of expert domain experts and software designers. Unfortunately, communication and knowledge barriers make such an important analysis difficult. Martin Fowler wrote Analysis Patterns in the hope of reducing modeling by introducing more patterns, at least to some extent, model reuse. However, the analysis mode is closely related to domain knowledge, which limits the universality of the analysis mode. But that doesn’t mean that analysis patterns don’t matter. Domain driven design is especially emphasized as the domain modeling, for those who have a long life cycle of product, in view of the product is definitely worth core areas to establish a set of analysis model, because it is an important asset for the analysis phase, its stability and ability to scale may directly affect the domain model of the design model and implementation model.

Case study: Analysis model of promotion strategy

Promotion is a means of operation. The purpose is to stimulate various information of consumption by means of this means, transfer the information to one or more target objects, influence their attitude and behavior, and improve the conversion rate. In order to stimulate consumption, whether online or offline, merchants will always rack their brains to provide various promotional means, which brings about the complexity of promotional strategies; However, from the perspective of consumer psychology, a simple and effective way to stimulate consumption is to make consumers think that they have bought more goods with less money, which brings about the similarity of promotion strategies. In a sense, the promotion of Pinduoduo greatly “stimulated” the enthusiasm of consumers!

Business background of promotion strategy

In the e-commerce system, the management of promotion mainly involves the management of promotion activities and promotion rules. At the same time, promotion will affect orders, inventory, logistics and payment. If we consider promotion as a core area, we should focus on the promotion area when modeling our analysis for it.

Sales promotion activity

Promotion activities are actually the basic attribute management for promotion, responsible for providing activity methods and product content, mainly including:

  • Selection of commodities: the commodities to participate in the promotion are divided into two kinds: activity commodities and gifts; You can also select the variety of goods to participate in the promotion, for example, for books.
  • Launch time selection: that is, the effective period of the promotion
  • Selection of launch area: for the whole platform or part of the platform (self-run or designated store), or only for APP platform
  • User type: for newly registered users, VIP users, etc

The promotion rules

Promotion rules are the core of promotion management. The quality of a promotion system depends on whether the design of promotion rules is reasonable. The design should take into account not only the promotion of goods, but also the profit of the store, and the difference between unsold goods and popular goods. Therefore, the formulation of promotion rules is very flexible, and the scope and promotion intensity are also different. Generally speaking, we can understand the formulation of promotion rules from the three dimensions of platform, number of products and promotion methods:

  • Platform dimension: Promotion rules can be divided into self-promotion and POP platform promotion.
  • From the perspective of commodities, promotion can be divided into single product promotion, collection promotion and store promotion:
    • Single item promotion: Promotion carried out on the basis of a single item is called single item promotion, such as time grab.
    • Collective promotion: A promotion through a collection of products to meet promotional rules is called collective promotion, such as full reduction.
    • Store-level promotion: store-level promotion is called store-level promotion, such as store-level full discount.
  • Dimensions of promotion methods:
    • Discount category: limited time grab, discount, buy more, discount more, VIP exclusive price, mobile phone exclusive price, etc
    • Complimentary: Full gift
    • Exchange purchase category: add price purchase, gather together a single
    • Full amount category: full amount reduction, full amount fold, etc
    • Coupon category: full amount of coupon
    • Combination discount category: package
    • Booking category: group purchase

When configuring promotional rules, you also need to consider the priority of the rules, which directly affects the sharing and mutual exclusion of promotional activities. For example, we can complete the user’s preferential enjoyment according to a certain priority. If we enjoy the single product promotion, we cannot participate in the collective promotion, and the priority of full reduction is higher than the voucher. This is mutually exclusive. Promotions can also be shared. For example, full payment promotions can be used with full payment free shipping.

Analytical modeling of the promotion area

When we model analytics for the sales promotion space, we first need to identify the core concepts in the space and then analyze the business implications of those concepts in the space. Based on our business background, we know that the core concepts of the promotional space include promotional activities and promotional rules. The relationship between the two arises from the need to specify promotion rules when managing promotions. On the surface, it is through promotion activities to configure promotion rules, the former is the main, the latter is the auxiliary; But for Promotion, in fact, activities and rules are combined to form a Promotion Product. These promotions can be “coupons,” “Gift cards,” “discounts” or “Free Shipping.”

The acquisition of the model concept “promotional product” is actually an embodiment of relationship modeling in the process of analytical modeling. In the real world, there are always complicated relationships among various concepts, such as the teacher-student relationship between teachers and students, the superior and subordinate relationship between deans and teachers, and the scientific research relationship between professors and graduate students in schools. As relationships become more numerous and complex, it becomes less expressive to simply represent the delegation of relationships between objects. At this point, relationships can be distilled into an explicit concept in the model.

Modeling principle: If a type has multiple similar associations, you can define a new type for those association objects and create a knowledge type to distinguish them.

There is some business overlap between the promotional activities described above and the promotional rules. For example, the promotion rules of platform dimension actually correspond to the selection of platform or region in promotion activities. The promotion rule of the total number of items dimension overlaps with the configuration of the applicable item (variety) selection in the promotion campaign. This is because we have expanded the extension of the so-called “rules”. A Rule is not a plan, let alone a strategy, but a specific set of constraint rules that can be used to judge whether conditions are met. For example:

The purchase of designated books is 20 yuan less than 100 yuan, and 40 yuan less than 200 yuan, valid on December 12, 2018.Copy the code

The above description is not a promotion rule, but a complete promotion. The product of this promotion is “Coupons”, and the Coupon type is cash Coupon (if the description is full discount, it is discount Coupon). Description of “designated book” belongs to the configuration of applicable products (varieties) in the promotion, and description of “Valid on December 12, 2018” is the valid period attribute of the promotion. Only the description “over 100 yuan minus 20 yuan, over 200 yuan minus 40 yuan” is the so-called rule. This rule contains two additional conditions (Creteria) for the amount threshold. For this scenario, we can introduce “Specification patterns” into the analysis model.

The specification pattern was proposed by Martin Fowler and Eric Evans, who described the specification pattern as follows:

Selection: A subset of objects needs to be selected based on certain conditions (Creteria), and Validation needs to be refreshed multiple times: Need to get the right object that meets the criteria based on the identified goals: Need to describe what the object should do without explaining the details of the object’s execution so that a candidate can be constructed to meet the requirements

Solution: Create a Specification object that can tell if a candidate meets certain criteria. The specification object defines the isSatisfiedBy(anObject) method, which returns true if all the criteria for anObject are met.

Results:

  • Decouple requirements design, implementation, and validation
  • Provide clear declarative system definitions

Specification objects can be single or composite.

A promotion rule can contain multiple specifications, which can be divided into:

  • Specifications of the Amount threshold: for example, 40 off if the Amount reaches 200 yuan, or 10% off if the Amount reaches 200 yuan
  • Quantity (Count) Threshold specifications: for example, 10% off for full 2 pieces, or limited purchase

Combining business analysis and model analysis, we can get the following analysis model:

When analyzing promotional products, we find that the concepts in the model are not at the same level of abstraction, and there are mixed relationships among them. For example, a Discount or cash credit can be offered separately for a promotion or bundled with coupons. Gift cards and vouchers can be complimentary or free shipping. Obviously, such concepts as discount, cash allowance, gift and free shipping are not promotional products, but a promotional product type, which is an attribute of promotional products. For example, if the promotional product type of coupons is discount, it is discount coupons, and if it is cash allowance, it is cash coupons. At this point, promotional products are actually a carrier of these product types.

In the promotion strategy of e-commerce system, promotional means such as discount and cash allowance do not necessarily need to be presented in the form of coupons or gift cards, but can be used separately as promotional products. However, in the modeling process, we do not allow confusion of concept levels, because we must avoid ambiguities of domain concepts. For example, for a Discount, it is necessary to distinguish clearly whether it is a promotional product or a promotional type. Since the concepts are not at the same level of abstraction, we need to create a layer of abstraction for these concepts, which is at the same level of abstraction as coupons and gift cards. This abstract concept of a promotional product is called a “Special Offer.” Therefore, the model established above can be improved as follows:

Modeling principles: Ensure that concepts in the analysis model follow the principle of a single level of abstraction.

Knowledge level and operation level

As the model became more complex, Analysis Patterns introduced operational level and knowledge level levels to organize concepts in the model. The operation-level model records daily events in the domain; The knowledge-level model defines the legal configuration of the operation-level objects and records the common rules governing the structure. There is no clear distinction between the knowledge level and the operational level, but Martin Fowler argues that “separating the two [knowledge level and operational level] helps clarify modeling ideas”. To do this, we need to clarify the difference between the two.

In his book Analytical Models, Martin Fowler introduces the NHS Cosmos project as an example of an analytical model. The derivation of the model clearly shows how the introduction of these two levels makes the model clearer.

Cosmos, as a healthcare system, needed to model the measurement and observation needs of the pharmaceutical industry. In a nutshell, each patient’s measurements can be modeled as a “measurement.” Yet there are thousands of possible measurements for even a single patient in an entire hospital. Defining a corresponding attribute for each measurement means that there are thousands of possible measurement operations for a patient — and the interface for measurement becomes extremely complex. The solution to the analytical model is to include all the different things that can be measured (height, weight, blood sugar levels…). Both are taken as measurement objects and abstracted as Phenomenon types. Here, the measurement is at the operational level and the phenomenon type is at the knowledge level:

After introducing a phenomenon type for measurement, the patient can have many measurements, but for a particular phenomenon type, the patient has only one measurement. For example, John Smith is 1.75 meters tall. In the above model, the description information represents a measurement as a whole. The patient is John Smith, the phenomenon type is height, and the quantity is 1.75 meters.

So why are phenomenon types at the knowledge level and measurement at the operational level? Analysis Patterns provides a modeling principle: “Objects at the operational level change frequently, and their configuration is constrained by knowledge levels that rarely change.” It’s differentiated from the point of view of change. “Measurement” at the operational level can be defined as a variety of measurements, but the “phenomenon types” at the knowledge level can be exhaustively described. So when I say “change” I mean not a change in type, but a change in object value.

Domain concepts of the existence of some qualitative description, such as type A phenomenon in medical observation model, observation model of auto classification of automobile fuel shortage phenomenon, they are all in the system exists really objective facts, will not die, because see if establish qualitative description on the knowledge level, like this may, in accordance with the rules to use them. This is distinguished by the nature of the domain concept.

Returning to the promotion strategy model of e-commerce system, promotion can be defined as various, but promotion products and promotion types can be exhaustive in the field of promotion, so promotion should be defined at the operational level, while promotion products and promotion types belong to the knowledge level. Of course, the attributes within each level will naturally be classified into their levels. Just as quantity is measured, in the promotion strategy model, the effective period is the attribute of promotion, so the effective period also belongs to the concept of operation level.

Promotion is at the operational level because it is similar to the measurement concept in the case that there is only one promotion at a time for a particular type of promotion. In response to changes in operational objects (promotions), we introduced the concept of knowledge-level Activity Type.

From the nature of the domain concept, Discount is a qualitative description of promotion type, and cash coupon is also a qualitative description. Therefore, promotion type and coupon type belong to the knowledge level. So, is it a qualitative description that the promotion specification is “less than 200 yuan 40 yuan”? – it isn’t. While it is true that such a specification is an immutable fact once defined, it is attached to the promotion rules, and once the promotion rules are invalidated or deleted, such a specification has no meaning. Therefore, promotion rules and specifications should be operational concepts.

Each promotion has its own category (Label), which is a qualitative description of the promotion and belongs to the operation level object. In the calculation of promotional offers, different categories of goods are counted separately, but the same category can be compatible, which is equivalent to categorization. For promotions, if we treat a specific instance of promotion as an entity, promotions of the same entity are mutually exclusive when calculating promotional offers, and promotions of different entities can be stacked or combined according to Priority. This priority is a promotional attribute. Priorities can be configured in advance during promotion policies or specified by buyers. For example, when a buyer purchases a product, if multiple promotions overlap, the buyer can select the most suitable promotion based on the specific purchase situation. In this case, the priority specified by the user is higher than the pre-configured priority.

As with the priority attribute, we also need to introduce a “status” attribute for the “promotion” concept, such as marking the status of the promotion object as “unused,” “used,” and “expired.” The same promotion cannot be used by users indefinitely, or needs to be given an expiration date. Among them, “used” and “expired” both express the invalid status of the promotion instance. Obviously, this “state” property should be knowledge level. Take Pindong Duo Duo as another example. The coupon Bug mentioned just now is that the “status” attribute of promotion cannot be set to the “used” state after use. Or the promotion’s “status” attribute is not checked when the user uses the promotion and is only allowed to be available in the “unused” state.

Therefore, the following analysis model can be obtained by introducing modeling principles and patterns in the analysis model:

Validation of the analysis model

We can verify the obtained promotion analysis model with actual business scenarios. Take JINGdong Mall as an example, as shown below:

The figure above shows two types of promotion labels: joint promotion and New Year’s Day special for toys. Take the Toy New Year’s Day discount category for example,PromotionIs “cross shop full reduction”. The promotion ofActivity TypeIncluding applicable store (value is “cross-store”), applicable variety (value is “toy”).Promotion of productsFor the Special Offer,Product Type of promotionAs a Reward,RulesIs the amount threshold rule,SpecificationFor the full $99.00 reduction. Both toys in the picture belong to the same promotional category, so the two items can be added to each other when the full discount is calculated. The corresponding analysis model is:

Let’s look at another promotional scenario:

The promotion scenario shown in the figure above contains a variety of promotions, and their promotion categories (Lebel) are all self-operated by JD, so these products can be stacked when calculating the discount. Promotional entities included here include:

  • The store for Activity Type is self-operated by JINGdong, the promotional product is Coupon, the promotional product is Reward, the discount rule is the amount threshold, and the specifications are 49 minus 6, 158 minus 20, 258 minus 30, 388 minus 50, etc.
  • For the Activity Type, the store is self-operated by JD, and the applicable products are self-operated M&G designated products. The promotional products are Coupons, and the promotional products are Reward. The discount rule is the amount threshold, and the specifications are 98 minus 10.
  • Activity Type stores are applicable to JINGdong, promotional products are Special Offer, promotional products are Free Shipping, promotional rules are amount threshold, and specifications are 99.
  • Activity Type stores are applicable to JINGdong, promotional products are Special Offer, promotional products are trade-in, promotional rules are amount threshold, and specifications are over 30.

In the promotion model, these promotion entities are one promotion after another, and when realized, they are reflected as multiple promotion instances. These promotion instances can be applied to the same product through the “applicable goods” activity type of the promotion activity, forming the superposition of such promotion offers.

At present, the promotion model is not comprehensive. On the one hand, it depends on what kind of e-commerce application scenarios it applies to. For example, the promotion strategies of Taobao and JINGdong are different. Some e-commerce companies only support virtual goods, and the relevant promotion logic is different. On the other hand, the model itself does not consider how to calculate the amount of orders, payment, and return and exchange operations. In short, the business is about complex, the model will become correspondingly complex, but at the same time, we should learn to use abstraction to simplify the model, or in the expression of the model with different views to express different concepts, as far as possible to make the model become concise and intuitive, and at the same time, there is no lack of key domain concepts.