WO2017156927A1 - 一种生成计数事件的方法及装置 - Google Patents

一种生成计数事件的方法及装置 Download PDF

Info

Publication number
WO2017156927A1
WO2017156927A1 PCT/CN2016/088490 CN2016088490W WO2017156927A1 WO 2017156927 A1 WO2017156927 A1 WO 2017156927A1 CN 2016088490 W CN2016088490 W CN 2016088490W WO 2017156927 A1 WO2017156927 A1 WO 2017156927A1
Authority
WO
WIPO (PCT)
Prior art keywords
counting
count
target
identifier
subject
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/088490
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.)
Le Holdings Beijing Co Ltd
LeTV Information Technology Beijing Co Ltd
Original Assignee
Le Holdings Beijing Co Ltd
LeTV Information Technology Beijing Co 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 Le Holdings Beijing Co Ltd, LeTV Information Technology Beijing Co Ltd filed Critical Le Holdings Beijing Co Ltd
Priority to US15/242,241 priority Critical patent/US20170263068A1/en
Publication of WO2017156927A1 publication Critical patent/WO2017156927A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G07CHECKING-DEVICES
    • G07CTIME OR ATTENDANCE REGISTERS; REGISTERING OR INDICATING THE WORKING OF MACHINES; GENERATING RANDOM NUMBERS; VOTING OR LOTTERY APPARATUS; ARRANGEMENTS, SYSTEMS OR APPARATUS FOR CHECKING NOT PROVIDED FOR ELSEWHERE
    • G07C13/00Voting apparatus
    • 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/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking

Definitions

  • the embodiments of the present invention relate to the field of network communication technologies, and in particular, to a method and an apparatus for generating a counting event.
  • the present invention provides a method and apparatus for generating a counting event to solve the technical problem that the voting and other functions are less efficient in development.
  • a method of generating a counting event comprising:
  • the counting rule corresponding to the counting rule identifier, the counting option corresponding to the counting option identifier, wherein the counting subject corresponds to the counting subject identifier, wherein The counting subject is associated with the subscription content;
  • the target count event identifier includes a target count rule identifier, a target count subject identifier, and a target count option identifier;
  • a target count event is generated according to the target count rule, the target count subject, and the target count option, and the target count event is used to count the target count option sent by the user for the target count subject according to the target count rule.
  • an apparatus for generating a counting event comprising:
  • a data storage unit configured to store preset counting rules, counting options, and counting topics in a counting database, where the counting rules correspond to a counting rule identifier, the counting option corresponding to a counting option identifier, the counting subject and counting The subject identifier corresponds to, wherein the counting subject is associated with the subscription content;
  • a count event identifier obtaining unit configured to acquire a target count event identifier, where the target count event identifier includes a target count rule identifier, a target count subject identifier, and a target count option identifier;
  • a counting event definition unit configured to acquire, according to the target counting event identifier, a corresponding target counting rule, a target counting subject, and a target counting option from the counting database
  • a count event creation unit configured to generate a target count event according to the target count rule, the target count subject, and the target count option, wherein the target count event is used to count the target count option sent by the user for the target count subject according to a target
  • the rules are counted.
  • a server includes: the apparatus for generating a counting event according to the second aspect of the embodiment of the present invention.
  • voting, etc. is essentially a quantity or a pair
  • the counting of the ID so the present invention separates this set of ID and counting logic separately, realizes the stripping of "logic” and "content”, and the content-related parts (such as voting title, options, etc.) can be separately maintained.
  • the developer only needs to generate three types of identifiers according to preset rules, and then combines the three types of identifiers to obtain a count event identifier, which can be input to the system. By parsing the count event identifier, the system can automatically read the vote. Topics, voting rules, etc., to automatically create count events.
  • the logic and content stripping design of the present invention is highly adaptable, and is applicable not only to regular voting but also to Disguised voting, such as scoring, play count statistics, etc. (because it is essentially a count of an ID), allows developers to easily and flexibly create a variety of votes.
  • FIG. 1 is a flowchart of a method for generating a counting event according to an exemplary embodiment of the present invention
  • FIG. 2 is a flowchart of a method for generating a counting event according to an exemplary embodiment of the present invention
  • FIG. 3 is a flowchart of a method for generating a counting event according to an exemplary embodiment of the present invention
  • FIG. 4 is a flowchart of a method for generating a counting event according to an exemplary embodiment of the present invention
  • FIG. 5 is a schematic diagram of an apparatus for generating a counting event according to an exemplary embodiment of the present invention.
  • FIG. 6 is a schematic diagram of an apparatus for generating a counting event according to an exemplary embodiment of the present invention.
  • FIG. 7 is a schematic diagram of an apparatus for generating a counting event according to an exemplary embodiment of the present invention.
  • FIG. 1 is a flow chart showing a method of generating a counting event, according to an exemplary embodiment. This method can be used, for example, for a server or the like.
  • the method can include:
  • Step S101 The preset counting rule, the counting option, and the counting subject are stored in a counting database, where the counting rule corresponds to the counting rule identifier, the counting option corresponds to the counting option identifier, and the counting subject corresponds to the counting topic identifier. Wherein the counting subject is associated with the subscription content.
  • the counting subject may be a vote for a question.
  • the counting subject may correspond to an identifier, or an identifier may be assigned to the counting subject, and the identifier may be an ID (Identification, ID), and a number. Wait.
  • ID Identification, ID
  • the content of the voting question can be stored separately and the content is associated with the counting topic.
  • Step S102 Acquire a target count event identifier, where the target count event identifier includes a target count rule identifier, a target count subject identifier, and a target count option identifier.
  • the count event identifier (also referred to as the count event ID) can be entered by the technician.
  • the count can be one of the following:
  • the count is a vote
  • the count subject is a voting subject
  • the counting option is a voting option
  • the counting subject is a favorite object
  • the counting option includes at least one or two of praise, step
  • the counting subject is a play object, and the counting option is playing once;
  • the count is a score
  • the count subject is a scoring object
  • the count options include different scores.
  • the present invention can completely decouple the voting content and the voting counting function.
  • a vote is essentially a count of an identifier (or a data volume, an ID), and the content data of the vote itself (such as title, description, option content, etc.) is maintained by the caller, in the present invention only Maintenance vote
  • the piece ID can be related to the number of votes.
  • the voting event ID may be designed as a structure of A_B_C:
  • A is a rule ID (ie, a counting rule identifier), the ID may represent multiple rules;
  • B is a topic ID (ie, a counting subject identifier), or may be abstracted as The album ID, video ID, etc. can be freely set according to the specific voting requirements;
  • C is the option ID (ie, the counting option identifier), for example, who can be voted for, or can be abstracted as praise, step, and the like.
  • the specific form of the ID/identity is not limited in this embodiment, and may be, for example, a letter and a number, as long as the counting rule/counting subject/counting option represented by the identifier can be correspondingly found according to the identifier.
  • Step S103 Acquire, according to the target count event identifier, a corresponding target count rule, a target count subject, and a target count option from the count database.
  • the counting rule may include one or more of the following:
  • the regulations on whether or not to log in the restrictions on the IP address, the upper limit on the user count, the limit on the frequency of the user count, the statute of the count, the rule on the count consumption, and the limit on the count area.
  • the specific rule corresponding to the counting rule identifier may be various combinations of the above rules.
  • Step S104 Generate a target count event according to the target count rule, the target count subject, and the target count option, where the target count event is used to count the target count option sent by the user for the target count subject according to a target count rule.
  • the counting event identifier input by the technician is “12345_45678_5050”, and the server can find out from the back-end database that the corresponding voting rule is “votable after login” according to “12345”, and can be found from the background database according to “45678”.
  • the voting theme is "Which favorite show you like this week", according to "5050", you can find the voting option from the background as "(1) Tomb Notes (2) Pretender (3) ⁇ list", so there is After these three items, you can automatically create a count event, that is, create a voting event for "Which favorite show you like this week.” After the user sees the vote on the web page, the voting option can be selected on the web page, thereby completing the action of the target counting option sent to the server.
  • the acquiring, according to the target count event identifier, obtaining a corresponding target count rule, a target count subject, and a target from the count database Counting options can include:
  • Step S201 Parse the target count rule identifier, the target count subject identifier, and the target count option identifier according to a preset rule.
  • Step S202 Acquire a corresponding counting rule, a counting subject, and a counting option from the counting database according to the result of the parsing.
  • the logo is often a combination of symbols or symbols. It is more abstract and more concise. What does a logo mean? It usually needs to be resolved according to the preset rules.
  • the specific content of how to design each identifier and the preset rule is not limited in this embodiment, and those skilled in the art can design according to different situations.
  • the count event input by the developer is identified as "acef_452508_ZCL", where a stands for “requires login”, c stands for “can only vote once”, e stands for “does not consume points”, and f stands for “limit for IP”. Then “acef” is parsed out as a combination voting rule that requires “login, can only vote once, does not consume points, and limits IP”; “Z” stands for “like” and “C” stands for "step”, “L” “On behalf of "passing by”, then "ZCL” parsing is the vote has "like” "step” "pass” three options.
  • the method may further include:
  • Step S301 outputting a counting result of the counting event.
  • the back-end database can use redis, use its ordered collection to store the voting result data, and calculate the voting rank of the option in real time. If it belongs to a registered vote (requires user login, and limits the number of single-user voting, such as each user can only vote 1 time), you can use the ordered collection to store user voting behavior data, and calculate user rankings in real time.
  • FIG. 4 is a flowchart of a method of creating count information, according to an exemplary embodiment.
  • step S401 voting rules and voting options are set in advance.
  • the technician can pre-set a variety of voting rules such as "login, IP restriction, number of votes, frequency, cap, time limit, points, regional restrictions".
  • step S402 a voting theme ID, a voting rule ID, and a voting option ID are created.
  • each ID can be randomly generated or arbitrarily designated by a technician, as long as the only one does not conflict.
  • the voting subject ID may be "45678”
  • the voting rule ID may be "12345”
  • the voting option ID may be "5050”.
  • Step S403 binding the voting rule ID and the voting option ID to some preset voting rules and voting options, and associating the voting subject ID with a certain content, and combining to generate a voting event ID.
  • the three IDs are combined to obtain the voting event ID "12345_45678_5050", that is, the event identifier is counted.
  • Step S404 the voting event ID is input into the system, and the system parses the voting event ID to create a voting event.
  • Step S405 receiving a vote of each user.
  • the system can be based on the redis database, as well as the PHP (Hypertext Preprocessor) operating environment.
  • the installation and deployment have open source solutions. After the deployment is complete, the code package is deployed to the web folder for simple configuration. use.
  • asynchronous queue mode can be adopted, and the voting operation of 1 million/second can be handled asynchronously, and the message queue in the background can ensure the final consistency of the data.
  • step S406 the voting result and the ranking are output in real time or periodically.
  • voting system After the voting system is put into use, up to now, all voting requirements of operators and product personnel do not require additional development by the server; more than 10 operational voting requirements for different rule combinations have been achieved. And the voting system can be used to achieve user likes, video (album) praise stepping, number of play records, score records, graphic live likes, etc., without the need for the server to do any development work.
  • the embodiment of the present invention further provides a computer storage medium, wherein the computer storage medium can store a program, and the implementation of the method for generating a counting event provided by the embodiment shown in FIG. 1 to FIG. Some or all of the steps in the way.
  • FIG. 5 is a schematic diagram of an apparatus for generating a counting event, according to an exemplary embodiment.
  • the device can be used, for example, for a server.
  • the apparatus can include:
  • the data storage unit 501 is configured to store preset counting rules, counting options, and counting topics in a counting database, where the counting rules correspond to a counting rule identifier, and the counting option corresponds to a counting option identifier, and the counting theme is The counting topic identifier corresponds to, wherein the counting subject is associated with the subscription content.
  • the count event identifier obtaining unit 502 is configured to acquire a target count event identifier, where the target count event identifier includes a target count rule identifier, a target count subject identifier, and a target count option identifier.
  • the count event identifier (also referred to as the count event ID) can be entered by the technician.
  • a vote is essentially a count of an identifier (or a data volume, an ID), and the content data of the vote itself (such as title, description, option content, etc.) is maintained by the caller, in the present invention only Maintain the voting event ID and the number of votes.
  • the voting event ID may be designed as a structure of A_B_C:
  • A is a rule ID (ie, a counting rule identifier), the ID may represent multiple rules;
  • B is a topic ID (ie, a counting subject identifier), or may be abstracted as The album ID, video ID, etc. can be freely set according to the specific voting requirements;
  • C is the option ID (ie, the counting option identifier), for example, who can be voted for, or can be abstracted as praise, step, and the like.
  • the specific form of the ID/identity is not limited in this embodiment, and may be, for example, a letter and a number, as long as the counting rule/counting subject/counting option represented by the identifier can be correspondingly found according to the identifier.
  • the count can be one of the following:
  • the count is a vote
  • the count subject is a voting subject
  • the counting option is a voting option
  • the counting subject is a favorite object
  • the counting option includes at least one or two of praise, step
  • the counting subject is a play object, and the counting option is playing once;
  • the count is a score
  • the count subject is a scoring object
  • the count options include different scores.
  • the counting event definition unit 503 is configured to acquire a corresponding target counting rule, a target counting subject, and a target counting option from the counting database according to the target counting event identifier.
  • the counting rule may include one or more of the following:
  • the regulations on whether or not to log in the restrictions on the IP address, the upper limit on the user count, the limit on the frequency of the user count, the statute of the count, the rule on the count consumption, and the limit on the count area.
  • the specific rule corresponding to the counting rule identifier may be a combination of the above rules.
  • the count event creation unit 504 is configured to generate a target count event according to the target count rule, the target count subject, and the target count option, where the target count event is used according to a target count option sent by the user for the target count subject. Counting rules are counted.
  • the counting event identifier input by the technician is “12345_45678_5050”, and the server can find out from the back-end database that the corresponding voting rule is “votable after login” according to “12345”, and can be found from the background database according to “45678”.
  • the voting theme is "Which favorite show you like this week", according to "5050", you can find the voting option from the background as "(1) Tomb Notes (2) Pretender (3) ⁇ list", so there is After these three items, you can automatically create a count event, that is, create a voting event for "Which favorite show you like this week.” After the user sees the vote on the web page, the voting option can be selected on the web page, thereby completing the action of the target counting option sent to the server.
  • the counting event definition unit 503 may include:
  • the parsing subunit 5031 is configured to parse the target count rule identifier, the target count subject identifier, and the target count option identifier according to a preset rule;
  • the database reading subunit 5032 is configured to obtain a corresponding counting rule, a counting subject, and a counting option from the counting database according to the result of the parsing.
  • the count event input by the developer is identified as "acef_452508_ZCL", where a represents “needs To log in, c means “can only vote once”, e means “do not consume points”, f stands for “restriction on IP”, then “acef” resolves is “requires login, can only vote once, does not consume points "Combined voting rules for IP restrictions”; “Z” stands for “Like”, “C” stands for “Tread”, and “L” stands for "PASS”. Then "ZCL” resolves that the vote has "Like” "Tread” "pass by” three options.
  • the apparatus may further include:
  • the result output unit 505 is configured to output a counting result of the counting event.
  • the back-end database can use redis, use its ordered collection to store the voting result data, and calculate the voting rank of the option in real time. If it belongs to a registered vote (requires user login, and limits the number of single-user voting, such as each user can only vote 1 time), you can use the ordered collection to store user voting behavior data, and calculate user rankings in real time.
  • an embodiment of the present invention further provides a server, where the server includes: the device for generating a counting event according to any one of the foregoing device embodiments.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

本发明提供了一种生成计数事件的方法及装置,其中方法主要包括:将预设的计数规则、计数选项和计数主题存储在计数数据库中;获取目标计数事件标识,包括目标计数规则标识、目标计数主题标识以及目标计数选项标识;根据所述目标计数事件标识从计数数据库中获取对应的目标计数规则、目标计数主题及目标计数选项;生成目标计数事件。投票等本质上就是对一个ID的计数,因此本发明将这个ID以及计数这一套逻辑单独抽象出来,实现"逻辑"与"内容"的剥离,与内容相关的部分(如投票的标题、选项等)另行维护,这样当需要发起一个投票时,无需每次都开发相应的代码;另外适应性强,不但适用于常规的投票,也适用于打分、播放次数统计等变相的投票。

Description

一种生成计数事件的方法及装置
本申请要求于2016年3月14日提交中国专利局、申请号为201610144976.5、发明名称为“一种生成计数事件的方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明实施例涉及网络通信技术领域,尤其涉及一种生成计数事件的方法及装置。
背景技术
随着互联网技术的飞速发展,在网站上或APP(Application,应用软件)中,越来越多的内容都需要用户参与,尤其是希望用户表达自己的看法和意见。不过让用户发表留言或评论的方式较为繁琐,通常更简单的方式是提供简单的交互选项供用户选择,如针对某主题设置投票页面让用户投票,或者在新闻、视频等页面上设置“赞”“踩”及评分等按钮,这样用户只需点击鼠标或点击屏幕即可完成意见的表达。另外在播放视频界面中,也通常会有对该视频被点播次数的统计,这也相当于一种变相的投票。
在现有技术中,当需要创建一个投票时,往往都必须开发相应的代码,且这些代码与系统(如网站或APP)代码耦合性较强,换句话说,投票代码与系统代码结合的较为紧密,完成后再想修改也较为困难,同时,因为投票的场景有很多,除了常规的投票之外,还有上文所提过的点赞、打分、播放次数统计等多种形式的变相的投票,导致开发繁琐,效率不高。
发明内容
为克服现有技术中存在的问题,本发明提供一种生成计数事件的方法及装置,以解决投票等功能在开发时效率较低的技术问题。
根据本发明实施例的第一方面,提供一种生成计数事件的方法,所述方法包括:
将预设的计数规则、计数选项和计数主题存储在计数数据库中,所述计数规则与计数规则标识对应,所述计数选项与计数选项标识对应,所述计数主题与计数主题标识对应,其中,所述计数主题与预订内容关联;
获取目标计数事件标识,所述目标计数事件标识包括目标计数规则标识、目标计数主题标识以及目标计数选项标识;
根据所述目标计数事件标识,从所述计数数据库中获取对应的目标计数规则、目标计数主题及目标计数选项;
根据所述目标计数规则、目标计数主题及目标计数选项,生成目标计数事件,所述目标计数事件用于对用户针对所述目标计数主题发送的目标计数选项按照目标计数规则进行计数。
根据本发明实施例的第二方面,提供一种生成计数事件的装置,所述装置包括:
数据存储单元,用于将预设的计数规则、计数选项和计数主题存储在计数数据库中,所述计数规则与计数规则标识对应,所述计数选项与计数选项标识对应,所述计数主题与计数主题标识对应,其中,所述计数主题与预订内容关联;
计数事件标识获取单元,用于获取目标计数事件标识,所述目标计数事件标识包括目标计数规则标识、目标计数主题标识以及目标计数选项标识;
计数事件定义单元,用于根据所述目标计数事件标识,从所述计数数据库中获取对应的目标计数规则、目标计数主题及目标计数选项;
计数事件创建单元,用于根据所述目标计数规则、目标计数主题及目标计数选项,生成目标计数事件,所述目标计数事件用于对用户针对所述目标计数主题发送的目标计数选项按照目标计数规则进行计数。
根据本发明实施例的第三方面,提供一种服务器;所述服务器包括:以上本发明实施例的第二方面所述的生成计数事件的装置。
本发明的实施例提供的技术方案可以包括以下有益效果:
发明人在实现本发明的过程中发现,投票等本质上就是对一个量或者说是对一个 ID的计数,因此本发明将这个ID以及计数这一套逻辑单独抽象出来,实现“逻辑”与“内容”的剥离,与内容相关的部分(如投票的标题、选项等)另行维护即可,而在本发明中开发人员只需要依照预设规则等生成三种标识,然后将三种标识组合起来得到计数事件标识,输入给系统即可,通过解析该计数事件标识,系统可自动读取投票主题、投票规则等,从而自动创建计数事件。这样当需要发起一个投票时,无需每次都开发相应的代码,提高了开发人员的工作效率;同时本发明这种逻辑与内容剥离的设计适应性强,不但适用于常规的投票,也适用于打分、播放次数统计等变相的投票(因为本质上都是对一个ID的计数),使得开发人员可以方便灵活的创建各种投票。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本发明。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本发明的实施例,并与说明书一起用于解释本发明的原理。
图1是本发明根据一示例性实施例示出的一种生成计数事件的方法的流程图;
图2是本发明根据一示例性实施例示出的一种生成计数事件的方法的流程图;
图3是本发明根据一示例性实施例示出的一种生成计数事件的方法的流程图;
图4是本发明根据一示例性实施例示出的一种生成计数事件的方法的流程图;
图5是本发明根据一示例性实施例示出的一种生成计数事件的装置的示意图;
图6是本发明根据一示例性实施例示出的一种生成计数事件的装置的示意图;
图7是本发明根据一示例性实施例示出的一种生成计数事件的装置的示意图。
具体实施方式
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本发明相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本发明的一些方面相一致的装置和方法的例子。
图1是根据一示例性实施例示出的一种生成计数事件的方法的流程图。该方法例如可以用于服务器等。
参见图1所示,该方法可以包括:
步骤S101,将预设的计数规则、计数选项和计数主题存储在计数数据库中,所述计数规则与计数规则标识对应,所述计数选项与计数选项标识对应,所述计数主题与计数主题标识对应,其中,所述计数主题与预订内容关联。
例如计数主题可以是对一个问题的投票,为了方便使用,该计数主题会对应一个标识,或者说是会为该计数主题赋予一个标识,该标识具体可以是ID(Identification,身份标识码)、编号等。而该投票问题的内容则可以另行存储,并使该内容与该计数主题建立关联。
步骤S102,获取目标计数事件标识,所述目标计数事件标识包括目标计数规则标识、目标计数主题标识以及目标计数选项标识。
例如计数事件标识(也可称为计数事件ID)可以由技术人员负责输入。
作为示例,所述计数可以为以下其中一种:
投票,点赞,播放次数,评分。
当所述计数为投票时,所述计数主题为投票主题,所述计数选项为投票选项;
当所述计数为点赞时,所述计数主题为点赞对象,所述计数选项至少包括赞、踩中的一种或两种;
当所述计数为播放次数时,所述计数主题为播放对象,所述计数选项为播放一次;
当所述计数为评分时,所述计数主题为评分对象,所述计数选项包括不同的分数。
以投票为例,本发明可使投票内容和投票计数功能完全独立,实现解耦。一个投票本质上即为对一个标识(或者说是一个数据量、一个ID)的计数,而投票本身的内容数据(如标题、描述、选项内容等)由调用方维护,在本发明中只需维护投票事 件ID与票数关系即可。
在具体实施时,可以将投票事件ID设计为A_B_C的结构:A为规则ID(即计数规则标识),该ID可以代表多种规则;B为题目ID(即计数主题标识),也可以抽象为专辑ID、视频ID等,可以根据具体投票需求做自由设定;C为选项ID(即计数选项标识),例如可以为投给谁,也可以抽象为赞、踩等。对于ID/标识的具体形式本实施例并不进行限制,例如可以是字母及数字,只要是根据标识可以对应查到该标识所代表的计数规则/计数主题/计数选项即可。
步骤S103,根据所述目标计数事件标识,从所述计数数据库中获取对应的目标计数规则、目标计数主题及目标计数选项。
例如,所述计数规则可以包括以下一种或多种:
对是否需要登录的规定,对IP地址的限制,对用户计数上限的规定,对用户计数频次的限制、对计数时效的规定、对计数消耗积分的规定、对计数地区的限制。
换句话说,计数规则标识所对应的具体规则可以是上述这些规则的各种组合。
步骤S104,根据所述目标计数规则、目标计数主题及目标计数选项,生成目标计数事件,所述目标计数事件用于对用户针对所述目标计数主题发送的目标计数选项按照目标计数规则进行计数。
例如,技术人员输入的计数事件标识为“12345_45678_5050”,服务器根据其中的“12345”可以从后台数据库查到其对应的投票规则为“登录后可投票”,根据“45678”可以从后台数据库查到其投票主题是“本周你最喜欢哪部热播剧”,根据“5050”可以从后台查到其投票选项为“(1)盗墓笔记(2)伪装者(3)琅琊榜”,这样有了这三项后便可以自动创建一个计数事件了,也即创建一个针对“本周你最喜欢哪部热播剧”的投票事件。用户从网页上看到该投票后,可以在网页上对投票选项进行选择,从而完成了向服务器发送的目标计数选项的动作。
参见图2所示,在本实施例或本发明其他某些实施例中,所述所述根据所述目标计数事件标识,从所述计数数据库中获取对应的目标计数规则、目标计数主题及目标计数选项,可以包括:
步骤S201,根据预设规则解析所述目标计数规则标识、所述目标计数主题标识、所述目标计数选项标识。
步骤S202,根据所述解析的结果从所述计数数据库中获取对应的计数规则、计数主题及计数选项。
标识往往是某种符号或符号的组合,比较抽象也比较简练,一个标识代表什么意思,通常需要根据预设规则进行解析后才知晓。对于如何设计各标识以及预设规则的具体内容本实施例并不进行限制,本领域技术人员可以根据不同情况自行进行设计。
举例来讲,开发人员输入的计数事件标识为“acef_452508_ZCL”,其中a代表“需要登录”,c代表“只能投票一次”,e代表“不消耗积分”,f代表“对IP进行限制”,那么“acef”解析出来便是“需要登录,只能投票一次,不消耗积分,且对IP进行限制”的组合投票规则;“Z”代表“赞”,“C”代表“踩”,“L”代表“路过”,那么“ZCL”解析出来便是该投票有“赞”“踩”“路过”三个选项。
此外参见图3所示,在本实施例或本发明其他某些实施例中,所述方法还可以包括:
步骤S301,输出所述计数事件的计数结果。
例如,后台数据库可以采用redis,使用其有序集合来存储投票结果数据,实时计算出选项的投票排行,如果属于记名投票(需要用户登录,并限制单用户投票次数,如每个用户只能投1次),可以使用有序集合储存用户投票行为数据,实时计算出用户排行等。
下面结合具体场景对本发明方案作进一步描述。
图4是根据一示例性实施例示出的一种创建计数信息的方法的流程图。
步骤S401,预先设置投票规则、投票选项。
例如技术人员可以预先设置“登陆、IP限制、投票次数、频次、上限、时效、积分、地区限制”等多种投票规则。
步骤S402,创建投票主题ID、投票规则ID、投票选项ID。
例如各ID可随机生成,或由技术人员任意指定,只要唯一不冲突即可。如投票主题ID可以为“45678”,投票规则ID可以为“12345”,投票选项ID可以为“5050”。
步骤S403,将投票规则ID、投票选项ID分别与一些预设的投票规则、投票选项相绑定,并令投票主题ID与某内容相关联,组合后生成一个投票事件ID。
例如三个ID组合起来得到投票事件ID“12345_45678_5050”,也即计数事件标识。
步骤S404,将投票事件ID输入系统,系统对该投票事件ID进行解析,从而创建一个投票事件。
步骤S405,接收各用户的投票。
该系统可以基于redis数据库,以及PHP(PHP:Hypertext Preprocessor,超文本预处理器)运行环境,安装部署均有开源方案,依赖部署完成后将代码包部署到web文件夹,进行简单配置即可生效使用。
另外为了应对大流量冲击,可以采用异步队列方式,能异步处理100万/秒的投票操作,后台处理消息队列保证数据最终一致性。
步骤S406,实时或定期输出投票结果与排行。
例如可以调用rank接口查看投票排行,调用num接口查看结果。
投票系统投入使用后,截止到目前,运营人员、产品人员的所有投票需求均不需要服务器端进行额外开发;实现了超过10次不同规则组合的运营投票需求。并可以将投票系统用于实现用户点赞、视频(专辑)的赞踩、播放数记录、评分数记录、图文直播点赞等等需求,而不需要服务端做任何开发工作。
另外,本发明实施例还提供一种计算机存储介质,其中,该计算机存储介质可存储有程序,该程序执行时可实现图1至图4所示实施例提供的生成计数事件的方法的各实现方式中的部分或全部步骤。
下述为本发明装置实施例,可以用于执行本发明方法实施例。对于本发明装置实 施例中未披露的细节,请参照本发明方法实施例。
图5是根据一示例性实施例示出的一种生成计数事件的装置的示意图。该装置例如可以用于服务器。
参见图5所示,该装置可以包括:
数据存储单元501,用于将预设的计数规则、计数选项和计数主题存储在计数数据库中,所述计数规则与计数规则标识对应,所述计数选项与计数选项标识对应,所述计数主题与计数主题标识对应,其中,所述计数主题与预订内容关联。
计数事件标识获取单元502,用于获取目标计数事件标识,所述目标计数事件标识包括目标计数规则标识、目标计数主题标识以及目标计数选项标识。
例如计数事件标识(也可称为计数事件ID)可以由技术人员负责输入。
以投票为例,本发明可使投票内容和投票计数功能完全独立,实现解耦。一个投票本质上即为对一个标识(或者说是一个数据量、一个ID)的计数,而投票本身的内容数据(如标题、描述、选项内容等)由调用方维护,在本发明中只需维护投票事件ID与票数关系即可。
在具体实施时,可以将投票事件ID设计为A_B_C的结构:A为规则ID(即计数规则标识),该ID可以代表多种规则;B为题目ID(即计数主题标识),也可以抽象为专辑ID、视频ID等,可以根据具体投票需求做自由设定;C为选项ID(即计数选项标识),例如可以为投给谁,也可以抽象为赞、踩等。对于ID/标识的具体形式本实施例并不进行限制,例如可以是字母及数字,只要是根据标识可以对应查到该标识所代表的计数规则/计数主题/计数选项即可。
作为示例,所述计数可以为以下其中一种:
投票,点赞,播放次数,评分;
当所述计数为投票时,所述计数主题为投票主题,所述计数选项为投票选项;
当所述计数为点赞时,所述计数主题为点赞对象,所述计数选项至少包括赞、踩中的一种或两种;
当所述计数为播放次数时,所述计数主题为播放对象,所述计数选项为播放一次;
当所述计数为评分时,所述计数主题为评分对象,所述计数选项包括不同的分数。
计数事件定义单元503,用于根据所述目标计数事件标识,从所述计数数据库中获取对应的目标计数规则、目标计数主题及目标计数选项。
例如,所述计数规则可以包括以下一种或多种:
对是否需要登录的规定,对IP地址的限制,对用户计数上限的规定,对用户计数频次的限制、对计数时效的规定、对计数消耗积分的规定、对计数地区的限制。
换句话说,计数规则标识所对应的具体规则可以是上述这些规则的组合。
计数事件创建单元504,用于根据所述目标计数规则、目标计数主题及目标计数选项,生成目标计数事件,所述目标计数事件用于对用户针对所述目标计数主题发送的目标计数选项按照目标计数规则进行计数。
例如,技术人员输入的计数事件标识为“12345_45678_5050”,服务器根据其中的“12345”可以从后台数据库查到其对应的投票规则为“登录后可投票”,根据“45678”可以从后台数据库查到其投票主题是“本周你最喜欢哪部热播剧”,根据“5050”可以从后台查到其投票选项为“(1)盗墓笔记(2)伪装者(3)琅琊榜”,这样有了这三项后便可以自动创建一个计数事件了,也即创建一个针对“本周你最喜欢哪部热播剧”的投票事件。用户从网页上看到该投票后,可以在网页上对投票选项进行选择,从而完成了向服务器发送的目标计数选项的动作。
参见图6所示,在本实施例或本发明其他某些实施例中,所述计数事件定义单元503可以包括:
解析子单元5031,用于根据预设规则解析所述目标计数规则标识、所述目标计数主题标识、所述目标计数选项标识;
数据库读取子单元5032,用于根据所述解析的结果从所述计数数据库中获取对应的计数规则、计数主题及计数选项。
举例来讲,开发人员输入的计数事件标识为“acef_452508_ZCL”,其中a代表“需 要登录”,c代表“只能投票一次”,e代表“不消耗积分”,f代表“对IP进行限制”,那么“acef”解析出来便是“需要登录,只能投票一次,不消耗积分,且对IP进行限制”的组合投票规则;“Z”代表“赞”,“C”代表“踩”,“L”代表“路过”。那么“ZCL”解析出来便是该投票有“赞”“踩”“路过”三个选项。
此外参见图7所示,在本实施例或本发明其他某些实施例中,所述装置还可以包括:
结果输出单元505,用于输出所述计数事件的计数结果。
例如,后台数据库可以采用redis,使用其有序集合来存储投票结果数据,实时计算出选项的投票排行,如果属于记名投票(需要用户登录,并限制单用户投票次数,如每个用户只能投1次),可以使用有序集合储存用户投票行为数据,实时计算出用户排行等。
关于上述实施例中的装置,其中各个单元执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。
另外,本发明实施例还提供一种服务器;所述服务器包括:以上任一装置实施例所述的生成计数事件的装置。
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本发明的其它实施方案。本申请旨在涵盖本发明的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本发明的一般性原理并包括本发明未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本发明的真正范围和精神由所附的权利要求指出。
应当理解的是,本发明并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本发明的范围仅由所附的权利要求来限制。

Claims (11)

  1. 一种生成计数事件的方法,其特征在于,所述方法包括:
    将预设的计数规则、计数选项和计数主题存储在计数数据库中,所述计数规则与计数规则标识对应,所述计数选项与计数选项标识对应,所述计数主题与计数主题标识对应,其中,所述计数主题与预订内容关联;
    获取目标计数事件标识,所述目标计数事件标识包括目标计数规则标识、目标计数主题标识以及目标计数选项标识;
    根据所述目标计数事件标识,从所述计数数据库中获取对应的目标计数规则、目标计数主题及目标计数选项;
    根据所述目标计数规则、目标计数主题及目标计数选项,生成目标计数事件,所述目标计数事件用于对用户针对所述目标计数主题发送的目标计数选项按照目标计数规则进行计数。
  2. 根据权利要求1所述的方法,其特征在于,所述根据所述目标计数事件标识,从所述计数数据库中获取对应的目标计数规则、目标计数主题及目标计数选项,包括:
    根据预设规则解析所述目标计数规则标识、所述目标计数主题标识、所述目标计数选项标识;
    根据所述解析的结果从所述计数数据库中获取对应的计数规则、计数主题及计数选项。
  3. 根据权利要求1所述的方法,其特征在于,
    所述计数主题为投票主题,所述计数选项为投票选项;或者,
    所述计数主题为点赞对象,所述计数选项至少包括赞、踩中的一种或两种;或者,
    所述计数主题为播放对象,所述计数选项为播放一次;或者,
    所述计数主题为评分对象,所述计数选项包括不同的分数。
  4. 根据权利要求1所述的方法,其特征在于,所述计数规则包括以下一种或多种:
    对是否需要登录的规定,对IP地址的限制,对用户计数上限的规定,对用户计数频次的限制、对计数时效的规定、对计数消耗积分的规定、对计数地区的限制。
  5. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    输出所述计数事件的计数结果。
  6. 一种生成计数事件的装置,其特征在于,所述装置包括:
    数据存储单元,用于将预设的计数规则、计数选项和计数主题存储在计数数据库中,所述计数规则与计数规则标识对应,所述计数选项与计数选项标识对应,所述计数主题与计数主题标识对应,其中,所述计数主题与预订内容关联;
    计数事件标识获取单元,用于获取目标计数事件标识,所述目标计数事件标识包括目标计数规则标识、目标计数主题标识以及目标计数选项标识;
    计数事件定义单元,用于根据所述目标计数事件标识,从所述计数数据库中获取对应的目标计数规则、目标计数主题及目标计数选项;
    计数事件创建单元,用于根据所述目标计数规则、目标计数主题及目标计数选项,生成目标计数事件,所述目标计数事件用于对用户针对所述目标计数主题发送的目标计数选项按照目标计数规则进行计数。
  7. 根据权利要求6所述的装置,其特征在于,所述计数事件定义单元包括:
    解析子单元,用于根据预设规则解析所述目标计数规则标识、所述目标计数主题标识、所述目标计数选项标识;
    数据库读取子单元,用于根据所述解析的结果从所述计数数据库中获取对应的计数规则、计数主题及计数选项。
  8. 根据权利要求6所述的装置,其特征在于,
    所述计数主题为投票主题,所述计数选项为投票选项;或者,
    所述计数主题为点赞对象,所述计数选项至少包括赞、踩中的一种或两种;或者,
    所述计数主题为播放对象,所述计数选项为播放一次;或者,
    当所述计数为评分时,所述计数主题为评分对象,所述计数选项包括不同的分数。
  9. 根据权利要求6所述的装置,其特征在于,所述计数规则包括以下一种或多种:
    对是否需要登录的规定,对IP地址的限制,对用户计数上限的规定,对用户计数频次的限制、对计数时效的规定、对计数消耗积分的规定、对计数地区的限制。
  10. 根据权利要求6所述的装置,其特征在于,所述装置还包括:
    结果输出单元,用于输出所述计数事件的计数结果。
  11. 一种服务器,其特征在于,包括:如权利要求6至10任一项所述的生成计数事件的装置。
PCT/CN2016/088490 2016-03-14 2016-07-04 一种生成计数事件的方法及装置 Ceased WO2017156927A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US15/242,241 US20170263068A1 (en) 2016-03-14 2016-08-19 Method for generating counting events and electronic device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610144976.5 2016-03-14
CN201610144976.5A CN105824903A (zh) 2016-03-14 2016-03-14 一种生成计数事件的方法及装置

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US15/242,241 Continuation US20170263068A1 (en) 2016-03-14 2016-08-19 Method for generating counting events and electronic device

Publications (1)

Publication Number Publication Date
WO2017156927A1 true WO2017156927A1 (zh) 2017-09-21

Family

ID=56987307

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/088490 Ceased WO2017156927A1 (zh) 2016-03-14 2016-07-04 一种生成计数事件的方法及装置

Country Status (2)

Country Link
CN (1) CN105824903A (zh)
WO (1) WO2017156927A1 (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107038065A (zh) * 2017-03-01 2017-08-11 武汉斗鱼网络科技有限公司 信息处理方法及装置
CN110995781B (zh) * 2019-11-01 2022-01-11 腾讯科技(深圳)有限公司 点赞信息处理方法、装置及系统
CN112579861A (zh) * 2020-12-11 2021-03-30 北京字节跳动网络技术有限公司 一种计数方法及装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104134268A (zh) * 2014-07-18 2014-11-05 小米科技有限责任公司 网络投票方法及装置
US20150100392A1 (en) * 2013-10-09 2015-04-09 TopwHats Inc. Dynamic Ballots for Voting
CN104731585A (zh) * 2015-03-05 2015-06-24 天脉聚源(北京)传媒科技有限公司 一种投票页面的显示方法及装置
CN104899956A (zh) * 2015-04-15 2015-09-09 腾讯科技(深圳)有限公司 实现投票的方法和装置

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101860612A (zh) * 2009-04-08 2010-10-13 北京闻言科技有限公司 一种按周期统计用户点播次数的方法
US8510154B2 (en) * 2011-01-27 2013-08-13 Leroy Robinson Method and system for searching for, and monitoring assessment of, original content creators and the original content thereof
CN103686821B (zh) * 2012-08-27 2016-08-31 上海亿动信息技术有限公司 根据移动终端唯一标识进行应用程序流量统计的控制方法
CN104125313B (zh) * 2014-07-11 2017-12-08 广州华多网络科技有限公司 网络投票方法和装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150100392A1 (en) * 2013-10-09 2015-04-09 TopwHats Inc. Dynamic Ballots for Voting
CN104134268A (zh) * 2014-07-18 2014-11-05 小米科技有限责任公司 网络投票方法及装置
CN104731585A (zh) * 2015-03-05 2015-06-24 天脉聚源(北京)传媒科技有限公司 一种投票页面的显示方法及装置
CN104899956A (zh) * 2015-04-15 2015-09-09 腾讯科技(深圳)有限公司 实现投票的方法和装置

Also Published As

Publication number Publication date
CN105824903A (zh) 2016-08-03

Similar Documents

Publication Publication Date Title
US10999634B2 (en) Media content recommendation method, server, client, and storage medium
US10575037B2 (en) Video recommending method, server, and storage media
CN104255038B (zh) 一种用于补充实况广播的方法及系统
US9424319B2 (en) Social media based content selection system
JP5981024B2 (ja) ソーシャルネットワーキングを介してテレビ番組およびビデオ番組を共有すること
WO2017166644A1 (zh) 一种数据采集方法和系统
CN102708174B (zh) 一种浏览器中的富媒体信息的展示方法和装置
US20150154249A1 (en) Data ingestion module for event detection and increased situational awareness
US9158850B2 (en) Personal trends module
Abel et al. Appropriation of mainstream news: How Saturday Night Live changed the political discussion
JPWO2007148817A1 (ja) コンテンツ推薦システム、コンテンツ推薦方法及びコンテンツ推薦用プログラム
CN112135199B (zh) 基于多类型视频源的视频播放方法及相关设备
US20160255036A1 (en) Association of a social message with a related multimedia flow
CN107172178B (zh) 一种内容发送方法及装置
TWI709905B (zh) 資料分析方法及資料分析系統
WO2017156927A1 (zh) 一种生成计数事件的方法及装置
KR101855479B1 (ko) 빅 데이터 기반 지식 콘텐츠 추천 방법 및 시스템
Pham et al. SURVEYPILOT: an Agentic Framework for Automated Human Opinion Collection from Social Media
CN117121441A (zh) 使用基于图像的有噪声内容的电子消息传送方法
JP2018500696A (ja) ユーザに対して認証を行うための方法及び装置
KR101583238B1 (ko) 선호도를 반영한 컨텐츠 제공 방법
Esteve Del Valle et al. Unpredictably Trump? Predicting clicktivist-like actions on Trump's Facebook posts during the 2016 US primary election
Turcotte-Summers “Recess Is Over, Students”: The Suburban’s Framing of Educational Issues and the 2012 Printemps Érable
Davies Robinson et al. The Cyberseduce Collection: Sex Work Commentary on Major Social Media Platforms.
JP6335022B2 (ja) 特定情報収集装置、投稿情報分析装置、特定情報収集方法、およびプログラム

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

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

Ref document number: 16894089

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 16894089

Country of ref document: EP

Kind code of ref document: A1