WO2017032244A1 - 一种行为记录的存储方法和设备 - Google Patents

一种行为记录的存储方法和设备 Download PDF

Info

Publication number
WO2017032244A1
WO2017032244A1 PCT/CN2016/095525 CN2016095525W WO2017032244A1 WO 2017032244 A1 WO2017032244 A1 WO 2017032244A1 CN 2016095525 W CN2016095525 W CN 2016095525W WO 2017032244 A1 WO2017032244 A1 WO 2017032244A1
Authority
WO
WIPO (PCT)
Prior art keywords
user
behavior record
server
storage unit
behavior
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2016/095525
Other languages
English (en)
French (fr)
Inventor
彭志成
李俊良
强琦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Publication of WO2017032244A1 publication Critical patent/WO2017032244A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24564Applying rules; Deductive queries

Definitions

  • the present application relates to the field of network technologies, and in particular, to a storage method and device for behavior records.
  • the sliding rule supports a SQL (Structured Query Language) statement in the engine.
  • the sliding rule is a query rule set by the merchant, which is used to query which users are the users that they want, or which users are potential users. Rules have certain requirements for the specified behavior record, and the behavior record also needs to meet the set time window limit, for example: 30 minutes before the current time, the number of users with more than 2 transactions.
  • the existing scheme for determining the user according to the sliding rule is implemented by using the flow computing system. Specifically, the user's message update is used to drive the calculation of the sliding rule. One sliding rule corresponds to one process, and the calculated intermediate result is written into the persistent storage. The final result is output to the specified terminal through a user-defined output interface.
  • the sliding rule of the user Since the sliding rule of the user is stored on different devices, when the behavior record query is performed, multiple behavior records are separately queried, and after all the users corresponding to the sliding rule are queried, the statistics are sent and sent to the user. The entire calculation to the output is time-consuming, usually in the second and minute levels, and cannot meet the time-critical services.
  • the query method provided by the above method can only meet the G2U (Group to Users, a query method, The sliding rule queries all the users who satisfy this sliding rule.
  • the query mode is relatively simple.
  • the purpose of the present application is to provide a storage method and device for a behavior record.
  • a behavior record By storing a user's behavior record in different storage units in a server, when performing a behavior record query, multiple behavior records can be simultaneously queried to make a search. The time is limited to within milliseconds, which shortens the time consuming from the entire calculation to the output result.
  • the storage method proposed in this application can not only satisfy the G2U check.
  • the inquiry method can also satisfy the U2G query method.
  • a storage method for behavior records includes a plurality of storage units, and the method includes:
  • the server acquires a behavior record and a user ID of the user
  • the server stores the behavior record in a corresponding storage unit, so that the server performs a query in a corresponding storage unit when receiving the query request.
  • the server stores the behavior record in a corresponding storage unit, specifically:
  • the server stores the behavior record in the behavior record queue.
  • the method includes:
  • the server establishes a corresponding behavior record list for the behavior record
  • the server records, in the behavior record list, a corresponding behavior record queue for the user according to the behavior record.
  • the method includes:
  • the server determines, according to the behavior record list, a sliding rule that the user ID meets, so that the server recommends the user ID to a publishing user corresponding to the sliding rule.
  • the method further includes:
  • the server recommends the determined user ID to the publishing user of the sliding rule.
  • the method further includes:
  • the server stores the user ID in a user packet queue in a corresponding storage unit, so that the server determines a storage unit corresponding to the user when performing a sliding rule query;
  • the user packet queue is a user packet queue that is not used in any of the user grouping lists when the server performs a behavior record query.
  • a server comprising a plurality of storage units, the server comprising:
  • the obtaining module is configured to obtain a behavior record and a user ID of the user;
  • a first determining module configured to determine, according to the user ID, a corresponding storage unit
  • a storage module configured to store the behavior record in a corresponding storage unit, so that the server performs a query in a corresponding storage unit when receiving the query request.
  • the storage module is specifically configured to:
  • the behavior record is stored in the behavior record queue.
  • the server further includes:
  • a first determining module configured to determine, according to the behavior record, whether the behavior record exists in the storage unit before the storage module stores the behavior record in a corresponding storage unit a corresponding list of behavior records
  • a first establishing module if the behavior record list corresponding to the behavior record does not exist in the storage unit, and is used to establish a corresponding behavior record list for the behavior record;
  • a second establishing module configured to establish, in the behavior record list, a corresponding behavior record queue for the user according to the behavior record.
  • the first determining module is further specifically configured to:
  • the server further includes:
  • a second determining module configured to determine a behavior record list corresponding to the user ID in the storage unit
  • a third determining module configured to determine, according to the behavior record list, a sliding rule that is satisfied by the user ID, so that the server recommends the user ID to a publishing user corresponding to the sliding rule.
  • the server further includes:
  • a third determining module configured to determine a behavior record list that satisfies user behavior in the sliding rule among the plurality of storage units when the server determines a user that satisfies a sliding rule
  • a fourth determining module configured to determine a behavior record queue corresponding to the user that exists in the behavior record list
  • a fifth determining module configured to determine, according to the behavior record queue, a user ID that meets a time period set in the sliding rule
  • a sending module configured to recommend the determined user ID to the publishing user of the sliding rule.
  • the server further includes:
  • a second determining module configured to determine whether the user ID exists in a user packet queue in the storage unit after the first determining module determines a corresponding storage unit according to the user ID
  • the storage module is further configured to store the user ID in a user packet queue in a corresponding storage unit if the user ID does not exist in the user packet queue in the storage unit, so that the server is in the Determining the storage unit corresponding to the user when performing the sliding rule query;
  • the user packet queue is in a user grouping list when the server performs a behavior record query Any user packet queue that is not being used.
  • the storage method proposed in the present application not only satisfies the G2U query mode, but also satisfies the U2G query mode.
  • FIG. 1 is a flowchart of a method for storing a behavior record in an embodiment of the present application
  • FIG. 2 is a schematic diagram of a storage structure of a behavior record list in an embodiment of the present application
  • FIG. 3 is a schematic diagram of a storage structure of a user packet queue in the embodiment of the present application.
  • FIG. 4 is a schematic structural diagram of a server in an embodiment of the present application.
  • a storage method of behavior records as shown in FIG. 1, the server includes a plurality of storage units, and the method includes the following steps:
  • Step 101 The server acquires a behavior record and a user ID (Identity) of the user.
  • the storage unit may include multiple mirror storage subunits, and each mirror storage subunit stores the same behavior record and has the same service function.
  • the storage unit in the server may be divided into a plurality of image storage subunits, each of which has a mirror storage subunit to provide a service, and the behavior record is stored in all the mirror storage subunits in a storage subunit when the storage is performed, that is, the same
  • a plurality of mirrored storage subunits in a storage subunit have the same storage data and can provide the same service, so if there is a problem with one mirror storage subunit in one storage subunit, other mirrors in the storage subunit
  • the unit can provide the same service, and at the same time, the multiple mirror sub-units can process multiple tasks at the same time, and can also provide services for one task at the same time.
  • the behavior record includes at least: behavior information of the user, and behavior time of the user.
  • the behavior record records what the user did at a certain point in time or time period. For example, if a user spent 100 yuan to buy a can of milk powder at 1 am, the behavior information of the event may include: generating a shopping (The user's shopping time has increased once), bought a can of milk powder, and spent 100 yuan.
  • the behavior record generated by this event can be: The user spent 100 yuan at 1 am, and the user performed once at 1 am.
  • Shopping and the user purchase a can of milk powder at 1 am when the user generates a corresponding behavior record when performing an event, the server generates a behavior record according to the predetermined behavioral content that needs to be counted.
  • Corresponding behavior record information when the user generates a behavior record information according to a behavior record, the behavior record is stored.
  • the behavior information corresponding to the event further includes: generating once Consumption (user's consumption increased by one time), the corresponding behavior record is: the user made a consumption at 1 am, the obtained line Information may be acquired according to a predetermined rule, i.e. what actions need to acquire information corresponding to the behavior record.
  • Step 102 The server determines a corresponding storage unit according to the user ID.
  • the server may determine, according to a preset rule, a storage unit corresponding to the user ID, for example, storing the user ID tail number 1 in the storage unit No. 1.
  • the server Since the number of user IDs is generally very large, in order to support such a large number of users and corresponding behavior records of the user, the server is divided into a plurality of storage units, and the behavior records corresponding to different users and their users are respectively stored according to the user ID, so that The load of the system can be effectively guaranteed when the server provides the query service, so that the query request is guaranteed in millisecond response.
  • each storage unit When making a query request, each storage unit only processes the calculation of the behavior record of the user responsible for itself, such as If the sliding rule is not associated with a certain storage unit, then the storage unit does not need to provide a service.
  • Step 103 The server stores the behavior record in a corresponding storage unit, so that the server performs a query in a corresponding storage unit when receiving the query request.
  • one storage unit can determine which sliding rules are satisfied by the stored users according to the stored behavior records for the corresponding ones, that is, one storage unit is only for a part.
  • the user performs the calculation of the sliding rule, so that multiple storage units can quickly complete the calculation of the sliding rule for all users, and since each storage unit can be divided into multiple mirror storage subunits, and each mirror storage sub
  • the unit can provide a complete service, so each mirror sub-unit can load-load the calculation task of the sliding rule, and quickly calculate the sliding rule.
  • the server The storage unit calculates the behavior record corresponding to the user stored by the storage unit, and the plurality of storage units jointly complete the calculation of the sliding rule for the entire user, and performs U2G (User to Groups, a query mode, which is queried by the given user ID). Check all sliding rules that the user ID meets)
  • U2G User to Groups, a query mode, which is queried by the given user ID.
  • each mirror storage subunit storing the storage unit of the user simultaneously calculates the behavior record corresponding to the user, and can quickly determine which sliding rules the user satisfies, because each mirror storage subunit It has a completed function, so it can also guarantee the stability of the system.
  • the server stores the behavior record in a corresponding storage unit, specifically:
  • the server stores the behavior record in the behavior record queue.
  • the server records the behavior record corresponding to different behavior information in different behavior record lists, and takes 3 behavior records generated by a user who bought 100 cans of milk powder at 1 am in the morning, for example,
  • the behavioral information corresponding to the behavior record is: a purchase is made, a can of milk powder is purchased and 100 yuan is spent.
  • the three behavioral information is generated by the same user in an event, because the server records the behavior according to the behavior information. Stored, so these 3 behavioral letters
  • the behavior records corresponding to the interest are stored in the list of three behavior records, which are: a list of shopping behavior records, a list of spending amount behavior records, and a list of milk powder behavior records, when other users also generate a certain time.
  • the server stores the behavior record corresponding to the behavior information in the corresponding behavior record list, for example, a user spends 80 yuan at 1 pm to buy a can of milk powder, and the server will The three behavior records generated by the user are stored in the above three behavior record lists. If a user spends 80 to buy a piece of clothing at 1 pm, the server will correspondingly generate a purchase and purchase corresponding to the user.
  • the behavior records are respectively stored in the shopping behavior record list, the spending amount behavior record list, and the behavior information generated by the user: buying clothes, stored in the clothing buying behavior record list, that is, the same generation generated by all users corresponding to the storage unit of the server The behavior record corresponding to the behavior information will exist in the same behavior record list.
  • the storage manner of the behavior record in the behavior information list is specifically as shown in FIG. 2 , taking the milk powder behavior record list as an example, and FIG. 2 stores the behavior record of all the users corresponding to a certain storage unit of the server.
  • the behavior list includes a plurality of behavior record queues, and each behavior record queue records behavior information of a milk powder purchased by the user at different times. Taking userid1 as an example, the userid1 records in the behavior record queue is userid1.
  • the behavior information of milk powder purchased at different times there are 3 Node nodes in the behavior record queue of userid1, indicating that userid1 has recorded the behavior of buying milk powder at three time points, and one Node node indicates that the behavior of buying milk powder occurs once in userid1, different
  • the Node node corresponds to the different time when the userid1 buys the milk powder, and the Node nodes in a queue are arranged according to a certain time sequence.
  • the behavior record list it may be determined that the user has recorded the behavior of buying milk powder, and may also determine the time of the behavior record of the user each time the milk powder is purchased according to the behavior record queue of the user, and at the same time, according to the behavior The number of Node nodes in the record queue determines the number of times the user buys milk powder.
  • the server When the user generates a behavior record, the server needs to store the behavior record in a corresponding storage unit, the storage unit needs to determine a behavior record list corresponding to the behavior record and generate the behavior record for Corresponding behavior record queues are stored, for example, if the behavior generated by the user is recorded as milk powder, the storage unit needs to store the behavior record in the milk powder behavior record list, and determine the behavior record corresponding to After the list of behavior records, It is also necessary to determine a behavior record queue corresponding to the user who generated the behavior record. As shown in FIG. 2, if the behavior record is generated by userid1, a Node node needs to be established in the behavior record queue of userid1, and the Node node is established. The user stores the behavior record.
  • the different Node nodes in the behavior record queue are sorted according to the time of occurrence of the behavior record, so that the time corresponding to the sliding rule can be quickly determined when calculating according to the sliding rule.
  • the method includes:
  • the server establishes a corresponding behavior record list for the behavior record
  • the server records, in the behavior record list, a corresponding behavior record queue for the user according to the behavior record.
  • the behavior record list corresponding to the behavior record may not exist in the storage unit. Therefore, it is necessary to establish a behavior record list for the behavior record corresponding behavior, and establish the behavior record corresponding to the user behavior in the behavior record. Record the queue and then store the behavior record in the behavior record queue.
  • the method further includes:
  • the server stores the user ID in a user packet queue in a corresponding storage unit, so that the server determines a storage unit corresponding to the user when performing a query according to the sliding rule;
  • the user packet queue is a user packet queue that is not used in any of the user grouping lists when the server performs a behavior record query.
  • Different storage units of the server acquire records of different user generated behaviors, and store the corresponding users in the storage unit. If the behavior record of the user is stored in the storage unit, the user belongs to the storage unit.
  • the storage unit needs to store the ID of the user, so that the storage device can quickly determine which users it corresponds to.
  • the user ID is stored in a user group queue as shown in FIG. 3, and each storage unit There are a plurality of user packet queues for storing the user ID corresponding to the storage unit. After the storage unit receives the corresponding user ID, it is first determined whether the user ID already exists in the storage unit, if present Indicates that the user ID has established a corresponding behavior record queue in the storage unit.
  • the user ID is the first time to establish a behavior record queue in its corresponding storage unit
  • the The user ID is stored in the storage unit, and the storage unit in the server may be in a service state at any time during storage.
  • the element When the element is in the service state, it needs to query the stored user ID to query the behavior record list and the behavior record queue corresponding to the user ID. If the user ID is added to the storage unit at this time, the storage unit is stable.
  • the user ID corresponding to the storage unit is divided into several groups, when adding the user ID, adding in the user group queue that is not used, this will not be
  • the stability and processing speed of the storage unit are affected, for example, if the current storage unit is calling userid1, ie the storage unit is using the user packet queue block1, the storage unit adds a new user ID in the user packet queue. It can be added to other unused queues other than block1, such as block2.
  • the storage structure of the behavior record and the user ID is based on the memory, so when the server is down or the program crashes (program abends), data recovery is required, and the server periodically dumps (backup according to a preset time).
  • File system The behavior record and user ID stored in the memory to the storage space in the server that is not lost when the program crashes or the program crashes, or other external memory, and also records the current offset of the message update (a function) , used to reference the specified reference, get a new reference by a given offset), when the server is down or the program crashes, the server can obtain data in its storage space or external storage for data recovery, At the same time, the message consumption continues to be consumed from the recorded offset, thereby avoiding the problem of data recovery caused by server downtime or program crash.
  • the server Since the length of data in the server is limited, generally the data is specified by the database when the data is accessed, and the server needs to perform GC (a recycling mechanism) processing on the data exceeding the deadline, so that the effective saving on the one hand
  • the memory enables more data to be stored in the storage unit in the server.
  • timely exhausting the expired data can accelerate the speed of the rule calculation.
  • the method includes:
  • the server determines, according to the behavior record list, a sliding rule that the user ID meets, so that the server recommends the user ID to a publishing user corresponding to the sliding rule.
  • the server when the server performs the U2G, that is, when the server determines which sliding rules are met by the user, the server needs to first locate the storage unit corresponding to the user ID, and may determine a mirror storage in the storage unit.
  • the sub-unit performs the query of the U2G.
  • the storage unit corresponding to the user ID is located, the storage unit is determined by the user group list in the storage unit.
  • the mirror storage sub-unit After the mirror storage sub-unit is determined, the mirror storage sub-unit
  • the behavior record list corresponding to the user ID is stored to determine which behavior records are satisfied by the user. Specifically, after the behavior record corresponding to the user ID is determined, the mirror storage subunit is determined according to the behavior record.
  • the time and behavior information is compared with the time and behavior information set in the sliding rule to determine which sliding rules are satisfied by the behavior record corresponding to the user ID, and the query result is returned.
  • the method further includes:
  • the server recommends the determined user ID to the publishing user of the sliding rule.
  • the server when the server performs G2U, that is, when the server determines a user that satisfies a sliding rule, the server receives a given sliding rule, and the server determines a mirror storage subunit that provides a query service in each storage unit, Sending, by the server, the sliding rule to the determined mirror storage subunit, using the mirror storage subunit to perform a query service according to the sliding rule, when the mirror storage subunit receives the sliding rule, Determining a behavior record list stored in the mirror storage subunit that satisfies user behavior in the sliding rule, and then determining a behavior record queue corresponding to the user that exists in the behavior record list (because the user generates behavior) The records are stored in different behavior record lists.
  • the behavior record queue corresponding to the user is likely to satisfy the sliding rule.
  • Column, and then the image storage sub-unit is determined according to the behavior rule corresponding to the sliding time of the sliding of the slide rule is satisfied queue rule user ID, and returns a query result.
  • the storage method proposed in the present application not only satisfies the G2U query mode, but also satisfies the U2G query mode.
  • the present application also provides a server.
  • the server includes a plurality of storage units, and the server includes:
  • the obtaining module 41 is configured to acquire a behavior record and a user ID of the user;
  • a first determining module 42 configured to determine, according to the user ID, a corresponding storage unit
  • the storage module 43 is configured to store the behavior record in a corresponding storage unit, so that the server performs a query in a corresponding storage unit when receiving the query request.
  • the storage module is specifically configured to:
  • the behavior record is stored in the behavior record queue.
  • the server further includes:
  • a first determining module configured to determine, according to the behavior record, whether a behavior record list corresponding to the behavior record exists in the storage unit before the storage module stores the behavior record in a corresponding storage unit;
  • a first establishing module if the behavior record list corresponding to the behavior record does not exist in the storage unit, and is used to establish a corresponding behavior record list for the behavior record;
  • a second establishing module configured to establish, in the behavior record list, a corresponding behavior record queue for the user according to the behavior record.
  • the first determining module is further specifically configured to:
  • the server further includes:
  • a second determining module configured to determine a behavior record list corresponding to the user ID in the storage unit
  • a third determining module configured to determine, according to the behavior record list, a sliding rule that is satisfied by the user ID, so that the server recommends the user ID to a publishing user corresponding to the sliding rule.
  • the server further includes:
  • a third determining module configured to determine a behavior record list that satisfies user behavior in the sliding rule among the plurality of storage units when the server determines a user that satisfies a sliding rule
  • a fourth determining module configured to determine a behavior record queue corresponding to the user that exists in the behavior record list
  • a fifth determining module configured to determine, according to the behavior record queue, a user ID that meets a time period set in the sliding rule
  • a sending module configured to recommend the determined user ID to the publishing user of the sliding rule.
  • the server further includes:
  • the first determining module determines a corresponding storage list according to the user ID After the element is used to determine whether the user ID exists in a user packet queue in the storage unit;
  • the storage module is further configured to store the user ID in a user packet queue in a corresponding storage unit if the user ID does not exist in the user packet queue in the storage unit, so that the server is in the Determining the storage unit corresponding to the user when performing the sliding rule query;
  • the user packet queue is a user packet queue that is not used in any of the user grouping lists when the server performs a behavior record query.
  • the storage method proposed in the present application not only satisfies the G2U query mode, but also satisfies the U2G query mode.
  • the present application can be implemented by means of software plus a necessary general hardware platform, and of course, can also be through hardware, but in many cases, the former is a better implementation. the way.
  • the technical solution of the present application which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium, including a plurality of instructions for making a
  • the terminal device (which may be a cell phone, a personal computer, a server, or a network device, etc.) performs the methods described in various embodiments of the present application.
  • modules in the apparatus in the embodiments may be distributed in the apparatus of the embodiment according to the description of the embodiments, or the corresponding changes may be located in one or more apparatuses different from the embodiment.
  • the modules of the foregoing embodiments may be integrated into one or may be deployed separately; may be combined into one module, or may be further split into multiple sub-modules.
  • the serial numbers of the embodiments of the present application are merely for the description, and do not represent the advantages and disadvantages of the embodiments.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

一种行为记录的存储方法,服务器包括多个存储单元,所述方法包括:所述服务器获取用户的行为记录和用户ID(101);所述服务器根据所述用户ID确定对应的存储单元(102);所述服务器将所述行为记录存储在对应的存储单元中,以使所述服务器在接收到查询请求时在对应的存储单元中进行查询(103)。该方法在进行行为记录查询时缩短了整个计算到输出结果的耗时,还可以满足多种查询方式。

Description

一种行为记录的存储方法和设备 技术领域
本申请涉及网络技术领域,特别是涉及一种行为记录的存储方法和设备。
背景技术
滑动规则在引擎中支持类SQL(Structured Query Language,结构化查询语言)语句,滑动规则是商家设定的查询规则,用于查询哪些用户是自己想要的用户,或哪些用户是潜在用户,滑动规则对指定的行为记录有一定的要求,并且要求行为记录还要满足设定的时间窗口的限制,例如:距离当前时间前30分钟,交易笔数大于2的用户有哪些。
现有根据滑动规则确定用户的方案使用流计算系统实现的,具体的,利用用户的消息更新来驱动对滑动规则的计算,一条滑动规则对应一个进程,计算的中间结果写入到持久化存储中,最终的结果通过用户自定义的输出接口输出到指定终端。
在实现本申请的过程中,申请人发现现有技术至少存在以下问题:
由于用户的滑动规则是存储在不同的设备上的,在进行行为记录查询时,多个的行为记录是分开进行查询的,在查询完所有滑动规则对应的用户后再进行统计并发送给用户,整个计算到输出结果耗时比较高,通常在秒级和分钟级,不能满足时间要求较高的业务,同时,上述方法提供的查询方式只能满足G2U(Group to Users,一种查询方式,通过滑动规则查询满足此滑动规则的所有用户)的查询方式,查询方式比较简单。
发明内容
本申请的目的在于提供一种行为记录的存储方法和设备,通过将用户的行为记录存储在服务器中的不同存储单元中,在进行行为记录查询时,多个行为记录可以同时进行查询,使查找时间限定在毫秒之内,缩短了整个计算到输出结果的耗时,同时,本申请中提出的存储方法不仅能够满足G2U的查 询方式,还可以满足U2G的查询方式。
本申请的技术方案如下:
一种行为记录的存储方法,服务器包括多个存储单元,所述方法包括:
所述服务器获取用户的行为记录和用户ID;
所述服务器根据所述用户ID确定对应的存储单元;
所述服务器将所述行为记录存储在对应的存储单元中,以使所述服务器在接收到查询请求时在对应的存储单元中进行查询。
所述服务器将所述行为记录存储在对应的存储单元中,具体为:
所述服务器根据所述行为记录中的所述用户的行为信息确定对应的存储单元中所述行为记录对应行为记录列表;
所述服务器根据所述用户ID确定所述行为记录列表中所述用户对应的行为记录队列;
所述服务器将所述行为记录存储在所述行为记录队列中。
在所述服务器将所述行为记录存储在对应的存储单元中之前,所述方法包括:
所述服务器根据所述行为记录判断所述存储单元中是否存在所述行为记录对应的行为记录列表;
如果不存在,所述服务器为所述行为记录建立对应的行为记录列表;
所述服务器根据所述行为记录在所述行为记录列表中为所述用户建立对应的行为记录队列。
当所述服务器判断一个用户满足的滑动规则时,所述方法包括:
所述服务器确定所述用户ID所在的存储单元;
所述服务器确定所述存储单元中所述用户ID对应的行为记录列表;
所述服务器根据所述行为记录列表确定所述用户ID满足的滑动规则,以使所述服务器将所述用户ID推荐给滑动规则对应的发布用户。
当所述服务器判断满足一个滑动规则的用户时,所述方法还包括:
所述服务器确定所述多个存储单元中满足所述滑动规则中的用户行为的行为记录列表;
所述服务器确定所述行为记录列表中都存在的用户对应的行为记录队列;
所述服务器根据所述行为记录队列确定满足所述滑动规则中设定的时间段的用户ID;
所述服务器将确定的用户ID推荐给所述滑动规则的发布用户。
在所述服务器根据所述用户ID确定对应的存储单元之后,所述方法还包括:
所述服务器判断所述存储单元中的用户分组队列中是否存在所述用户ID;
如果不存在,所述服务器将所述用户ID存储在对应的存储单元中的用户分组队列中,以使所述服务器在进行滑动规则进行查询时确定用户对应的存储单元;
所述用户分组队列是在所述服务器进行行为记录查询时用户分组列表中任一没有被使用的用户分组队列。
一种服务器,服务器包括多个存储单元,所述服务器包括:
获取模块,用于获取用户的行为记录和用户ID;
第一确定模块,用于根据所述用户ID确定对应的存储单元;
存储模块,用于将所述行为记录存储在对应的存储单元中,以使所述服务器在接收到查询请求时在对应的存储单元中进行查询。
所述存储模块具体用于:
根据所述行为记录中的所述用户的行为信息确定对应的存储单元中所述行为记录对应行为记录列表;
根据所述用户ID确定所述行为记录列表中所述用户对应的行为记录队列;
将所述行为记录存储在所述行为记录队列中。
所述服务器还包括:
第一判断模块,在所述存储模块将所述行为记录存储在对应的存储单元中之前,用于根据所述行为记录判断所述存储单元中是否存在所述行为记录 对应的行为记录列表;
第一建立模块,如果存储单元中不存在所述行为记录对应的行为记录列表,用于为所述行为记录建立对应的行为记录列表;
第二建立模块,用于根据所述行为记录在所述行为记录列表中为所述用户建立对应的行为记录队列。
所述第一确定模块还具体用于:
当所述服务器判断一个用户满足的滑动规则时,确定所述用户ID所在的存储单元;
所述服务器还包括:
第二确定模块,用于确定所述存储单元中所述用户ID对应的行为记录列表;
第三确定模块,用于根据所述行为记录列表确定所述用户ID满足的滑动规则,以使所述服务器将所述用户ID推荐给滑动规则对应的发布用户。
所述服务器还包括:
第三确定模块,当所述服务器判断满足一个滑动规则的用户时,用于确定所述多个存储单元中满足所述滑动规则中的用户行为的行为记录列表;
第四确定模块,用于确定所述行为记录列表中都存在的用户对应的行为记录队列;
第五确定模块,用于根据所述行为记录队列确定满足所述滑动规则中设定的时间段的用户ID;
发送模块,用于将确定的用户ID推荐给所述滑动规则的发布用户。
所述服务器还包括:
第二判断模块,在所述第一确定模块根据所述用户ID确定对应的存储单元之后,用于判断所述存储单元中的用户分组队列中是否存在所述用户ID;
所述存储模块,如果所述存储单元中的用户分组队列中不存在所述用户ID,还用于将所述用户ID存储在对应的存储单元中的用户分组队列中,以使所述服务器在进行滑动规则进行查询时确定用户对应的存储单元;
所述用户分组队列是在所述服务器进行行为记录查询时用户分组列表中 任一没有被使用的用户分组队列。
本申请通过将用户的行为记录存储在服务器中的不同存储单元中,在进行行为记录查询时,多个行为记录可以同时进行查询,使查找时间限定在毫秒之内,缩短了整个计算到输出结果的耗时,同时,本申请中提出的存储方法不仅能够满足G2U的查询方式,还可以满足U2G的查询方式。
附图说明
为了更清楚地说明本申请或现有技术中的技术方案,下面将对本申请或现有技术描述中所需要使用的附图作简单的介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本申请实施例中的一种行为记录的存储方法流程图;
图2为本申请实施例中的一种行为记录列表的存储结构示意图;
图3为本申请实施例中的一种用户分组队列的存储结构示意图;
图4为本申请实施例中的一种服务器的结构示意图。
具体实施方式
下面将结合本申请中的附图,对本申请中的技术方案进行清楚、完整的描述,显然,所描述的实施例是本申请的一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员获得的其他实施例,都属于本申请保护的范围。
一种行为记录的存储方法,如图1所示,所述服务器包括多个存储单元,所述方法包括以下步骤:
步骤101,所述服务器获取用户的行为记录和用户ID(Identity,身份标识号码)。
其中,所述存储单元中可以包括多个镜像存储子单元,每个镜像存储子单元中存储有相同的行为记录,且具有相同的服务功能。
具体的,为了提高服务器的可靠性,可以将服务器中的存储单元划分为 多个镜像存储子单元,每一个存储单元都有镜像存储子单元来提供服务,行为记录在进行存储时,将所述行为记录存储在一个存储子单元中的所有镜像存储子单元中,即同一个存储子单元中的多个镜像存储子单元具有相同的存储数据,可以提供相同的服务,因此如果一个存储子单元中的一个镜像存储子单元出现问题,所述存储子单元中的其他镜像子单元可以提供相同的服务,同时,所述多个镜像子单元可以同时处理多个任务,还可以为一个任务同时提供服务。
所述行为记录中至少包括:所述用户的行为信息、所述用户的行为时间。行为记录中记录了用户在某个时间点或时间段做了什么事情,以某用户在凌晨1点花了100元买了一罐奶粉为例,该事件的行为信息可以包括:产生了一次购物(用户的购物次数增加了一次)、买了一罐奶粉、花费了100元,该事件产生的行为记录可以为:该用户在凌晨1点花费了100元、该用户在凌晨1点进行了一次购物和该用户在凌晨1点购买了一罐奶粉,当用户在进行某个事件时产生了对应的行为记录时,所述服务器会根据预先设定的需要统计的行为内容对产生的行为记录生成对应的行为记录信息,当用户根据一个行为记录产生了一个行为记录信息时就会对所述行为记录进行存储,当然如果设定需要统计消费次数,该事件对应的行为信息还包括:产生了一次消费(用户的消费次数增加了一次),对应的行为记录为:该用户在凌晨1点进行了一次消费,获取的行为信息可以根据预先设定的规则进行获取,即需要获取哪些行为信息对应的行为记录。
步骤102,所述服务器根据所述用户ID确定对应的存储单元。
具体的,所述服务器可以根据预先设定的规则确定所述用户ID对应的存储单元,例如:将用户ID尾号为1的存储在1号存储单元中。
由于用户ID数目一般非常庞大,为了支撑如此庞大的用户数以及用户对应的行为记录,将所述服务器划分为多个存储单元,根据用户ID来分别存储不同用户及其用户对应的行为记录,这样可以在所述服务器提供查询服务时有效的保证系统的负载,从而使得查询请求在毫秒级响应得到保证。在进行查询请求时,每个存储单元只处理自身所负责的用户的行为记录的计算,如 果滑动规则没有关联到某个存储单元,那么所述存储单元不需要提供服务。
步骤103,所述服务器将所述行为记录存储在对应的存储单元中,以使所述服务器在接收到查询请求时在对应的存储单元中进行查询。
由于不同用户对应的行为记录存储在所述服务器中的不同存储单元中,一个存储单元可以根据其存储的用于对应的行为记录判断其存储的用户满足哪些滑动规则,即一个存储单元只针对一部分用户来进行滑动规则的计算,那么多个存储单元可以快速的完成针对所有用户的滑动规则的计算,并且,由于每个存储单元中可以划分成多个镜像存储子单元,且每个镜像存储子单元都可以提供完整的服务,因此每个镜像子单元可以对滑动规则的计算任务进行负载分担,快速完成滑动规则的计算,例如:在进行G2U的查询方式计算滑动规则时,所述服务器中的存储单元分别计算自身存储的用户对应的行为记录,多个存储单元来共同完成整个用户针对此滑动规则的计算,在进行U2G(User to Groups,一种查询方式,通过给定用户ID查询所述用户ID满足的所有滑动规则)的查询方式计算滑动规则时,存储该用户的存储单元的每个镜像存储子单元同时对该用户对应的行为记录进行计算,可以快速确定出该用户满足哪些滑动规则,由于每个镜像存储子单元都具有完成的功能,因此还可以保证系统的稳定性。
所述服务器将所述行为记录存储在对应的存储单元中,具体为:
所述服务器根据所述行为记录中的所述用户的行为信息确定对应的存储单元中所述行为记录对应的行为记录列表;
所述服务器根据所述用户ID确定所述行为记录列表中所述用户对应的行为记录队列;
所述服务器将所述行为记录存储在所述行为记录队列中。
具体的,所述服务器对不同行为信息对应行为记录存储在不同的行为记录列表中,以某用户在凌晨1点花了100元买了一罐奶粉产生的3个行为记录为例,这3中行为记录对应的行为信息分别为:产生了一次购物,购买了一罐奶粉和花费了100元,这3个行为信息是同一个用户在一个事件中产生的,由于服务器对行为记录是按行为信息进行存储的,因此将这3个行为信 息对应的行为记录分别存储在3个行为记录列表中,这3个行为记录列表分别为:购物行为记录列表、花费金额行为记录列表和买奶粉行为记录列表,当其他用户也在某时间产生了相应的行为信息,所述服务器会将行为信息对应的行为记录存储在对应的行为记录列表中,例如:某个用户在下午1点花费了80元买了一罐奶粉,所述服务器会将该用户产生的3个行为记录存储在上述3个行为记录列表中,如果某个用户在下午1点花费了80买了一件衣服,那么所述服务器会将该用户产生的一次消费和购物对应的行为记录分别存储在购物行为记录列表、花费金额行为记录列表,而该用户产生的行为信息:买衣服,存储在买衣服行为记录列表中,即所述服务器的存储单元对应的所有用户产生的同一行为信息对应的行为记录都会存在同一个行为记录列表中。
行为信息列表中的对行为记录的存储方式具体如图2所示,以买奶粉行为记录列表为例,图2中存储的是所述服务器某个存储单元对应的所有用户产生买奶粉的行为记录,所述行为列表中包括多个行为记录队列,每个行为记录队列记录的是一个用户在不同时间发生的买奶粉的行为信息,以userid1为例,userid1的行为记录队列中记录的是userid1在不同时间买奶粉的行为信息,userid1的行为记录队列中有3个Node节点,表示userid1在3个时间点发生了买奶粉的行为记录,一个Node节点都表示userid1发生一次买奶粉的行为,不同的Node节点对应userid1买奶粉的不同时间,一个队列中的Node节点是根据一定的时间顺序进行排列的。根据所述行为记录列表可以确定发生哪些用户发生过买奶粉的行为记录,还可以根据用户的所述行为记录队列确定用户每次发生买奶粉的行为记录的时间,同时,还可以根据所述行为记录队列中Node节点的个数确定不同用户发生买奶粉行为的次数。
在用户产生了一个行为记录时,所述服务器需要将所述行为记录存储在对应的存储单元中,所述存储单元需要确定所述行为记录对应的行为记录列表和产生所述行为记录的用于对应的行为记录队列,并进行存储,例如:如果所述用户产生的行为记录为买奶粉,那么所述存储单元需要将所述行为记录存储在买奶粉行为记录列表中,在确定出行为记录对应的行为记录列表后, 还需要确定出产生所述行为记录的用户对应的行为记录队列,如图2所示,如果所述行为记录是userid1产生的,那么需要在userid1的行为记录队列中建立一个Node节点,该Node节点用户存储所述行为记录。
其中,行为记录队列中不同的Node节点是按行为记录的产生的时间进行排序的,这样在根据滑动规则进行计算时可以快速确定出满足所述滑动规则对应的时间。
在所述服务器将所述行为记录存储在对应的存储单元中之前,所述方法包括:
所述服务器根据所述行为记录判断所述存储单元中是否存在所述行为记录对应的行为记录列表;
如果不存在,所述服务器为所述行为记录建立对应的行为记录列表;
所述服务器根据所述行为记录在所述行为记录列表中为所述用户建立对应的行为记录队列。
在确定出行为记录对应的用户所在的存储单元后,还要确定出所述存储单元中是否存在所述行为记录列表,如果所述行为记录中的行为信息是一种新的行为信息,那么所述存储单元中之前不可能存在所述行为记录对应的行为记录列表,因此,需要为所述行为记录对应的行为建立行为记录列表,并将所述行为记录中建立所述行为记录对应用户的行为记录队列,然后将所述行为记录存储在所述行为记录队列中。
在所述服务器根据所述用户ID确定对应的存储单元之后,所述方法还包括:
所述服务器判断所述存储单元中的用户分组队列中是否存在所述用户ID;
如果不存在,所述服务器将所述用户ID存储在对应的存储单元中的用户分组队列中,以使所述服务器在根据滑动规则进行查询时确定用户对应的存储单元;
所述用户分组队列是在所述服务器进行行为记录查询时用户分组列表中任一没有被使用的用户分组队列。
所述服务器的不同存储单元获取不同用户产生行为记录,并进行存储,所述存储单元中存储有其对应的用户,如果用户的行为记录存储在了所述存储单元中,那么表示所述用户属于所述存储单元,需要对用户的ID进行存储,以便所述存储设备快速确定出其对应哪些用户,具体的,所述用户ID存储在如图3所示的用户分组队列中,每个存储单元中有若干个用户分组队列,用于存储所述存储单元对应的用户ID,在存储单元接收到其对应的用户ID后,先要判断所述存储单元中是否已经存在所述用户ID,如果存在,表明所述用户ID已经在所述存储单元中建立过对应的行为记录队列,如果不存在,表明所述用户ID是第一次在其对应的存储单元中建立行为记录队列,需要将所述用户ID存储在所述存储单元中,由于服务器中的存储单元随时都可能处于服务状态,在存储单元处于服务状态时需要查询其存储的用户ID,以便查询所述用户ID对应的行为记录列表和行为记录队列,如果此时在所述存储单元中添加用户ID,会对所述存储单元的稳定性造成影响,以及对所述存储单元的处理速度造成影响,将存储单元对应的用户ID分成若干组,在添加用户ID时,在没有被使用的用户分组队列中进行添加,这样就不会对所述存储单元的稳定性和处理速度造成影响,例如:如果当前存储单元正在调用userid1,即所述存储单元正在使用用户分组队列block1,所述存储单元在用户分组队列中添加一个新的用户ID时,可以在除block1之外的其他没有使用的队列中添加,如:block2。
行为记录和用户ID的存储结构是基于内存进行的,因此当服务器发生宕机或者程序发生crash(程序异常终止)之后是需要进行数据恢复的,所述服务器根据预先设定的时间定期dump(备份文件系统)内存中存储的行为记录和用户ID到服务器中发生宕机或者程序发生crash时不会丢失的存储空间内,或其他外部存储器中,同时还要记录消息更新的当前offset(一种函数,用于以指定的引用为参照系,通过给定偏移量得到新的引用),当服务器发生宕机或者程序发生crash时,服务器可以获取其存储空间或外部存储器中的数据进行数据恢复,同时,消息消费从记录的offset继续消费,从而避免服务器发生宕机或者程序发生crash时引起的数据恢复的问题。
由于服务器中的数据的时间长度是有限的,一般是数据接入的时候就通过数据库指定好的,服务器需要对超过期限的数据进行GC(一种回收机制)处理,这样一方面有效的节省了内存,使得服务器中的存储单元中能存储更多的数据,另一方面,及时的把过期数据进行GC掉,可以加速规则计算时的速度。其中GC方案有两种,一种为:每次进行数据备份的时候,进行一次全量GC;另外一种为:使用GC管理器,在服务器低负载时触发GC任务,这样能有效的减少GC对在线查询的干扰。
当所述服务器判断一个用户满足的滑动规则时,所述方法包括:
所述服务器确定所述用户ID所在的存储单元;
所述服务器确定所述存储单元中所述用户ID对应的行为记录列表;
所述服务器根据所述行为记录列表确定所述用户ID满足的滑动规则,以使所述服务器将所述用户ID推荐给滑动规则对应的发布用户。
具体的,服务器在进行U2G时,即所述服务器判断一个用户满足哪些滑动规则时,所述服务器需要先定位所述用户ID对应的存储单元,并可以确定出所述存储单元中的一个镜像存储子单元进行此次U2G的查询,在定位所述用户ID对应的存储单元时具体是通过存储单元中的用户分组列表确定存储单元的,在确定出镜像存储子单元后,所述镜像存储子单元中存储有所述用户ID对应的行为记录列表确定所述用户满足哪些行为记录,具体的,所述镜像存储子单元在确定出所述用户ID对应的行为记录后,根据所述行为记录中的时间和行为信息与滑动规则中设定的时间和行为信息进行对比判断所述用户ID对应的行为记录都满足哪些滑动规则,并将返回查询结果。
当所述服务器判断满足一个滑动规则的用户时,所述方法还包括:
所述服务器确定所述多个存储单元中满足所述滑动规则中的用户行为的行为记录列表;
所述服务器确定所述行为记录列表中都存在的用户对应的行为记录队列;
所述服务器根据所述行为记录队列确定满足所述滑动规则中设定的时间段的用户ID;
所述服务器将确定的用户ID推荐给所述滑动规则的发布用户。
具体的,服务器在进行G2U时,即所述服务器判断满足一个滑动规则的用户时,所述服务器接收给定的滑动规则,所述服务器确定每个存储单元中提供查询服务的镜像存储子单元,所述服务器将所述滑动规则发送到确定出的镜像存储子单元中,使用所述镜像存储子单元根据所述滑动规则进行查询服务,在所述镜像存储子单元接收到所述滑动规则时,确定所述镜像存储子单元中存储的满足所述滑动规则中的用户行为的行为记录列表,然后在确定出所述行为记录列表中都存在的用户所对应的行为记录队列(因为用户产生的行为记录存储在不同的行为记录列表中,只有用户产生的行为记录所在的行为记录列表都满足所述滑动规则中的行为信息是所述用户才可能是满足所述滑动规则的用户),此时确定出的用户所对应的行为记录队列是可能满足所述滑动规则的队列,所述镜像存储子单元再根据所述滑动规则中行为对应的时间确定所述滑动规则队列中满足所述滑动规则的用户ID,并返回查询结果。
本申请通过将用户的行为记录存储在服务器中的不同存储单元中,在进行行为记录查询时,多个行为记录可以同时进行查询,使查找时间限定在毫秒之内,缩短了整个计算到输出结果的耗时,同时,本申请中提出的存储方法不仅能够满足G2U的查询方式,还可以满足U2G的查询方式。
基于与上述方法同样的申请构思,本申请还提出了一种服务器,如图4所述,服务器包括多个存储单元,所述服务器包括:
获取模块41,用于获取用户的行为记录和用户ID;
第一确定模块42,用于根据所述用户ID确定对应的存储单元;
存储模块43,用于将所述行为记录存储在对应的存储单元中,以使所述服务器在接收到查询请求时在对应的存储单元中进行查询。
所述存储模块具体用于:
根据所述行为记录中的所述用户的行为信息确定对应的存储单元中所述行为记录对应行为记录列表;
根据所述用户ID确定所述行为记录列表中所述用户对应的行为记录队 列;
将所述行为记录存储在所述行为记录队列中。
所述服务器还包括:
第一判断模块,在所述存储模块将所述行为记录存储在对应的存储单元中之前,用于根据所述行为记录判断所述存储单元中是否存在所述行为记录对应的行为记录列表;
第一建立模块,如果存储单元中不存在所述行为记录对应的行为记录列表,用于为所述行为记录建立对应的行为记录列表;
第二建立模块,用于根据所述行为记录在所述行为记录列表中为所述用户建立对应的行为记录队列。
所述第一确定模块还具体用于:
当所述服务器判断一个用户满足的滑动规则时,确定所述用户ID所在的存储单元;
所述服务器还包括:
第二确定模块,用于确定所述存储单元中所述用户ID对应的行为记录列表;
第三确定模块,用于根据所述行为记录列表确定所述用户ID满足的滑动规则,以使所述服务器将所述用户ID推荐给滑动规则对应的发布用户。
所述服务器还包括:
第三确定模块,当所述服务器判断满足一个滑动规则的用户时,用于确定所述多个存储单元中满足所述滑动规则中的用户行为的行为记录列表;
第四确定模块,用于确定所述行为记录列表中都存在的用户对应的行为记录队列;
第五确定模块,用于根据所述行为记录队列确定满足所述滑动规则中设定的时间段的用户ID;
发送模块,用于将确定的用户ID推荐给所述滑动规则的发布用户。
所述服务器还包括:
第二判断模块,在所述第一确定模块根据所述用户ID确定对应的存储单 元之后,用于判断所述存储单元中的用户分组队列中是否存在所述用户ID;
所述存储模块,如果所述存储单元中的用户分组队列中不存在所述用户ID,还用于将所述用户ID存储在对应的存储单元中的用户分组队列中,以使所述服务器在进行滑动规则进行查询时确定用户对应的存储单元;
所述用户分组队列是在所述服务器进行行为记录查询时用户分组列表中任一没有被使用的用户分组队列。
本申请通过将用户的行为记录存储在服务器中的不同存储单元中,在进行行为记录查询时,多个行为记录可以同时进行查询,使查找时间限定在毫秒之内,缩短了整个计算到输出结果的耗时,同时,本申请中提出的存储方法不仅能够满足G2U的查询方式,还可以满足U2G的查询方式。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到本申请可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台终端设备(可以是手机,个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。
以上所述仅是本申请的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本申请原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视本申请的保护范围。
本领域技术人员可以理解实施例中的装置中的模块可以按照实施例描述进行分布于实施例的装置中,也可以进行相应变化位于不同于本实施例的一个或多个装置中。上述实施例的模块可以集成于一体,也可以分离部署;可以合并为一个模块,也可以进一步拆分成多个子模块。上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。
以上公开的仅为本申请的几个具体实施例,但是,本申请并非局限于此,任何本领域的技术人员能思之的变化都应落入本申请的保护范围。

Claims (12)

  1. 一种行为记录的存储方法,其特征在于,服务器包括多个存储单元,所述方法包括:
    所述服务器获取用户的行为记录和用户ID;
    所述服务器根据所述用户ID确定对应的存储单元;
    所述服务器将所述行为记录存储在对应的存储单元中,以使所述服务器在接收到查询请求时在对应的存储单元中进行查询。
  2. 如权利要求1所述方法,其特征在于,所述服务器将所述行为记录存储在对应的存储单元中,具体为:
    所述服务器根据所述行为记录中的所述用户的行为信息确定对应的存储单元中所述行为记录对应行为记录列表;
    所述服务器根据所述用户ID确定所述行为记录列表中所述用户对应的行为记录队列;
    所述服务器将所述行为记录存储在所述行为记录队列中。
  3. 如权利要求2所述方法,其特征在于,在所述服务器将所述行为记录存储在对应的存储单元中之前,所述方法包括:
    所述服务器根据所述行为记录判断所述存储单元中是否存在所述行为记录对应的行为记录列表;
    如果不存在,所述服务器为所述行为记录建立对应的行为记录列表;
    所述服务器根据所述行为记录在所述行为记录列表中为所述用户建立对应的行为记录队列。
  4. 如权利要求2所述方法,其特征在于,当所述服务器判断一个用户满足的滑动规则时,所述方法包括:
    所述服务器确定所述用户ID所在的存储单元;
    所述服务器确定所述存储单元中所述用户ID对应的行为记录列表;
    所述服务器根据所述行为记录列表确定所述用户ID满足的滑动规则,以使所述服务器将所述用户ID推荐给滑动规则对应的发布用户。
  5. 如权利要求2所述方法,其特征在于,当所述服务器判断满足一个滑 动规则的用户时,所述方法还包括:
    所述服务器确定所述多个存储单元中满足所述滑动规则中的用户行为的行为记录列表;
    所述服务器确定所述行为记录列表中都存在的用户对应的行为记录队列;
    所述服务器根据所述行为记录队列确定满足所述滑动规则中设定的时间段的用户ID;
    所述服务器将确定的用户ID推荐给所述滑动规则的发布用户。
  6. 如权利要求1所述方法,其特征在于,在所述服务器根据所述用户ID确定对应的存储单元之后,所述方法还包括:
    所述服务器判断所述存储单元中的用户分组队列中是否存在所述用户ID;
    如果不存在,所述服务器将所述用户ID存储在对应的存储单元中的用户分组队列中,以使所述服务器在进行滑动规则进行查询时确定用户对应的存储单元;
    所述用户分组队列是在所述服务器进行行为记录查询时用户分组列表中任一没有被使用的用户分组队列。
  7. 一种服务器,其特征在于,服务器包括多个存储单元,所述服务器包括:
    获取模块,用于获取用户的行为记录和用户ID;
    第一确定模块,用于根据所述用户ID确定对应的存储单元;
    存储模块,用于将所述行为记录存储在对应的存储单元中,以使所述服务器在接收到查询请求时在对应的存储单元中进行查询。
  8. 如权利要求7所述服务器,其特征在于,所述存储模块具体用于:
    根据所述行为记录中的所述用户的行为信息确定对应的存储单元中所述行为记录对应行为记录列表;
    根据所述用户ID确定所述行为记录列表中所述用户对应的行为记录队列;
    将所述行为记录存储在所述行为记录队列中。
  9. 如权利要求8所述服务器,其特征在于,所述服务器还包括:
    第一判断模块,在所述存储模块将所述行为记录存储在对应的存储单元中之前,用于根据所述行为记录判断所述存储单元中是否存在所述行为记录对应的行为记录列表;
    第一建立模块,如果存储单元中不存在所述行为记录对应的行为记录列表,用于为所述行为记录建立对应的行为记录列表;
    第二建立模块,用于根据所述行为记录在所述行为记录列表中为所述用户建立对应的行为记录队列。
  10. 如权利要求8所述服务器,其特征在于,所述第一确定模块还具体用于:
    当所述服务器判断一个用户满足的滑动规则时,确定所述用户ID所在的存储单元;
    所述服务器还包括:
    第二确定模块,用于确定所述存储单元中所述用户ID对应的行为记录列表;
    第三确定模块,用于根据所述行为记录列表确定所述用户ID满足的滑动规则,以使所述服务器将所述用户ID推荐给滑动规则对应的发布用户。
  11. 如权利要求8所述服务器,其特征在于,所述服务器还包括:
    第三确定模块,当所述服务器判断满足一个滑动规则的用户时,用于确定所述多个存储单元中满足所述滑动规则中的用户行为的行为记录列表;
    第四确定模块,用于确定所述行为记录列表中都存在的用户对应的行为记录队列;
    第五确定模块,用于根据所述行为记录队列确定满足所述滑动规则中设定的时间段的用户ID;
    发送模块,用于将确定的用户ID推荐给所述滑动规则的发布用户。
  12. 如权利要求7所述服务器,其特征在于,所述服务器还包括:
    第二判断模块,在所述第一确定模块根据所述用户ID确定对应的存储单 元之后,用于判断所述存储单元中的用户分组队列中是否存在所述用户ID;
    所述存储模块,如果所述存储单元中的用户分组队列中不存在所述用户ID,还用于将所述用户ID存储在对应的存储单元中的用户分组队列中,以使所述服务器在进行滑动规则进行查询时确定用户对应的存储单元;
    所述用户分组队列是在所述服务器进行行为记录查询时用户分组列表中任一没有被使用的用户分组队列。
PCT/CN2016/095525 2015-08-27 2016-08-16 一种行为记录的存储方法和设备 Ceased WO2017032244A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510536874.3A CN106484714B (zh) 2015-08-27 2015-08-27 一种行为记录的存储方法和设备
CN201510536874.3 2015-08-27

Publications (1)

Publication Number Publication Date
WO2017032244A1 true WO2017032244A1 (zh) 2017-03-02

Family

ID=58099608

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/095525 Ceased WO2017032244A1 (zh) 2015-08-27 2016-08-16 一种行为记录的存储方法和设备

Country Status (2)

Country Link
CN (1) CN106484714B (zh)
WO (1) WO2017032244A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112306871A (zh) * 2020-10-29 2021-02-02 广州博冠信息科技有限公司 数据处理方法、装置、设备及存储介质

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107797907A (zh) * 2017-10-30 2018-03-13 江西博瑞彤芸科技有限公司 基于用户行为的行为数据的统计方法
CN111598611A (zh) * 2020-04-27 2020-08-28 五八有限公司 一种积分行为处理方法、服务器、电子设备及存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102760138A (zh) * 2011-04-26 2012-10-31 北京百度网讯科技有限公司 用户网络行为的分类方法和装置及对应的搜索方法和装置
WO2012157496A1 (ja) * 2011-05-13 2012-11-22 日本電気株式会社 行動提示装置、行動提示方法および記録媒体
CN103067198A (zh) * 2012-12-14 2013-04-24 北京集奥聚合科技有限公司 一种关联用户CookieID的方法及系统
WO2013118424A1 (ja) * 2012-02-06 2013-08-15 日本電気株式会社 ユーザグルーピングシステム、端末及びユーザグルーピング方法

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101382135B1 (ko) * 2007-04-11 2014-04-07 삼성전자주식회사 네트워크 콘텐츠 재생 장치 및 방법
CN101409690A (zh) * 2008-11-26 2009-04-15 北京学之途网络科技有限公司 一种互联网用户行为的获取方法和系统
CN101510835B (zh) * 2009-03-23 2011-01-12 北京学之途网络科技有限公司 一种监测网络电视系统组播业务的方法及其系统
CN101620618B (zh) * 2009-07-24 2011-11-30 中兴通讯股份有限公司 内存存储数据的维护方法与装置
CN102098730B (zh) * 2011-03-04 2013-11-06 浙江大学 一种基于无线传感网络的多数据流处理方法
CN103186554B (zh) * 2011-12-28 2016-11-23 阿里巴巴集团控股有限公司 分布式数据镜像方法及存储数据节点
CN103488644B (zh) * 2012-06-12 2017-12-15 联想(北京)有限公司 进行数据存储的方法及数据库系统
CN104050266B (zh) * 2014-06-20 2017-11-10 小米科技有限责任公司 用户行为记录方法、装置和网页浏览器

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102760138A (zh) * 2011-04-26 2012-10-31 北京百度网讯科技有限公司 用户网络行为的分类方法和装置及对应的搜索方法和装置
WO2012157496A1 (ja) * 2011-05-13 2012-11-22 日本電気株式会社 行動提示装置、行動提示方法および記録媒体
WO2013118424A1 (ja) * 2012-02-06 2013-08-15 日本電気株式会社 ユーザグルーピングシステム、端末及びユーザグルーピング方法
CN103067198A (zh) * 2012-12-14 2013-04-24 北京集奥聚合科技有限公司 一种关联用户CookieID的方法及系统

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112306871A (zh) * 2020-10-29 2021-02-02 广州博冠信息科技有限公司 数据处理方法、装置、设备及存储介质

Also Published As

Publication number Publication date
CN106484714A (zh) 2017-03-08
CN106484714B (zh) 2019-06-21

Similar Documents

Publication Publication Date Title
CN107291779B (zh) 缓存数据管理方法及装置
JP2014531092A (ja) 分散データストリーム処理の方法及びシステム
JP2016503216A (ja) 継続時間可変イベントなしパターンマッチング
AU2020203282B2 (en) Method and system for matching multi-dimensional data units in electronic information system
US8793236B2 (en) Method and apparatus using historical influence for success attribution in network site activity
CN108259526B (zh) 一种数据传输方法和装置
US20140214632A1 (en) Smart Crowd Sourcing On Product Classification
US11354596B2 (en) Machine learning feature engineering
JP2014522056A (ja) 検索結果へのスクリーニング情報の適用
CN108809704B (zh) 基于动态时间窗的数据去重统计方法及装置
CN107103490B (zh) 一种数据处理方法、网络服务器及终端
WO2017032244A1 (zh) 一种行为记录的存储方法和设备
JP6761068B2 (ja) 決定装置、決定方法及び決定プログラム
CN112925808A (zh) 数据处理方法、装置及电子设备
CN106547751B (zh) 缓存数据的更新方法及装置
CN110348928A (zh) 信息推送方法、装置及计算机可读存储介质
JP2020154880A (ja) 算出装置、算出方法及び算出プログラム
CN108319622A (zh) 一种媒体内容推荐方法及装置
CN107193837B (zh) 数据汇总方法及装置
JP2021002367A (ja) 決定装置、決定方法及び決定プログラム
CN110020101B (zh) 实时搜索场景的还原方法、装置和系统
JP7010870B2 (ja) 決定装置、決定方法及び決定プログラム
CN108958902B (zh) 图计算方法和系统
CN110750706A (zh) 搜索热词确定方法、装置、系统及电子设备
CN115081972A (zh) 商品库存处理方法和系统、电子设备和存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16838503

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16838503

Country of ref document: EP

Kind code of ref document: A1