Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Guazi Fengyu: data Architecture Design of Guazi IM Intelligent customer Service system

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article is based on the content of Feng Yu's live speech at the 10th China system Architects Conference (SACC2018) on October 18, 2018.

Lecturer introduction:

Feng Yu, Guazi senior technical expert, professional member of Chinese computer Society. Guazi joined in February 2017, mainly responsible for Guazi instant messaging solution and related system research and development. During the period of Guazi, the host developed the message system to support Guazi internal effect tool quack, to meet the mobile office needs of more than 20,000 employees of Guazi. As a project manager, he was responsible for the online project of Guazi service. The project has a far-reaching impact on Guazi's transaction model and process.

Before joining Guazi, Feng Yu worked for 58.com, 58 Jiejia, and North China Institute of Computing Technology, and participated in the architecture and research and development of home messaging system, 58 crawler system and a number of national military research projects. Rich experience in messaging system, back-end architecture, storage architecture, etc.

Summary of this article:

Guazi business is offline, users watch cars online, book to the store, deal and many other links take place offline. The purpose of Guazi IM intelligent customer service system is to move these offline activities to the online, trace the offline behavior, and accumulate relevant data. The system connects users, customer service, e-marketing, sales, AI robot, business background and other roles and applications, covering online consultation, browsing, car booking, store experience, post-service, complaints and many other links, each role through the direct operation of the card delivery business.

For example, when the user has the intention to buy a car, the e-sales or AI robot will push the card to the user to book the car in time, and the user only needs to choose the time to complete the reservation. The whole system has complex logic, high timeliness and reliability, and involves IM messages, business cards and all kinds of real-time statistics. This lecture will explain the challenges and solutions of the system from the data architecture level.

Sharing outline:

I. background of the project

II. System architecture

III. Storage architecture

Text of the speech:

The topic shared today is "Guazi IM Intelligent customer Service data Architecture Design", this system is similar to Wangwang. Briefly talk about the sharing of several major parts: the first part of the project background, the project background needs to be talked about a little bit to help you understand; the second part is the system architecture, why talk about the system architecture briefly? Because the architecture that does not talk about business is all rogue, so when we talk about storage, we all need to know what the system is all about. The third part focuses on storage, where we will share our practical experience and the process of evolution. More are some of the holes we have picked, and how we solved them.

Project background

Those who are familiar with it all know that Guazi does not have a middleman to earn the price difference. in fact, Guazi has to do a lot of things in the middle. First of all, the second-hand car is very difficult, it is not a standard, we have to collect the car, the car is collected in the society, through the website, you have to check the car. We will put it on our website, some cars will receive our site, and some cars may be parked downstairs in the user's home. If a user comes to buy a car, after clicking on the Internet, you may place an order to see the car, our sales will go offline to accompany you to watch the car selection and test drive, and a series of retests, and so on, there are a lot of things.

Now we are not good enough for Guazi, why not good enough? We stand in Guazi internal point of view of this matter, there are a lot of behavior offline, it is difficult for us to prevent will bring a lot of problems. For example, Feidan, some go with other enterprises, this car is not sold on the platform, these problems are very difficult to solve. The second is what the sales are doing with the users, he may scold those users or something, looking back on the complaints found by the enterprise is very difficult to investigate. Well, an important problem of our project is to solve an online problem, that is, to move these offline behaviors online, and we use communications to transfer some business in the IM process, so as to solidify some of the entire business online.

The second is e-commerce. I prefer to use JD.com. I think his logistics and customer service are very good. Guazi also hopes to become an e-commerce, and another one can reduce costs and increase efficiency a little faster. If you use Guazi now, you will find that you browse online. There will be e-marketing personnel to call you. This is very annoying, the experience for users is not good, and the cost for Guazi is also very high. We also have a lot of e-commerce, so we started such a project to solve these problems.

Just mentioned is very complex, the whole system is connected with many roles, including users, sales, e-commerce, evaluators, as well as AI and robots. To be good at abstraction, we first have an instant messaging system based on communication. Second, we want to integrate the communication system into the business, or move these services to the communication system. This is the core.

This is a few screenshots. Let's look at the first picture. We have a car above and a reservation below. In fact, users can make an appointment directly in the chat interface. This is what I said is different from ordinary customer service. It can do something called shopping guide or marketing, directly through such a way, because Guazi's cost of getting customers is very high. Every user who visits Guazi, we hope to communicate with him in time. This picture is helpful for everyone to understand.

System architecture

The whole system is not a single system, it combines some business, we can split it into several levels. At the top is one end, the first is Guazi's APP, and of course there are edamame beans. Now there are several Guazi businesses, in addition to those used by some employees, such as e-commerce, customer service, after-sale, finance, we may all be some APP or some desktop systems, this is our client.

The second is a routing layer, we need to get through these services. In order for these businesses to be delivered in time in this system, there is a pattern in front of the so-called delivery. For example, if you want to make a car appointment, the customer service will send you a taxi card or e-mail will send you a taxi card, and you can directly choose the time. This is the delivery business. Further down is some business layer, that is, Guazi has a lot of what business is involved in what business, the bottom is a storage. This time, we will mainly talk about the whole system from the point of view of the storage layer, focusing on how the storage layer supports the routing layer.

Storage architecture

Storing this piece will talk about several points, including the split of the database, how to store the message, and the model of the group will be specifically mentioned in the message. Large-scale groups are more troublesome. There is also some storage logic and how to run the business above. Finally, there is statistical analysis, real-time calculation of such devices.

This diagram is a map of a database now. We see that these databases have been well divided, such as communication databases, scheduling, cards and analysis. I would like to introduce the new term dispatching here. What is it? Whether you click on a car or the person who clicks in this system, what the user sees during the chat is a Guazi customer service, and inside Guazi is actually a very large customer team to support you, so in the final analysis, which customer service you are chatting with, there are some strategies. We feel that such a split is actually reasonable, but in fact it is not at all. Let me give an example. In 2015, there was probably a sharing within JD.com. Liu Qiangdong's sharing revealed that there was a second-hand car company in a year or a month. I forgot that if I sold two cars, the valuation would reach 200 million US dollars. I can't believe it.

I share this example is not that there is anything wrong with speaking, of course, I believe he is not talking about Guazi, because Guazi A round it is more than this number, I would like to say that the initial enterprise is very small, the volume of business is very small, we simply can not be such a database structure, as teacher Shen said, in fact, it is a database without any IM, there is no scheduling These cards may be a database of cars sold.

I entered Guazi in February last year for almost two years. At that time, the business volume of Guazi was very small. I don't know, it was a database, a database was actually very good, because many people said they wanted to dismantle the database after they came. The advantage of a database is that writing business is very fast, and more than a dozen people quickly set up the system. As a matter of fact, we have also gone through a process of breaking up the library into several. At first, we did IM with only one IM library, then we added a library with scheduling, and then we had to expand our analysis step by step when we had any cards. In fact, this library has a certain cost. if you don't split it well, you will do a lot of interfaces. For example, if you do a correlation check, you will find that not my team's library also has to do a variety of interfaces, resulting in the consistency of distributed things, all of which have occurred. So the split of the database, especially the vertical split, is actually that you choose different split methods at different stages. In the future, with the expansion of the system and the expansion of the Guazi business, the system will split more databases, but more. The challenges for your operation and maintenance staff to monitor these teams will bring some costs as well as some challenges. We have now broken it down into such a library, each performing his or her own duties.

Next, let's focus on the news. How do we save this piece? Let's take a look at the picture on the left. The picture on the left is generally easy to understand. How do you store it? Desktop systems used to do this. For example, if A wants to send a message to B, how does he send it? He said, "A client, A client, I will send a message. If B is online, I will send him the message directly. He will give me a confirmation, and the process will be stored." In fact, I do not need to save this message in the service, what if A sends a C and this C is not online? We also have a strategy. A sent this message to C MagneC. If it is not confirmed that I have received the message, I will take the second step below. I will store it in an offline database waiting for you. When C is online, you will pull the message back, and the process will be over. I will send the message to C, so the storage at this time is very simple. I will have an offline database. It would be nice to save some information about someone.

But this mode actually has a lot of problems. When it is really used, many products are now mobile phones. First of all, the network is unstable and has been in a C state for a long time. If you monitor its status and send it or not, the storage performance will be very poor.

The second terminal now has many, including desktops, mobile phones, APP, and PAD. If you all use this mode, it is also very difficult to judge for each end to look at the data transmission. We have changed a way, step 1 comes the message, we will store the message in the repository, as long as you send the message, I will save it for you first, step 2, and I will also save it in a synchronous library. These two libraries need to explain a little bit, what do storage and synchronous libraries do respectively? The repository is easy to understand. You can restore your message from the library at any time and read it back. For example, if you change your phone, you can pull the message back. What does this synchronization library mean? The synchronization library means that you have not changed your phone or reinstalled the system, that is, you may have been offline for a period of time, and after you have been offline, you will say, for example, if a message sequence is sent to you from 1 to 100, A will be sent to Cpen 1 to 100. As a result, when C got the news on the 70th, he was offline, and he was not online. In this way, after the C terminal is online, the fourth step is to send the 70 message to the server, saying that I have 70 message synchronization database to know, and send 70 to 100 messages to C. This kind of message can be delivered to this end. These two concepts will be a little vague, but there is no relationship. I will continue to talk about it later.

In other words, a message, we will store a message synchronization library and a repository, this is actually a message synchronization library, it is a model, my next PPT should talk about what to use to store it.

If we understand it as an email, it's easy for you to understand. Our email has an inbox, and the synchronization library is like an inbox. No matter who sends it to you, whether it is sent in a group or individually, I will put a copy for you, put one in the inbox, A put this email into the message, and you want to take it out from another one. You have to receive this email whether you use this phone or your Apple system laptop or your windows book. What is the process of collecting? For example, just now I said that the first Apple system notebook, B1, said that I had received the first two B cursors before. It had the biggest message locally, saying that I was on the 2nd, and I received it. Then he passed the No.2 message to the server, and the server said yes. The message from the 2nd to the 20th can be received, so that the message can be sent to the client.

B2 said that I had actually received ten letters on this end before, and I started to receive them from 11 points. B3 said that I had received only one letter, and I would have received it from the second e-mail. In this way, the message was sent. There are several problems here, our synchronization process is theoretically OK, but there are several problems, the first is diffusion write diffusion reading, which is very related to storage, and there is a lot of discussion about diffusion writing and diffusion reading. For example, where did it come from? For example, if I am talking alone and there is no problem for us to chat, I must have written all the messages to you. But in fact, most of the time we are chatting in a group, selling to us, our evaluators or robots, they are all chatting inside, and users are also chatting inside. Do I write a copy of this message for everyone? or I write for the whole conversation, that is, this group, I only write and save one copy, and you all read it. For the message of a conversation, or the inbox in your own hand, let me first come to the conclusion that we use diffusion writing in the synchronization library of messages, and there is also a repository in which we use the method of diffusion reading. in the synchronization library, each of us wrote a copy, which is very convenient to read. When storing, because our storage speed is slower, we only write one piece of data, and this session has only one message.

The second point is that in fact, we have encountered some problems in the process of synchronization, and there are a lot of strategies to consider. It is a message TimeLine. Sometimes different ends have different synchronization strategies. For example, in some scenarios, we require each end of the message to receive this message, that is, our notification, coupons issued by the company, and so on, should be delivered to each end. In some scenes, he wants to say that your phone has been taken away, so if you open the desktop, we will no longer send you this message. according to the synchronization model just now, every end with some difficulties may search for this message. so we have prepared three such storage numbers.

For example, the B1B2B3 on this picture, we have another number of the biggest news for the current message. The third number, the top piece of all the messages you searched inside, that is to say, it is more like B2, through the combination of these three locations, we can determine the location or a strategy for you to receive messages. This is this model. What do we use for storage? We used Redis cluster, and we used the SortedSet structure.

I specifically mentioned it, because we actually stepped on a hole here. I'm going to save this news. We all need to know the efficiency of this structure. We checked that the efficiency of SortedSet is OK, that is to say, it is an efficiency like a ln. So in the synchronization library, if we only store some messages for each user, its performance is very high. This structure is essentially a jump table, which is actually very complicated. I think it is very difficult to explain it clearly at this meeting. Finally, I put two pictures, that is, a book.

We know that these structures, such as binary trees or some red-black trees, have better indexing strategies, and so are jump tables. What is it similar to? for example, there are a thousand pages in a book. How do I turn to page 856? In fact, we have a way to go to the front to find the index to locate something, and I turned to page 800 and corrected it step by step. The structure of the jump table is essentially more like flipping through a book. I think it is to turn to a large page, first turn 800 pages, turn to 850, and then gradually turn to 860 pages.

Let's share what kind of problem we have in this piece! We SortedSet store messages, and we store messages for global consistency. This algorithm our message is a long integer, that is, the work card, I first talk about it does not matter, first talk about the following precision loss, our message is a long integer. There are a total of 64 bits in this scenario, so the snowflake algorithm does not use the first bit in front of it, it actually represents a positive integer and it makes sense. Use 41 to represent a time interval, in which some ID represents about 60 or 70 years or 30 or 40 years, anyway, it must be enough.

The middle ten digits are a working machine number, and it can support 1024 machines. We can't use so many machines at this stage. The last 12 digits are a sequence number within a millisecond, so the ID that makes up our message is a long string, which is an 18-digit integer.

After putting it into the SortedSet, we later found some problems, found that the time is close to the news, we can not distinguish its order. As we dig deeper, we find that the ten words of SortedSet are actually of type double, and the following figure is a description of the type of double with an accuracy of only 52 bits, while the upper long integer has an accuracy of 63 bits, which has a gap of 11 digits. So in that message that is very close in an instant, its accuracy is lost, and when we retrieve it, there is something wrong with the order.

Therefore, we have adopted a strategy, which can also be used for reference. According to our load and the number of machines at that time, this finally ensures that we can hardly encounter the problem of precision loss, so we reduce the accuracy actively. This case says that when we choose to store, the data type is very important, you have to look at it according to your business type.

We still encounter some problems when we are synchronizing, that is, this problem appears more in a tool within us. We have a lot of large groups, because our message is like an inbox, and its size is limited. Some large groups are frantically browsing messages. In this way, there may be hundreds of thousands of messages in this group, because the size of our inbox is limited. We will eliminate the earlier news, causing some important messages to be lost. This is our problem, and there will be a solution to the PPT later.

The second problem is that there are still some web-side, our web-side. In fact, the local cache is very difficult to use. This is how much unread it has after our users open it. We can only calculate how many unread it has by pulling the message back and how many new messages we have pulled. In fact, this is also a challenge for us, very unfriendly.

Next, let's talk about the storage of this piece. We are going to store the message in the library. How do we store the message? As we just mentioned, it is stored according to a dimension in which everyone you see chatting with you in each session. We also adopt the strategy of sub-library, which is relatively simple. This is an example. In fact, there are more than this library. We divide the ID of one of his message paintings by four and take its module to determine which library it is put in. As mentioned just now, many of our ID are generated by the snowflake algorithm. We have a way to prevent its uneven survival. Take a look. This is a scheme that we prevent its ID from being unevenly distributed. We see that there is a 12-bit sequence number in the end, and if you don't intervene, it starts from zero every time. In fact, when your concurrency is relatively small, you will find that it is followed by zeros, and the last few bits are like you. If they are all zero, if you use your fixed modular algorithm, he is absolutely uneven.

For example, your database is not enough, and when you want to expand the capacity, you will find it very difficult. You do not know the previous data, and you can only find out all the previous data, which is simply a disaster, so we need human intervention. We just use the modular method to carry out special processing of the sub-database, plus some sub-database behavior, in which we use an ID generation time. Give him a mask of the last eight digits, and when he is in 128 databases, it will be evenly distributed.

Tell me how to expand the capacity. The initial business volume mentioned earlier is very small, but Guazi has already sold 10,000 cars a day a few days ago, so now we will gradually get up. When 10,000 cars are traded, the number of users is very large. How do we expand capacity? this is the basic method of expanding capacity. We initially had several libraries such as db0123. Let's take a look at the left side of the graph. On the left side of the graph, there is a msg:chatid=100 and a msg:chatid=104. When chatid divided by four, 100,104 of these two data, it will attach equal importance to the db0 of this library. What do we do when we divide the bank? The first step is to import a library like db0123 at the same time, I will synchronize between master and slave, but I am working on the same db1 and db5 data as db4567,db0 and db4 data, corresponding to the same. What happens when we change the sub-library strategy to divide by eight for the remainder? We found that according to the new sub-library strategy, chatid104 is still in db0, and chatid100 because he went to db4 after that, in this way, we have directly changed from four libraries to eight libraries, and then the process is that after the sub-database rules are online, we will delete other data that does not belong to the library by DBA, and the expansion of the library will be done, so the business can continue to run, but does this solve the problem? In fact, it is not simple, far from it, because you are like the database in front of our database is MySQL. For security, he may have one and two databases to expand. Simply, there are more and more databases. He quit its operation and maintenance and DBA, saying that you have more and more libraries. How can I maintain this? I can't stand it.

So there is also this kind of relational database, which can support very rich logic such as transactions have a lot of transaction-related queries, but in fact, we have the most messages in an application with the largest amount of data. it doesn't need to be so complicated, it's very simple. I either look up a message according to the message ID, or retrieve the message between this range according to a message. We really don't need such complicated logic, so it's not particularly suitable to use a relational database for storage, so we'll study it.

We first found that a sequential database is an OpenTSDB, and its application scenario is very similar to this business. OpenTSDB is internally implemented with Hbase, and we think Hbase is very good. Why did we choose Hbase? Because it is maintained by the team, it is very realistic. After choosing Hbase, the next students who have used Hbase will know that, in addition to our need to slice, after these are done, the most important thing is to design a Rowkey design that needs to be combined with business, and needs to be designed very delicately. The result of our Rowkey is that a session chatid ID,Chatid can be used for scope retrieval in order to spread region,msgid time.

And if we use this to consult, you will often have a scene. I open the latest news I see, and I draw a line down to load the older news. As soon as this structure comes in, I will retrieve your latest news. When you slide down, we will continue to check the news behind. This is very fast, and if there is nothing there, it is very convenient for you to reinstall a new one. You go directly to Hbase to query the latest Rowkey and you will find your latest news, and this will be solved.

Another point is region, just like the sub-library, Hbase does better, it can help you maintain this shard, but we do not recommend doing so to maintain your own shard, when you have a small amount of data stored in messages like this, it is very small, it will lead to a region by default, but such a reading and writing bottleneck is coming, so we need to plan the region of our sub-library in advance.

Here are some groups, there are some special places in the group. On our used car APP, this large-scale group is relatively small, but what I want to share is that some of the problems encountered by the group in our internal communication are also brought up, so let's share it with you.

The first one is to reduce the amount of storage just mentioned. This is the following repository, for example, there are many groups, there may be more than 2000 people have it. If I send a message and save 2000 copies, that is simply a disaster, so we can only save one copy, so after we see this picture in the blue on the left, we only save one copy, indicating which session or group it is, indicating the ID of the message.

Because one copy is saved, the second question arises. If those who joined the group today and those who joined the group yesterday actually saw the news, it should be different. The normal business is like this, and sometimes you can see how many pieces of logic have been implemented recently, that is, we are extending a database table to it, this table is in a relational database, record the number of the group on it, record the ID of this person, record the time when he added the group, and when we add the group, we can calculate it through a function. So the strategy of msg ID is very important. After adding group time, since it is a function of time, we can have a mapping relationship with the time of adding group. In this way, by adding group time, I can roughly locate which message he can retrieve from. If you need to make a strategy, you can also say that you can do as many items as you read above and as many as you can see below. The third is the problem of session ordering. In the scenario of this kind of dialogue, we can see that there will be a lot of conversations, so this is a strategic choice.

First, you can create a session for everyone, and every time he has a message, you update his last time. This process can satisfy the ranking of conversations, but in fact, can we do that? I don't think we can do this, because sometimes there are a lot of messages, and sometimes there are a lot of users, so we send a message. There are a thousand people to update his status, no matter how much you use, so the session strategy, we are also caching the last message of the session. When the user wants to pull his session list or update his session list, the server will give him a budget and return it to him. When we use it, we can normally receive a message locally with the client. If you are online, he knows how to adjust this data. The behavior of pulling a session, when it is opened offline again, needs to be updated at this time. If the frequency is relatively low, our storage model will also come out. Therefore, we track her status when many other businesses occur, and this session sorting can only be established when we, for example, read it.

The following has been read and unread, this point is no longer detailed, there are no features. We know that there is a storage structure for each message in the cache, saying who has read it and who has not read it, and eliminate it in a relatively short period of time. The news is withdrawn and mentioned. A little classmate did this before. How can the news be withdrawn? In the relational database, this message has to be withdrawn. I mark the message in the table. The message is withdrawn. Is there a problem with this? There's no problem at all.

Then he made another demand, saying that I just wanted to take a look at these unwithdrawn messages. What should I do? Not long after graduation, this student adjusted and thought of building an index. when he built the index, he could pull the data in this way. as a result, he ran to the police in the database for a period of time. I can't do this. What's going on? Because the ratio of recalled messages to normal unwithdrawn messages is a very small index that is out of balance, it is meaningless and consumes the performance of writing messages, so we withdraw messages in the following two ways. the first is to delete it from the message store and move it to a withdrawn message table, which is obvious. Another way is that we also mark it, but without indexing, I don't support you to filter and accept it, but I pull it out indiscriminately and filter it out at the logical layer of the storage.

As mentioned below, we say that storage structure is not only a simple concept of a simple database. In fact, there will be some conventions, specifications, or reducing complexity between db and business, because it is not good for you to let the business deal with it directly, so we have storage logic, so the logic layer does some basic logic.

Here to share with you, Guazi its APP status is not high enough, the first time I use it, it will log in, so we have to do some anonymous strategy, we hope that you can establish communication in an anonymous state, if you think we can continue to talk, whether we sell a car or buy a car, so anonymity brings a challenge to our business. We may have given him an ID, and when he chatted and thought it was OK, it logged in. After logging in, when his real name was, his real name may be a newly created one, or he may have logged in before, but because he forgot, or expired for a long time, at this time he was in the business process this time. He only has two ID. If he keeps making it two ID, it is actually very frustrating to the e-commerce staff behind him, saying that we started to chat with me. Later, he was actually one person, and the business in front of him was also interrupted. So we carried out a Merge on this news level. We didn't say your real name, so we gave your data to the move. According to this real name, there is a time series anonymously. Is there a real name? we are not doing this. We are still two, but the process of pulling at a level in the middle of the storage. When we need Merge, we give him Merge in the storage logic. But anonymity to real name is far from simple, just an extension. In fact, the anonymity in your message is very easy to do, but it is very difficult for your business to be anonymous to real name, and we often encounter this problem. The robot sent him something, anonymous status. Later, he logged in, as soon as he opened it, pulled back, the message was still with him, and he became his real name. He carries on the operation, at this time the business anonymous to the real name is actually more difficult, if there is such an idea, think in advance, more is the business level theory is.

This is the last part of the message, in fact, there will be some problems, in fact, message synchronization is a very complex thing, the more we do it, the more complex it is. What will happen to some people? for example, I received a few messages on my A phone, I received a few more messages on my B phone, and after a while I came to receive a few more messages on A phone.

You see, that kind of model just now will lead to a lot of faults in the middle, and there are a lot of faults in the middle, just like the picture on the right of Client. He didn't receive the message of 345, but the server actually has all the messages. At this time we made some strategies, we gave each message a strict number, msg index:1,2,3, each message a strict number. If this is the case, after the client knows, he will know whether it is right for me to lose the three numbers of 345. I can go to the server and say that I am short of 345 information, you can get it out for me. Is it that easy? The client may think this is very easy, but when it comes to the server, 345 is a number you made up by yourself, and our message said a unique number like snow?ake, so you can't find out which message ID you are with 345, so am I going to use which message to build such an index on the server, or should I use a number to msg ID index? We can do it, but the storage workload is very large, so how do we do it? We do something in the logic layer, every time the server returns a message from the client, we make this message into a linked list structure, when you pull it, because it's a lot of reverse messages, right? When I pulled away the 2nd message, I said, let me tell you, your next message is msg7. It doesn't matter if you pull it, or you can pull it paragraph by paragraph. When you pull to the msg6, I told you that your message msg5, my client said that the original lack of this message 5, so that the client can use this message ID to the server to retrieve the message, because it is a message ID, whether we are OK or our relational database is based on the index, it is easy to do, ready-made, and there is no need to maintain other index relationships. So this is also a strategic point. We can solve this kind of fault.

But there is still a problem. Sometimes there is a lot of news. If you accept all these messages from the synchronization library we just mentioned, the process is actually very slow, especially when it is not a good solution for deep users. There is a way for you to compress the message and send it to you. But in fact, it is still not good. The client has to render, and it is very slow to calculate the number. This is the problem of diffusion reading and diffusion writing mentioned just now. There was one at the earliest. So later, a better way is to say that the synchronization database does not synchronize specific messages. You can do this session of what changes the user has, such a session, how much unreceived data it has, and how much unread this number is recorded. In this way, the client can pull the data locally. After you see how many unread sessions there are, when you click in, you pull your message in the opposite direction according to this repository. In addition, we just talked about a filling strategy in the middle, a list completion strategy, such an experience is very good.

So we solved our project, we solved the problem of information. Later, let's take a look at the message that the solution is not finished. We want to promote this project, we need to land, we need to do business, because just sending a message is meaningless, for the audience, we are doing business. What we carry the business is called our business card. The things we saw in the original picture that can be directly operated in the past should also apply for a patent. At that time, I checked that no one did it like this, but since no one did it, we actually encountered some problems in the process of implementation. let's take a look at this picture.

There is a card agent on the right side of this picture, and a green card agent on the right is a special thing we set up for this business. We encountered a lot of problems in promoting. The original business departments of our business, they all have interfaces ready-made, because there are several ways to move it to the IM interaction: first, you all change it for me, this is very difficult. Some businesses said that he did not want to, so we designed all the responses of the cards produced by such an agent. First, we called one of our agent modules, and then the agent module adapted your original business logic. In this way, the agent module knew what the user's behavior was, whether it was successful or not, and then he informed all parties of the relevant business about the results through scheduling and through their channels. It's a strategy.

At the same time, it should be highly reliable. For example, making an appointment to see a car is equivalent to getting off work, which means that this is a very important business. You can't do this. the chain is too long and the risk is too high. I'd rather we could add something, that is, the logic on the left. This business service is willing to change it myself. I have to control the controllability. I can't say that because of communication problems, my business won't run. That's some of the logic that he changed to trigger the scheduling. This is the most important strategy in the whole process of promotion, and it is actually explored, because it is not only a technical problem, but also an organizational structure problem.

Briefly mention the scheduling problem, because it is not the point, how do you know which customer is serving you? We have come up with the concept of a scenario in which we have a state every time you enter the conversation interface from various entrances. Entrance A, entrance B, for example, if you hire a taxi or bargain, let's first register the scene with the dispatch, saying that I will come in from here, and at the same time, the dispatch will have some big data to support. It turns out who you are, you come in from this scene, we think you might be doing something. In this way, when he returns to the scene, when he has sex with the channel again, with this scene, our dispatch will know who you are pushing to, whether it is a sales or a robot. it is our specific customer service to solve complaints or solve what kind of e-sales customer service.

Next, let's talk about the analysis and statistics. For example, the scale of Guazi is already relatively large. We now have more than a thousand R & D teams, but there is also a lot of investment in big data, but in fact, the company is data-driven now. The strength of this team is still very limited. It supports a variety of business lines, and it is still very busy, so we have two pieces of analysis and statistics. The first piece is that the analysis of Tunable 1 is offline, and the other is a real-time analysis.

Our project has high requirements for real-time statistics, such as timely response rate, these various statistics require real-time monitoring and alarm, how to do? This is an architecture from another perspective of our entire system. With some of our news-related or business scheduling-related, we all go to a kafka, that is, channel and some sales evaluators sent to customer service, and so on. For these logic of their business line, we transmit some more data through kafka. We are wondering if we can simply implement the technology by borrowing kafka. In fact, we can. This concept is a streaming database. Our initial structure is the left side of the diagram, and all the messages in the middle of the system pass through a kafka.

We can ensure that the business runs above, and then kafka this piece of data it caches, we can stream it. Our overall architecture is shown in the figure above.

Finally, I would like to briefly repeat: our process, first, our system shows a communication through the data level, that is, such a system of instant messaging, about how it is done and how the database is stored; the second is to apply our communication capabilities to business systems, and we have solved some technical or organizational difficulties. The third is that we can find a relatively simple way to deal with some of our offline calculations. Of course, it is also possible for him to do Tunable 1. Thank you.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report