WO2016127854A1 - Information processing method and device - Google Patents

Information processing method and device Download PDF

Info

Publication number
WO2016127854A1
WO2016127854A1 PCT/CN2016/073144 CN2016073144W WO2016127854A1 WO 2016127854 A1 WO2016127854 A1 WO 2016127854A1 CN 2016073144 W CN2016073144 W CN 2016073144W WO 2016127854 A1 WO2016127854 A1 WO 2016127854A1
Authority
WO
WIPO (PCT)
Prior art keywords
user
record
detailed
detail record
records
Prior art date
Application number
PCT/CN2016/073144
Other languages
French (fr)
Chinese (zh)
Inventor
于君泽
Original Assignee
阿里巴巴集团控股有限公司
于君泽
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 阿里巴巴集团控股有限公司, 于君泽 filed Critical 阿里巴巴集团控股有限公司
Publication of WO2016127854A1 publication Critical patent/WO2016127854A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/40Network security protocols

Definitions

  • the present application relates to the field of network data processing, and in particular, to an information processing method and device.
  • hot-spot accounts are used to reduce the concurrent access volume of hotspot accounts.
  • a hot account with a hot account of 1 million yuan can be split into 100 sub accounts, and activity information is configured for each sub account to form a sub account.
  • activity information is configured for each sub account to form a sub account.
  • the configuration list refer to the schematic diagram shown in Figure 1.
  • the application server can be triggered to assign a specified activity to the user from 100 activities, and route the user's access to the specified activity, so that the user corresponds to the child corresponding to the specified activity.
  • Red envelopes are collected from the account.
  • the application server routes user A to activity 003, and user A can receive red packets from sub-account 003.
  • the second-level concurrency of the red envelope account is tens of thousands of users, the second-level concurrency of each sub-account can be reduced to hundreds of users.
  • the premise of the implementation of the above solution requires the + operator to make a precise estimation of the business needs and split the red envelope account into a reasonable number of sub-accounts.
  • the second-level concurrency of each sub-account may still be high during the activity, and it is necessary to urgently issue a re-split account instruction to the application server to further split each sub-account. Will inevitably affect the current activities, and In the process of splitting again, not only the activity information configuration, the correctness check of the split account, but also a large amount of data migration is involved. The implementation process is complicated and difficult, and the processing resources of the application server are still consumed.
  • the application processor uses a lock method for the user to modify the hotspot account data, that is, only one user is allowed to read and Modify the data of the hotspot account.
  • the above-mentioned red envelope is used as an example. Whether it is for the 1 million yuan red envelope account before the split or the 10,000 yuan sub-account after the split, when there are multiple users concurrent access, the lock problem will be involved. For example, three users A, B, and C concurrently access the sub-account 003, and the three users are routed to the sub-account 003 by the application server, and the timestamps are sequentially ranked as A, B, and C. Then, the user A reads the sub-account 003.
  • the account balance when receiving the red envelope, will lock the sub-account 003, prohibiting users B and C from reading the account balance of the sub-account 003, and only after the user A receives and modifies the account balance of the sub-account 003, the sub-account 003 is unlocked, allowing Other users read the account balance of sub-account 003.
  • the scheme of splitting the hotspot account can reduce the concurrent access volume of the sub-account to a certain extent, but the locking problem will still severely limit the ability of the application server to respond to concurrent access.
  • the technical problem to be solved by the present application is to provide an information processing method for solving the technical problem that the application server has limited concurrent access capability in a scenario where the second-level concurrency is high.
  • the present application also provides an information processing apparatus for ensuring the implementation and application of the above method in practice.
  • an information processing method including the following steps:
  • the hotspot account includes a detailed record of the preset number of items,
  • the detailed record includes an identifier of the activity, an identifier of the detailed record, a status of the detailed record, and a target parameter;
  • the present application also discloses an information processing apparatus, the apparatus comprising:
  • a generating unit configured to generate a hotspot account corresponding to the activity, where the hotspot account includes a preset number of detailed records, where the detailed record includes an identifier of the activity, an identifier of the detailed record, a status of the detailed record, and Subject parameter
  • a searching unit configured to search for a corresponding current detail record for each user from the hotspot account in response to an access request sent by the user for the activity, where the status of the current detail record is idle;
  • an allocating unit configured to allocate the current detailed record found by the searching unit to a corresponding user, and update the status of the current detailed record to occupy.
  • the present application includes the following advantages:
  • the application does not need to perform account splitting, activity information configuration, and sub-account correctness check as in the prior art, and only needs to generate a detailed record with no difference in the preset bar, and the generation process is simple and easy to implement, and can be solved.
  • the prior art is a technical problem of a large amount of consumption of application server processing resources caused by reducing the second-level concurrency of hotspot accounts.
  • the present application converts the behavior of processing the user's parallel access request into a process of matching the detailed record, and does not need to modify the account data in real time, thereby ensuring the thread security of concurrent access and helping to improve the application server. The ability to respond to concurrent access.
  • FIG. 1 is a schematic diagram of a sub-account configuration list in the prior art
  • Embodiment 1 is a flowchart of Embodiment 1 of an information processing method of the present application
  • FIG. 3 is a schematic diagram of a detailed record in the present application.
  • FIG. 4 is another schematic diagram of the detailed record in the present application.
  • Embodiment 2 is a flowchart of Embodiment 2 of an information processing method of the present application.
  • Fig. 6 is a block diagram showing the structure of an information processing apparatus of the present application.
  • Embodiment 1 of the information processing method of the present application is shown, which may include the following steps:
  • Step 101 Generate a hotspot account corresponding to the activity, where the hotspot account includes a preset number of detail records, where the detailed record includes an identifier of the activity, an identifier of the detailed record, a status of the detailed record, and a target object parameter.
  • a detailed record with no difference in the preset bar may be generated according to the activity requirement, and the detailed record may include an activity identifier, a detailed record identifier, a detailed record status, and a target parameter.
  • the activity identifier may be an activity name and/or an activity ID
  • the detail record identifier may be a detail record name and/or a detail record ID
  • the detail record status may be idle or occupied, wherein if the detail record is assigned to the user, The state is occupied, otherwise the state is idle, usually the initial state of the detail record is idle
  • the target parameter can be the number of objects, usually for different activities, the object parameters can be expressed in different forms, for example, if The activity is to grab the red envelope.
  • the target parameter can be the red envelope amount, for example, 5 yuan, 10 yuan, etc.; if the activity is to grab the goods, the target parameter can be the quantity of the goods purchased. If the goods are mobile phones, the target parameter can be 1 set. , 2 sets, etc.
  • the specific expression form of the information included in the detailed record may not be specifically limited in the embodiment of the present application.
  • the detailed record can be embodied as the schematic shown in FIG.
  • the application server can set the target parameters according to the default configuration, or The application server can set the target parameter according to the manual configuration of the operator.
  • the embodiment of the present application does not specifically limit this.
  • the application server does not set the target parameter in real time according to the information input by the client user.
  • the application server can set the red envelope amount of all the detailed records to 5 yuan, or the red envelope amount of all the detailed records can be set to 10 yuan; or, the red envelope amount of a part of the detailed records can be set to 5 yuan.
  • Set the red envelope amount of another part of the detailed record to 10 yuan; however, usually the application server does not respond to the client user in real time, and sets the red envelope amount according to the value entered by the user.
  • the identifier of the activity is used to indicate which specific activity the detail record corresponds to.
  • the application server may further verify the application by using the identifier of the activity.
  • the accuracy of server routing As an example, if the accuracy of the routing is not high, or only the only activity is currently performed, the identification of the activity may not be included in the detailed record.
  • the activity record is included in the detailed record. The logo is optimal.
  • the detailed record of generating a preset bar without difference in the embodiment of the present application means that no distinction is made between each detailed record, and the detailed record can be allocated to the user as long as the detailed record is in an idle state.
  • the generation factor may be set randomly, or the generation factor may be set according to the experience of other related activities. Further, the generation factor may be set according to the historical data of the previous year of the activity, which may be specifically limited in this embodiment of the present application. .
  • the embodiment of the present application does not need an application server to perform account splitting, and does not need to perform activity information configuration for each sub-account, and does not need to perform correctness check between each sub-account. It is only necessary to generate a detailed record with no difference in the preset bar.
  • the generation process is simple and easy to implement, and the processing resources of the application server can be saved. In this way, the technical problem that the prior art reduces the amount of concurrent concurrency of the hotspot account and consumes a large amount of application server processing resources is solved.
  • Step 102 in response to an access request sent by the user for the activity, from the hotspot account In the household, each user is searched for a corresponding current detail record, and the status of the current detail record is idle.
  • Step 101 is mainly directed to the account configuration phase before the activity starts. Once the account configuration is completed, after the activity is started, the application server can directly perform step 102 to respond to the user's access request.
  • the client user can view the activity page, and can send an access request to the application server by clicking or touching.
  • the application server can receive the access request sent by the user, and can perform information processing according to the solution in the embodiment of the present application.
  • the activity page can display a 5 yuan red envelope collection button and a 10 yuan red envelope collection button.
  • user A clicks the 10 yuan red envelope collection button an access request is sent to the application server, and the access request is used to indicate User A requests to receive a $10 red envelope for the Double 11 event.
  • the application server may first authenticate the identity of the user A, the behavior of the user A to receive the red envelope, and the amount of the user A requesting to receive the red envelope. After the authentication is passed, the application server follows the application. Apply the embodiment scheme for information processing.
  • the information processing process of the application server may be implemented as: determining a hotspot account corresponding to the activity that the user participates in, and searching for a detailed record of the idle state for each user from the hotspot account, as The current detail record assigned to the user.
  • the application server may determine a current detail record for the user from all the detail records in which the hotspot account is in an idle state.
  • the application server may randomly determine the current detailed record from all the detailed records in the idle state. For example, the detailed records with IDs of 10 to 20 are all idle, and the application server may randomly record the detailed records with the ID of 12. Determined as the current detail record.
  • the application server may determine, in all the detailed records in the idle state, the detailed records with the largest ID or the smallest ID as the current detailed records. For example, the detailed records with the IDs of 10 to 20 are in the idle state, and the application server may set the minimum ID. A detailed record of 10 is determined as the current detail record.
  • the application server may determine, according to the preset matching rule, a current detailed record matching the user ID from all the detailed records in the idle state, for example, the user ID is 123456, and the detailed records with IDs of 10-20 are in the Idle state, if the matching rule is the detail record ID
  • the last bit is the same as the last digit of the user ID, and the application server can determine the detail record with ID 16 as the current detail record.
  • the embodiment of the present application determines the manner of the current detailed record, the specific implementation means of each mode, and the like, which are not limited by the application server.
  • the application server may determine at least one current content for each user from all the detailed records of the hotspot account in an idle state in at least three ways as described below.
  • Detailed record Here are three explanations for the application server to determine the current detail record. For details, please refer to the following.
  • Step 103 Assign the current detailed record to the corresponding user, and update the status of the current detailed record to occupy.
  • the application server can assign a corresponding current detail record to each user. It can be understood that assigning the current detailed record to the corresponding user refers to establishing a correspondence between the current detailed record and the corresponding user.
  • the detailed records 10, 11, 12 are sequentially assigned to the users A, B, and C. If the detailed records 10, 11, 12 are represented as shown in FIG. 3, step 103 assigns the current detailed records to the corresponding user representations. User A receives a red envelope of 5 yuan, user B receives a red envelope of 5 yuan, and user C receives a red envelope of 10 yuan. If the detailed records 10, 11, and 12 appear as shown in FIG. 4, step 103 assigns the current detailed record to the corresponding one. The user indicated that users A, B and C snapped up one mobile phone respectively.
  • each detailed record can be uniquely assigned to only one user. Therefore, after establishing the correspondence between the current detailed record and the corresponding user, the status of the current detailed record can be updated, and the idle status is changed to the occupied status. To indicate that the detail record has been assigned to the user.
  • the embodiment of the present application converts the behavior of the user to receive the red envelope or snapped up the product into a matching detailed record processing process, and does not need to modify the account balance or the number of remaining commodities in real time, thereby ensuring the thread safety of concurrent access and helping. Improve the ability of the application server to respond to concurrent access.
  • the application server determines three ways of the current detail record, which are explained below.
  • the application server may determine the current detail record in the following manner: obtain the detailed record identifier assigned to each user by the cache server, and the identifier is the cache server according to each user.
  • the timestamps of the sending access requests are sorted and assigned according to the self-incrementing design; according to the identifiers, each user is searched for a corresponding current detailed record.
  • the embodiment of the present application may allocate a detailed record identifier to each user according to the order of the timestamps of the access request sent by the user through the cache server.
  • the identifier of the detail record can be embodied as a detail record ID.
  • the current value of a detail record ID can be maintained in the distributed cache server.
  • the cache server can assign a corresponding detail record ID to each user.
  • the cache server can assign each user a corresponding detail record ID through redis' incr operation: redis->incr('preRecordNum_activity001').
  • redis->incr redis->incr('preRecordNum_activity001').
  • the value of the self-incremental variable is set to 1.
  • the value of the self-incrementing variable may be set as needed, and the embodiment of the present application may not specifically limit this.
  • the cache server allocates a detailed record ID of 10 for user A, and a detailed record ID of 11 for user B, and the application server can establish a correspondence between user A and a detailed record with ID 10 according to the The correspondence between the user B and the detailed record with the ID of 11 is established.
  • the user A can receive a red envelope of 5 yuan
  • the user B can receive a red envelope of 5 yuan.
  • the application server can determine the current detail record as follows: Send access based on each user The timestamps of the requests are sorted, and each user is searched for a corresponding current detail record in order from all the detailed records in which the hotspot account is in an idle state.
  • the embodiment of the present application may sequentially assign a corresponding current detailed record to each user according to the order of the timestamps of the access requests sent by the user. For example, the detailed records with IDs of 10 to 20 are in idle state. Users A and B concurrently access, and user A arrives with respect to B first.
  • the application server can be random, from all the detailed records in the idle state, in order. Users A and B each determine a current detail record. For example, the ID of the current detail record determined for user A is 10, and the ID of the current detail record determined for user B is 12.
  • the application server may sort according to the size of the detail record ID, and sequentially determine a current detail record for each of the users A and B.
  • the detail records are arranged in ascending order of the ID, and the ID of the current detail record determined for the user A is 10, which is the user.
  • the ID of the current detail record determined by B is 11; or, the detailed records are arranged in descending order of ID, the ID of the current detail record determined for user A is 20, and the ID of the current detail record determined for user B is 19.
  • the implementation manner 2 can also cooperate with the implementation manner 1 to determine a corresponding current detailed record for the user, which can be embodied by: the application server can first use the implementation manner 1 to determine the current detailed record for the user by using the cache server. When the cache server is faulty, the second implementation mode is used to determine the current detail record for the user. For example, the application server can determine whether the cache server is faulty by monitoring the heartbeat of the cache server.
  • the application server may determine the current detail record in the following manner: obtaining a detailed record of the specified number of pieces from all the detailed records in which the hotspot account is in an idle state; using the identification of each user, the detailed record from the specified number of pieces In the middle, a corresponding current detail record is determined for each user.
  • the embodiment of the present application may first capture the detailed records of the specified number from all the detailed records in the idle state, and then combine the user IDs according to the A certain matching rule determines a corresponding current detail record for each user from the specified number of detailed records. For example, if the number of specified records is 10 and the ID records with IDs from 001 to 100 are idle, the application server captures the details. The ID of the fine record is 001 to 010. If the ID of user A is 123456 and the ID of user B is 654321, the matching rule is: based on the specified digit of the user ID, the current detail record corresponding to the user is determined in the captured detail record. The location in .
  • the current detail record corresponding to the user A in the captured detail record is 5, that is, the detail record with the ID 005; the current detail record corresponding to the user B.
  • the position in the captured detail record is 2, that is, the detail record with ID 002.
  • multiple matching rules may be set in sequence. If the current matching rule cannot be used to determine the detailed record for the user, the next matching rule may be used to perform detailed record matching until the user is determined to correspond. Current detail record. Alternatively, if a plurality of detailed records are determined for the user by using the current matching rule, the current detailed record may be randomly determined from the determined plurality of detailed records, or the corresponding current detailed record may be determined for the user in combination with other matching rules. This embodiment of the present application may not specifically limit this, as long as a current detailed record is determined for each user.
  • the matching rule in the embodiment of the present application may be: matching the specified bit of the user ID and the detailed record ID, so that the two are the same or have a preset corresponding relationship, which may be specifically limited in this application.
  • Embodiment 2 of the information processing method of the present application is shown, which may include the following steps:
  • Step 201 Generate a hotspot account corresponding to the activity, where the hotspot account includes a preset number of detailed records, where the detailed record includes an identifier of the activity, an identifier of the detailed record, a status of the detailed record, and a subject matter parameter.
  • step 201 For the implementation process of step 201, refer to step 101 shown in FIG. 2 above, and details are not described herein again.
  • Step 202 Determine, according to the access request sent by the user for the activity, whether the number of the detailed records of the hotspot account in an idle state is lower than a preset value, and if no, perform step 203.
  • the embodiment of the present application is directed to a scenario in which the number of concurrent transmissions is very high.
  • the application server allocates a corresponding number for each user.
  • the preset value may be a preset specified value. For example, if the specified value is 100, that is, when the number of the detailed records of the hotspot account in the idle state is greater than 100, the execution may determine the current details for the user. The steps of recording.
  • the preset value may be a preset ratio, for example, the ratio is 20%, that is, when the number of the detailed records of the hotspot account in the idle state is greater than 20% of the preset number, the execution may be continued to determine the current for the user.
  • the preset value may be the number of concurrently accessed users. For example, the number of concurrently accessed users is 100. That is, when the number of detailed records of the hotspot account in the idle state is greater than 100, the current detailed record may be determined for the user. A step of.
  • Step 203 Find, from the hotspot account, a corresponding current detail record for each user, where the status of the current detail record is idle.
  • Step 204 Assign the current detailed record to the corresponding user, and update the status of the current detailed record to occupy.
  • the hotspot account further includes a pre-allocated number and/or an unallocated number, and when it is determined in step 202 that the number of the detailed records of the hotspot account in the idle state is lower than a preset value, the application server may further perform the following steps: determining the location Whether the unallocated number is greater than zero, and if so, generating a new detailed record by using the unallocated number, and performing the searching for a corresponding current detailed record for each user.
  • the pre-allocation number refers to the sum of the object parameters of the predetermined number of detailed records
  • the unallocated number refers to the difference between the total number of allocations and the pre-allocated number.
  • the total redemption activity is 1 million yuan
  • the generation factor is 0.8
  • the red envelope amount is 5 yuan.
  • the server may first determine the current detailed record for the user from the remaining detailed records (ie, the detailed records in the idle state of the predetermined number of detailed records), and determine the current detailed record for the user from the new detailed record when insufficient. .
  • the application server may first determine the current detail record for the user from the new detail record, and then determine the current detail record for the user from the remaining detail records when insufficient.
  • the application server may not distinguish between the remaining detail records and the new detail records, and directly determine the current detail records for the user.
  • the application server may also determine whether the pre-allocated number is less than the total allocation number, and if yes, generate a new detailed record by using the unallocated number, and then perform the method to find a corresponding current for each user.
  • Detailed record For the specific process, refer to the scheme introduced above for the unallocated number, and details are not described herein again.
  • the application server may also calculate the number of detailed records in the idle state and the number of users concurrently accessed. The difference is sorted according to the timestamp of the concurrent access user sending the access request, and the activity end page is directly fed back to the user who matches the difference and is sorted backward (ie, the user who is not assigned the detailed record). For example, the remaining three records in the red envelope account are in the idle state.
  • five users concurrently send access requests to the application server, and the five users are sorted by timestamps in order of 1, 2, 3, 4, and 5.
  • the application server can respectively assign a current detail record to users 1, 2 and 3, that is, users 1, 2 and 3 respectively receive a red envelope, and at the same time, the application server can also return red packets to users 4 and 5. End page. In this way, the time for the application server to respond to users 4 and 5 can be shortened, and the user experience of users 4 and 5 can be improved.
  • the embodiment of the present application may further include a settlement step after the activity ends.
  • the settlement step refers to calculating the red envelope balance
  • the settlement step refers to calculating the number of remaining products.
  • the embodiment of the present application provides the following two settlement implementation manners:
  • the present application further provides an embodiment 1 of an information processing apparatus.
  • the apparatus may include:
  • the generating unit 301 is configured to generate a hotspot account corresponding to the activity, where the hotspot account includes a preset number of detailed records, where the detailed record includes an identifier of the activity, an identifier of the detailed record, and a status of the detailed record And target parameters;
  • the searching unit 302 is configured to, according to the access request sent by the user for the activity, search for a corresponding current detail record for each user from the hotspot account, where the status of the current detail record is idle;
  • the allocating unit 303 is configured to allocate the current detailed record found by the searching unit to the corresponding user, and update the status of the current detailed record to occupy.
  • the locating unit can determine a corresponding current detail record for each user according to the solution introduced in the method embodiment, and details are not described herein again.
  • the searching unit in the embodiment of the present application may be embodied in the following three implementation manners:
  • the searching unit includes:
  • a first obtaining unit configured to obtain a detailed record identifier allocated by the cache server for each user, where the identifier is sorted according to a timestamp of each user sending an access request, and is allocated according to an auto-increment design;
  • the first search subunit is configured to find, for each user, a corresponding current detail record according to the identifier.
  • the searching unit includes:
  • the second search sub-unit is configured to sort the timestamps of the access requests sent by each user, and sequentially search for a corresponding current detailed record for each user from all the detailed records in which the hotspot account is in an idle state.
  • the searching unit includes:
  • a second obtaining unit configured to obtain a detailed record of the specified number of pieces from all the detailed records in which the hotspot account is in an idle state
  • a third search subunit configured to determine, by using the identity of each user, a corresponding current detail record for each user from the specified record of the specified number of records.
  • the device further includes:
  • a first determining unit configured to determine, before the searching unit searches for the current detailed record, whether the number of detailed records in which the hotspot account is in an idle state is lower than a preset value, and if not, notifying the searching unit to search The current detail record.
  • the hotspot account further includes a pre-allocated number and/or an unallocated number
  • the pre-allocated number is the And the unassigned number is the difference between the total number of allocations and the pre-allocated number
  • the device further includes:
  • a second determining unit configured to determine, when the number of the detailed records in which the hotspot account is in an idle state, is lower than the preset value, whether the unallocated number is greater than zero, and if yes, generate the unallocated number a new detail record, and notifying the lookup unit to find the current detail record;
  • a third determining unit configured to determine, when the number of the detailed records of the hotspot account in an idle state is lower than the preset value, whether the pre-allocated number is less than the total allocation number, and if yes, using the The unassigned number generates a new detail record and notifies the lookup unit to look up the current detail record.
  • the application also provides a smart device, the aforementioned information processing device is integrated on the processor of the smart device.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

Provided are an information processing method and device, the method comprising: generating a hot-spot account that corresponds to an activity, wherein the hot-spot account comprises a pre-set number of detail records, the detail records comprising an identifier of the activity, the identifiers of the detail records, the states of the detail records and a subject matter parameter; in response to an access request sent by a user with regard to the activity, searching for a corresponding current detail record for each user from the hot-spot account, wherein the state of the current detail record is idle; and allocating the current detail record to the corresponding user, and updating the state of the current detail record to be occupied. In this way, the technical problem in the prior art that the capability of an application server processing concurrent accesses is limited in a scenario of very high millisecond concurrent amount can be solved.

Description

一种信息处理方法及装置Information processing method and device 技术领域Technical field
本申请涉及网络数据处理领域,特别涉及一种信息处理方法及装+置。The present application relates to the field of network data processing, and in particular, to an information processing method and device.
背景技术Background technique
随着信息技术的飞速发展,以电子及电子技术为手段的数字化电子方式的交互越来越普及。交互过程中,可能存在海量用户并发访问同一应用账户的情况,致使被访问账户成为热点账户,如果不能降低并发访问量,则会降低应用对用户访问的响应速度,甚至出现无法响应用户访问的情况,影响用户的访问体验。+With the rapid development of information technology, the interaction of digital electronic means using electronic and electronic technology has become more and more popular. During the interaction process, there may be a situation in which a large number of users concurrently access the same application account, causing the accessed account to become a hotspot account. If the concurrent access volume cannot be reduced, the response speed of the application to the user access may be reduced, and even the case where the user cannot respond may be encountered. , affecting the user's access experience. +
目前,大多通过拆分热点账户的方式,来降低热点账户的并发访问量。举例来说,以营销类业务中发放红包的场景为例,热点账户为100万元的红包账户,可以将热点账户拆分为100个子账户,并对每个子账户进行活动信息配置,形成子账户配置列表,具体可参见图1所示示意图。当客户端用户通过应用页面领取红包时,应用服务器可被触发,从100个活动中为该用户分配一个指定活动,并将用户的访问路由到该指定活动,使用户从该指定活动对应的子账户中领取红包。举例来说,应用服务器将用户A路由到活动003,用户A则可从子账户003中领取红包。At present, most of the hot-spot accounts are used to reduce the concurrent access volume of hotspot accounts. For example, in the case of a red envelope in a marketing business, a hot account with a hot account of 1 million yuan can be split into 100 sub accounts, and activity information is configured for each sub account to form a sub account. For the configuration list, refer to the schematic diagram shown in Figure 1. When the client user receives the red envelope through the application page, the application server can be triggered to assign a specified activity to the user from 100 activities, and route the user's access to the specified activity, so that the user corresponds to the child corresponding to the specified activity. Red envelopes are collected from the account. For example, the application server routes user A to activity 003, and user A can receive red packets from sub-account 003.
上述方案中,如果红包账户的秒级并发量为数万用户,各子账户的秒级并发量则可降低至数百用户。但是,上述方案实现的前提,需要+操作人员对业务需求做精准预估,并将红包账户拆分为合理个数的子账户。In the above solution, if the second-level concurrency of the red envelope account is tens of thousands of users, the second-level concurrency of each sub-account can be reduced to hundreds of users. However, the premise of the implementation of the above solution requires the + operator to make a precise estimation of the business needs and split the red envelope account into a reasonable number of sub-accounts.
如果拆分的子账户个数较多,会增加活动信息配置的成本,而且在诸多子账户之间进行正确性检查还会加大配置复杂度,消耗应用服务器的处理资源。If the number of split sub-accounts is large, the cost of the activity information configuration will be increased, and the correctness check between the plurality of sub-accounts will increase the configuration complexity and consume the processing resources of the application server.
如果拆分的子账户个数较少,可能在活动进行过程中,各子账户的秒级并发量仍很高,需要紧急向应用服务器发布再次拆分账户指令,进一步拆分各个子账户,如此,势必会对当前进行的活动造成影响,而且 再次拆分过程中,不仅会涉及活动信息配置、拆分账户正确性检查,还会涉及大量的数据迁移,实现过程复杂、难度大,仍会消耗应用服务器的处理资源。If the number of split sub-accounts is small, the second-level concurrency of each sub-account may still be high during the activity, and it is necessary to urgently issue a re-split account instruction to the application server to further split each sub-account. Will inevitably affect the current activities, and In the process of splitting again, not only the activity information configuration, the correctness check of the split account, but also a large amount of data migration is involved. The implementation process is complicated and difficult, and the processing resources of the application server are still consumed.
另外,上述拆分热点账户的方案中,为了保证并发访问的线程安全,应用处理器会对用户修改热点账户数据的行为采用加锁方式处理,也就是说,单次只允许一个用户读取并修改热点账户的数据。In addition, in the above scheme for splitting hotspot accounts, in order to ensure the thread security of concurrent access, the application processor uses a lock method for the user to modify the hotspot account data, that is, only one user is allowed to read and Modify the data of the hotspot account.
仍以上述发放红包的场景为例,无论是针对拆分前的100万元红包账户,还是针对拆分后的1万元子账户,当出现多用户并发访问时,都会涉及加锁问题。如,A、B、C三个用户并发访问子账户003,且三个用户被应用服务器路由到子账户003的时间戳排序依次为A、B、C,则,在用户A读取子账户003的账户余额,领取红包时,会锁定子账户003,禁止用户B和C读取子账户003的账户余额,只有用户A领取并修改子账户003的账户余额后,才会解锁子账户003,允许其它用户读取子账户003的账户余额。For example, the above-mentioned red envelope is used as an example. Whether it is for the 1 million yuan red envelope account before the split or the 10,000 yuan sub-account after the split, when there are multiple users concurrent access, the lock problem will be involved. For example, three users A, B, and C concurrently access the sub-account 003, and the three users are routed to the sub-account 003 by the application server, and the timestamps are sequentially ranked as A, B, and C. Then, the user A reads the sub-account 003. The account balance, when receiving the red envelope, will lock the sub-account 003, prohibiting users B and C from reading the account balance of the sub-account 003, and only after the user A receives and modifies the account balance of the sub-account 003, the sub-account 003 is unlocked, allowing Other users read the account balance of sub-account 003.
上述仅是以三个用户并发访问时的加锁处理为例,做的简单介绍,在实际应用中,秒级并发量可能为数万用户,如果应用服务器不能及时处理掉或释放掉这些用户的并发访问,随着负载量不断提升,应用服务器很可能会被拖垮。The above is only a case of locking processing when three users concurrently access, for a brief introduction. In practical applications, the number of concurrent concurrency may be tens of thousands of users. If the application server cannot process or release these users in time, Concurrent access, as the workload continues to increase, the application server is likely to be dragged.
综上,拆分热点账户的方案,虽能在一定程度上降低子账户的并发访问量,但加锁问题仍会严重限制应用服务器响应并发访问的能力。In summary, the scheme of splitting the hotspot account can reduce the concurrent access volume of the sub-account to a certain extent, but the locking problem will still severely limit the ability of the application server to respond to concurrent access.
发明内容Summary of the invention
本申请所要解决的技术问题是提供一种信息处理方法,用以解决现有技术在秒级并发量很高场景下,应用服务器处理并发访问能力受限的技术问题。The technical problem to be solved by the present application is to provide an information processing method for solving the technical problem that the application server has limited concurrent access capability in a scenario where the second-level concurrency is high.
本申请还提供了一种信息处理装置,用以保证上述方法在实际中的实现及应用。The present application also provides an information processing apparatus for ensuring the implementation and application of the above method in practice.
为了解决上述问题,本申请公开了一种信息处理方法,包括如下步骤:In order to solve the above problem, the present application discloses an information processing method, including the following steps:
生成活动对应的热点账户,所述热点账户包括预设条数的明细记录, 所述明细记录包括所述活动的标识、所述明细记录的标识、所述明细记录的状态和标的物参数;Generating a hotspot account corresponding to the activity, where the hotspot account includes a detailed record of the preset number of items, The detailed record includes an identifier of the activity, an identifier of the detailed record, a status of the detailed record, and a target parameter;
响应于用户针对所述活动发送的访问请求,从所述热点账户中,为每个用户查找一条对应的当前明细记录,所述当前明细记录的状态为空闲;Responding to an access request sent by the user for the activity, searching for a corresponding current detail record for each user from the hotspot account, the status of the current detail record is idle;
将所述当前明细记录分配给对应的用户,并更新所述当前明细记录的状态为占用。Assigning the current detail record to the corresponding user, and updating the status of the current detail record to occupy.
相应地,本申请还公开了一种信息处理装置,该装置包括:Correspondingly, the present application also discloses an information processing apparatus, the apparatus comprising:
生成单元,用于生成活动对应的热点账户,所述热点账户包括预设条数的明细记录,所述明细记录包括所述活动的标识、所述明细记录的标识、所述明细记录的状态和标的物参数;a generating unit, configured to generate a hotspot account corresponding to the activity, where the hotspot account includes a preset number of detailed records, where the detailed record includes an identifier of the activity, an identifier of the detailed record, a status of the detailed record, and Subject parameter
查找单元,用于响应于用户针对所述活动发送的访问请求,从所述热点账户中,为每个用户查找一条对应的当前明细记录,所述当前明细记录的状态为空闲;a searching unit, configured to search for a corresponding current detail record for each user from the hotspot account in response to an access request sent by the user for the activity, where the status of the current detail record is idle;
分配单元,用于将所述查找单元查到的所述当前明细记录分配给对应的用户,并更新所述当前明细记录的状态为占用。And an allocating unit, configured to allocate the current detailed record found by the searching unit to a corresponding user, and update the status of the current detailed record to occupy.
与现有技术相比,本申请包括以下优点:Compared with the prior art, the present application includes the following advantages:
本申请在账户配置阶段,不需要如现有技术进行账户拆分、活动信息配置、子账户正确性检查,只需要生成预设条无差异的明细记录即可,生成过程简单易于实现,可解决现有技术为降低热点账户的秒级并发量而导致的大量消耗应用服务器处理资源的技术问题。In the account configuration phase, the application does not need to perform account splitting, activity information configuration, and sub-account correctness check as in the prior art, and only needs to generate a detailed record with no difference in the preset bar, and the generation process is simple and easy to implement, and can be solved. The prior art is a technical problem of a large amount of consumption of application server processing resources caused by reducing the second-level concurrency of hotspot accounts.
另外,本申请在活动进行阶段,将处理用户并行访问请求的行为,转换为匹配明细记录的处理过程,不需要实时修改账户数据,既可保证并发访问的线程安全,又有助于提高应用服务器响应并发访问的能力。In addition, in the activity stage, the present application converts the behavior of processing the user's parallel access request into a process of matching the detailed record, and does not need to modify the account data in real time, thereby ensuring the thread security of concurrent access and helping to improve the application server. The ability to respond to concurrent access.
附图说明DRAWINGS
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings used in the description of the embodiments will be briefly described below. It is obvious that the drawings in the following description are only some embodiments of the present application. Other drawings may also be obtained from those of ordinary skill in the art in view of the drawings.
图1是现有技术中子账户配置列表的示意图; 1 is a schematic diagram of a sub-account configuration list in the prior art;
图2是本申请信息处理方法实施例1的流程图;2 is a flowchart of Embodiment 1 of an information processing method of the present application;
图3是本申请中明细记录的一种示意图;Figure 3 is a schematic diagram of a detailed record in the present application;
图4是本申请中明细记录的另一种示意图;Figure 4 is another schematic diagram of the detailed record in the present application;
图5是本申请信息处理方法实施例2的流程图;5 is a flowchart of Embodiment 2 of an information processing method of the present application;
图6是本申请信息处理装置的结构框图。Fig. 6 is a block diagram showing the structure of an information processing apparatus of the present application.
具体实施方式detailed description
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application are clearly and completely described in the following with reference to the drawings in the embodiments of the present application. It is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present application without departing from the inventive scope are the scope of the present application.
参考图2,示出了本申请信息处理方法实施例1的流程图,可以包括以下步骤:Referring to FIG. 2, a flowchart of Embodiment 1 of the information processing method of the present application is shown, which may include the following steps:
步骤101,生成活动对应的热点账户,所述热点账户包括预设条数的明细记录,所述明细记录包括所述活动的标识、所述明细记录的标识、所述明细记录的状态和标的物参数。Step 101: Generate a hotspot account corresponding to the activity, where the hotspot account includes a preset number of detail records, where the detailed record includes an identifier of the activity, an identifier of the detailed record, a status of the detailed record, and a target object parameter.
本申请实施例方案,可以根据活动需要,生成预设条无差异的明细记录,明细记录可以包括活动标识、明细记录标识、明细记录状态和标的物参数。具体地,活动标识可以为活动名称和/或活动ID;明细记录标识可以为明细记录名称和/或明细记录ID;明细记录状态可以为空闲或占用,其中,如果明细记录已分配给用户,则状态表现为占用,否则状态表现为空闲,通常明细记录的初始状态为空闲状态;标的物参数可以为标的物的数量,通常针对不同活动,标的物参数可表现为不同形式,举例来说,如果活动为抢红包,标的物参数可以为红包金额,如,5元、10元等等;如果活动为抢商品,标的物参数可以为商品限购数量,如果商品为手机,标的物参数可以为1台、2台等等。在实际应用中,本申请实施例对明细记录包括的各项信息的具体表现形式可不做具体限定。作为一种示例,明细记录可体现为图3所示示意图。In the solution of the embodiment of the present application, a detailed record with no difference in the preset bar may be generated according to the activity requirement, and the detailed record may include an activity identifier, a detailed record identifier, a detailed record status, and a target parameter. Specifically, the activity identifier may be an activity name and/or an activity ID; the detail record identifier may be a detail record name and/or a detail record ID; the detail record status may be idle or occupied, wherein if the detail record is assigned to the user, The state is occupied, otherwise the state is idle, usually the initial state of the detail record is idle; the target parameter can be the number of objects, usually for different activities, the object parameters can be expressed in different forms, for example, if The activity is to grab the red envelope. The target parameter can be the red envelope amount, for example, 5 yuan, 10 yuan, etc.; if the activity is to grab the goods, the target parameter can be the quantity of the goods purchased. If the goods are mobile phones, the target parameter can be 1 set. , 2 sets, etc. In a practical application, the specific expression form of the information included in the detailed record may not be specifically limited in the embodiment of the present application. As an example, the detailed record can be embodied as the schematic shown in FIG.
需要说明的是,应用服务器可以根据默认配置来设置标的物参数,或 者,应用服务器可以根据操作人员的手动配置来设置标的物参数,本申请实施例对此可不做具体限定,通常应用服务器不会根据客户端用户输入的信息实时设置标的物参数。举例来说,应用服务器可以将所有明细记录的红包金额设置为5元,或者,可以将所有明细记录的红包金额设置为10元;或者,还可以将一部分明细记录的红包金额设置为5元,将另一部分明细记录的红包金额设置为10元;但是,通常应用服务器不会实时响应客户端用户,按照用户输入的数值设置红包金额。It should be noted that the application server can set the target parameters according to the default configuration, or The application server can set the target parameter according to the manual configuration of the operator. The embodiment of the present application does not specifically limit this. Generally, the application server does not set the target parameter in real time according to the information input by the client user. For example, the application server can set the red envelope amount of all the detailed records to 5 yuan, or the red envelope amount of all the detailed records can be set to 10 yuan; or, the red envelope amount of a part of the detailed records can be set to 5 yuan. Set the red envelope amount of another part of the detailed record to 10 yuan; however, usually the application server does not respond to the client user in real time, and sets the red envelope amount according to the value entered by the user.
另外,需要说明的是,活动的标识用于表示明细记录对应于哪个具体活动,应用服务器在后续处理过程,将用户路由到热点账户并为用户分配明细记录时,可通过活动的标识进一步检验应用服务器路由的准确性。作为一种示例,如果对路由准确性要求不高,或者当前仅进行唯一活动,明细记录中亦可不包括活动的标识,当然,为了保证应用服务器的路由准确性,还是以明细记录中包括活动的标识为最优。In addition, it should be noted that the identifier of the activity is used to indicate which specific activity the detail record corresponds to. When the application server routes the user to the hotspot account and assigns the detailed record to the user in the subsequent processing process, the application may further verify the application by using the identifier of the activity. The accuracy of server routing. As an example, if the accuracy of the routing is not high, or only the only activity is currently performed, the identification of the activity may not be included in the detailed record. Of course, in order to ensure the accuracy of the routing of the application server, the activity record is included in the detailed record. The logo is optimal.
本申请实施例生成预设条无差异的明细记录指的是,各条明细记录之间不作区分,只要明细记录处于空闲状态,即可分配给用户。预设条数可以为预先设定的指定数目,如,指定生成1万条明细记录;或者,预设条数还可以为根据总分配数、生成因子和标的物参数获得的计算数目,如,总分配数为100万元红包,生成因子为0.8,标的物参数为5元,则计算知晓要生成100*0.8/5=16万条明细记录。需要说明的是,可以随机设置生成因子,或者,也可以根据其它相关活动的经验设置生成因子,再者,还可以根据活动的往年历史数据设置生成因子,本申请实施例对此可不做具体限定。The detailed record of generating a preset bar without difference in the embodiment of the present application means that no distinction is made between each detailed record, and the detailed record can be allocated to the user as long as the detailed record is in an idle state. The preset number may be a preset number specified, for example, specifying that 10,000 detailed records are generated; or, the preset number may also be a calculated number obtained according to the total allocation number, the generation factor, and the target parameter, for example, The total distribution number is 1 million yuan red envelope, the generation factor is 0.8, and the target parameter is 5 yuan, then the calculation knows to generate 100*0.8/5=160,000 detailed records. It should be noted that the generation factor may be set randomly, or the generation factor may be set according to the experience of other related activities. Further, the generation factor may be set according to the historical data of the previous year of the activity, which may be specifically limited in this embodiment of the present application. .
综上可知,本申请实施例在活动开始前的账户配置阶段,不需要应用服务器进行账户拆分,也无需针对各个子账户进行活动信息配置,还无需在各个子账户之间进行正确性检查,只需要生成预设条无差异的明细记录即可,生成过程简单易于实现,可节省应用服务器的处理资源。如此,就解决了现有技术为降低热点账户的秒级并发量而导致的大量消耗应用服务器处理资源的技术问题。In summary, in the account configuration stage before the activity starts, the embodiment of the present application does not need an application server to perform account splitting, and does not need to perform activity information configuration for each sub-account, and does not need to perform correctness check between each sub-account. It is only necessary to generate a detailed record with no difference in the preset bar. The generation process is simple and easy to implement, and the processing resources of the application server can be saved. In this way, the technical problem that the prior art reduces the amount of concurrent concurrency of the hotspot account and consumes a large amount of application server processing resources is solved.
步骤102,响应于用户针对所述活动发送的访问请求,从所述热点账 户中,为每个用户查找一条对应的当前明细记录,所述当前明细记录的状态为空闲。 Step 102, in response to an access request sent by the user for the activity, from the hotspot account In the household, each user is searched for a corresponding current detail record, and the status of the current detail record is idle.
步骤101主要针对于活动开始前的账户配置阶段,一旦账户配置完成,活动启动后,应用服务器便可直接执行步骤102响应用户的访问请求。Step 101 is mainly directed to the account configuration phase before the activity starts. Once the account configuration is completed, after the activity is started, the application server can directly perform step 102 to respond to the user's access request.
举例来说,客户端用户查看活动页面,可通过点击或触控等方式,向应用服务器发送访问请求,应用服务器接收到用户发送的访问请求,即可按照本申请实施例方案进行信息处理。以双11发放红包的场景为例,活动页面可显示5元红包领取按钮和10元红包领取按钮,用户A点击10元红包领取按钮,即会向应用服务器发送访问请求,该访问请求用于表示用户A请求领取双11活动的10元红包。For example, the client user can view the activity page, and can send an access request to the application server by clicking or touching. The application server can receive the access request sent by the user, and can perform information processing according to the solution in the embodiment of the present application. For example, in the case of double 11 red envelopes, the activity page can display a 5 yuan red envelope collection button and a 10 yuan red envelope collection button. When user A clicks the 10 yuan red envelope collection button, an access request is sent to the application server, and the access request is used to indicate User A requests to receive a $10 red envelope for the Double 11 event.
可选地,应用服务器接收到访问请求后,可先对用户A的身份、用户A领取红包的行为、用户A请求领取红包的金额等方面进行鉴权,鉴权通过后,应用服务器再按照本申请实施例方案进行信息处理。Optionally, after receiving the access request, the application server may first authenticate the identity of the user A, the behavior of the user A to receive the red envelope, and the amount of the user A requesting to receive the red envelope. After the authentication is passed, the application server follows the application. Apply the embodiment scheme for information processing.
具体地,本申请实施例中,应用服务器的信息处理过程可体现为:确定用户参与的活动所对应的热点账户,从所述热点账户中为每个用户查找一条处于空闲状态的明细记录,作为分配给用户的当前明细记录。Specifically, in the embodiment of the present application, the information processing process of the application server may be implemented as: determining a hotspot account corresponding to the activity that the user participates in, and searching for a detailed record of the idle state for each user from the hotspot account, as The current detail record assigned to the user.
作为一种示例,如果当前只有一个用户向应用服务器发送访问请求,应用服务器可以为该用户,从热点账户处于空闲状态的所有明细记录中,确定一条当前明细记录。As an example, if only one user currently sends an access request to the application server, the application server may determine a current detail record for the user from all the detail records in which the hotspot account is in an idle state.
举例来说,应用服务器可以随机的,从处于空闲状态的所有明细记录中确定当前明细记录,如,ID为10~20的明细记录均处于空闲状态,应用服务器可以随机将ID为12的明细记录确定为当前明细记录。或者,应用服务器可以将处于空闲状态的所有明细记录中,ID最大或ID最小的明细记录确定为当前明细记录,如,ID为10~20的明细记录均处于空闲状态,应用服务器可以将最小ID为10的明细记录确定为当前明细记录。或者,应用服务器可以根据预设匹配规则,从处于空闲状态的所有明细记录中,确定一条与用户ID匹配的当前明细记录,如,用户ID为123456,且ID为10~20的明细记录均处于空闲状态,若匹配规则为明细记录ID 最后一位与用户ID最后一位相同,应用服务器可将ID为16的明细记录确定为当前明细记录。具体地,本申请实施例对应用服务器确定当前明细记录的方式、每种方式的具体实现手段等,可不做限定。For example, the application server may randomly determine the current detailed record from all the detailed records in the idle state. For example, the detailed records with IDs of 10 to 20 are all idle, and the application server may randomly record the detailed records with the ID of 12. Determined as the current detail record. Alternatively, the application server may determine, in all the detailed records in the idle state, the detailed records with the largest ID or the smallest ID as the current detailed records. For example, the detailed records with the IDs of 10 to 20 are in the idle state, and the application server may set the minimum ID. A detailed record of 10 is determined as the current detail record. Alternatively, the application server may determine, according to the preset matching rule, a current detailed record matching the user ID from all the detailed records in the idle state, for example, the user ID is 123456, and the detailed records with IDs of 10-20 are in the Idle state, if the matching rule is the detail record ID The last bit is the same as the last digit of the user ID, and the application server can determine the detail record with ID 16 as the current detail record. Specifically, the embodiment of the present application determines the manner of the current detailed record, the specific implementation means of each mode, and the like, which are not limited by the application server.
作为一种示例,如果当前有多个用户向应用服务器并发发送访问请求,应用服务器至少可按下文介绍的三种方式,从热点账户处于空闲状态的所有明细记录中,为每个用户确定一条当前明细记录。此处暂不对应用服务器确定当前明细记录的三种方式做解释说明,具体可参见下文所做介绍。As an example, if multiple users currently send an access request to the application server concurrently, the application server may determine at least one current content for each user from all the detailed records of the hotspot account in an idle state in at least three ways as described below. Detailed record. Here are three explanations for the application server to determine the current detail record. For details, please refer to the following.
步骤103,将所述当前明细记录分配给对应的用户,并更新所述当前明细记录的状态为占用。Step 103: Assign the current detailed record to the corresponding user, and update the status of the current detailed record to occupy.
无论是单用户访问,还是多用户并发访问,应用服务器均可为每个用户分配一条对应的当前明细记录。可以理解地,将当前明细记录分配给对应的用户指的是,建立当前明细记录与对应用户之间的对应关系。举例来说,为用户A、B、C依次分配明细记录10、11、12,如果明细记录10、11、12表现为图3所示,则步骤103将当前明细记录分配给对应的用户表示,用户A领取到5元红包、用户B领取到5元红包、用户C领取到10元红包;如果明细记录10、11、12表现为图4所示,则步骤103将当前明细记录分配给对应的用户表示,用户A、B和C分别抢购到1台手机。Whether it is single-user access or multi-user concurrent access, the application server can assign a corresponding current detail record to each user. It can be understood that assigning the current detailed record to the corresponding user refers to establishing a correspondence between the current detailed record and the corresponding user. For example, the detailed records 10, 11, 12 are sequentially assigned to the users A, B, and C. If the detailed records 10, 11, 12 are represented as shown in FIG. 3, step 103 assigns the current detailed records to the corresponding user representations. User A receives a red envelope of 5 yuan, user B receives a red envelope of 5 yuan, and user C receives a red envelope of 10 yuan. If the detailed records 10, 11, and 12 appear as shown in FIG. 4, step 103 assigns the current detailed record to the corresponding one. The user indicated that users A, B and C snapped up one mobile phone respectively.
本申请实施例中,每条明细记录只能唯一分配给一个用户,故在建立当前明细记录与对应用户之间的对应关系后,还可更新当前明细记录的状态,将空闲状态修改为占用状态,以此表示该条明细记录已分配给用户。In the embodiment of the present application, each detailed record can be uniquely assigned to only one user. Therefore, after establishing the correspondence between the current detailed record and the corresponding user, the status of the current detailed record can be updated, and the idle status is changed to the occupied status. To indicate that the detail record has been assigned to the user.
综上可知,本申请实施例将用户领取红包或抢购商品的行为,转换为匹配明细记录的处理过程,不需要实时修改账户余额或剩余商品数量,既可保证并发访问的线程安全,又有助于提高应用服务器响应并发访问的能力。In summary, the embodiment of the present application converts the behavior of the user to receive the red envelope or snapped up the product into a matching detailed record processing process, and does not need to modify the account balance or the number of remaining commodities in real time, thereby ensuring the thread safety of concurrent access and helping. Improve the ability of the application server to respond to concurrent access.
需要说明的是,本申请实施例方案,虽主要针对于营销类业务,但实质上是在利用技术手段解决业务实现过程中存在的技术问题。 It should be noted that the solution of the embodiment of the present application is mainly directed to a marketing service, but is essentially a technical problem that is solved in the process of implementing the business by using technical means.
针对步骤102提及的,应用服务器确定当前明细记录的三种方式,下面分别做解释说明。For the steps mentioned in step 102, the application server determines three ways of the current detail record, which are explained below.
实现方式一Implementation one
如果热点账户包括的明细记录的标识采用自增设计,应用服务器可按以下方式确定当前明细记录:获得缓存服务器为每个用户分配的明细记录标识,所述标识为所述缓存服务器根据每个用户发送访问请求的时间戳排序,按照自增设计分配;根据所述标识,为每个用户查找各自对应的当前明细记录。If the identifier of the detail record included in the hotspot account adopts an auto-increment design, the application server may determine the current detail record in the following manner: obtain the detailed record identifier assigned to each user by the cache server, and the identifier is the cache server according to each user. The timestamps of the sending access requests are sorted and assigned according to the self-incrementing design; according to the identifiers, each user is searched for a corresponding current detailed record.
为了避免并发的多个用户抢占同一条明细记录,实现无锁处理,本申请实施例可通过缓存服务器,按照用户发送访问请求时间戳的排序,为每个用户分配一个明细记录标识,本示例中,明细记录的标识可具体体现为明细记录ID。举例来说,可以在分布式缓存服务器中维护一个明细记录ID的当前值,当用户A和B并发访问时,若用户A相对B先到达,则可将(当前值+1)分配给用户A,同时缓存服务器维护(当前值+1),待用户B到达时,将(当前值+2)分配给用户B,并继续维护(当前值+2)。如此类推,当有其它用户向应用服务器发送访问请求时,缓存服务器均可为每个用户分配一个对应的明细记录ID,具体过程此处不做赘述。作为一种示例,缓存服务器可以通过redis的incr操作,为每个用户分配一个对应的明细记录ID:redis->incr(′preRecordNum_activity001′)。需要说明的是,上述示例,自增变量值体现为1,在具体应用中,可以按照需要自行设置自增变量值,本申请实施例对此可不做具体限定。In order to prevent the concurrent users from preempting the same detailed record and implementing the lock-free processing, the embodiment of the present application may allocate a detailed record identifier to each user according to the order of the timestamps of the access request sent by the user through the cache server. In this example, The identifier of the detail record can be embodied as a detail record ID. For example, the current value of a detail record ID can be maintained in the distributed cache server. When user A and B access concurrently, if user A arrives first with B, the current value (+1) can be assigned to user A. At the same time, the cache server maintains (current value +1). When user B arrives, it assigns (current value +2) to user B and continues to maintain (current value +2). By the way, when the other user sends an access request to the application server, the cache server can assign a corresponding detail record ID to each user. The specific process is not described here. As an example, the cache server can assign each user a corresponding detail record ID through redis' incr operation: redis->incr('preRecordNum_activity001'). It should be noted that, in the above example, the value of the self-incremental variable is set to 1. In a specific application, the value of the self-incrementing variable may be set as needed, and the embodiment of the present application may not specifically limit this.
举例来说,缓存服务器为用户A分配的明细记录ID为10,为用户B分配的明细记录ID为11,应用服务器可据此,建立用户A与ID为10的明细记录之间的对应关系、建立用户B与ID为11的明细记录之间的对应关系,结合图3所示示意图可知,用户A可领取5元红包、用户B可领取5元红包。For example, the cache server allocates a detailed record ID of 10 for user A, and a detailed record ID of 11 for user B, and the application server can establish a correspondence between user A and a detailed record with ID 10 according to the The correspondence between the user B and the detailed record with the ID of 11 is established. According to the schematic diagram shown in FIG. 3, the user A can receive a red envelope of 5 yuan, and the user B can receive a red envelope of 5 yuan.
实现方式二Implementation 2
应用服务器可按以下方式确定当前明细记录:根据每个用户发送访问 请求的时间戳排序,从所述热点账户处于空闲状态的所有明细记录中,依次为每个用户查找一条对应的当前明细记录。The application server can determine the current detail record as follows: Send access based on each user The timestamps of the requests are sorted, and each user is searched for a corresponding current detail record in order from all the detailed records in which the hotspot account is in an idle state.
为了避免并发的多个用户抢占同一条明细记录,实现无锁处理,本申请实施例可按照用户发送访问请求时间戳的排序,依次为每个用户分配一条对应的当前明细记录。举例来说,ID为10~20的明细记录均处于空闲状态,用户A和B并发访问,且用户A相对B先到达,应用服务器可以随机的,从处于空闲状态的所有明细记录中,依次为用户A和B各确定一条当前明细记录,如,为用户A确定的当前明细记录的ID为10,为用户B确定的当前明细记录的ID为12。或者,应用服务器可以按照明细记录ID的大小排序,依次为用户A和B各确定一条当前明细记录,如,明细记录按照ID升序排列,为用户A确定的当前明细记录的ID为10,为用户B确定的当前明细记录的ID为11;或者,明细记录按照ID降序排列,为用户A确定的当前明细记录的ID为20,为用户B确定的当前明细记录的ID为19。In order to prevent the concurrent users from preempting the same detailed record and implementing the lock-free processing, the embodiment of the present application may sequentially assign a corresponding current detailed record to each user according to the order of the timestamps of the access requests sent by the user. For example, the detailed records with IDs of 10 to 20 are in idle state. Users A and B concurrently access, and user A arrives with respect to B first. The application server can be random, from all the detailed records in the idle state, in order. Users A and B each determine a current detail record. For example, the ID of the current detail record determined for user A is 10, and the ID of the current detail record determined for user B is 12. Alternatively, the application server may sort according to the size of the detail record ID, and sequentially determine a current detail record for each of the users A and B. For example, the detail records are arranged in ascending order of the ID, and the ID of the current detail record determined for the user A is 10, which is the user. The ID of the current detail record determined by B is 11; or, the detailed records are arranged in descending order of ID, the ID of the current detail record determined for user A is 20, and the ID of the current detail record determined for user B is 19.
可选地,实现方式二还可与实现方式一相互配合,为用户确定一条对应的当前明细记录,可具体体现为:应用服务器可以先利用实现方式一,借助缓存服务器为用户确定当前明细记录,当缓存服务器故障的时候,再利用实现方式二为用户确定当前明细记录。举例来说,应用服务器可通过监控缓存服务器心跳的方式,确定缓存服务器是否出现故障。Optionally, the implementation manner 2 can also cooperate with the implementation manner 1 to determine a corresponding current detailed record for the user, which can be embodied by: the application server can first use the implementation manner 1 to determine the current detailed record for the user by using the cache server. When the cache server is faulty, the second implementation mode is used to determine the current detail record for the user. For example, the application server can determine whether the cache server is faulty by monitoring the heartbeat of the cache server.
实现方式三Implementation mode three
应用服务器可按以下方式确定当前明细记录:从所述热点账户处于空闲状态的所有明细记录中,获得指定条数的明细记录;利用每个用户的身份标识,从所述指定条数的明细记录中,为每个用户确定一条对应的当前明细记录。The application server may determine the current detail record in the following manner: obtaining a detailed record of the specified number of pieces from all the detailed records in which the hotspot account is in an idle state; using the identification of each user, the detailed record from the specified number of pieces In the middle, a corresponding current detail record is determined for each user.
为了避免并发的多个用户抢占同一条明细记录,实现无锁处理,本申请实施例可先从处于空闲状态的所有明细记录中,抓取指定条数的明细记录,进而再结合用户ID,按照一定的匹配规则,从指定条数的明细记录中为每个用户确定一条对应的当前明细记录。举例来说,指定条数为10,ID为001~100的明细记录均处于空闲状态,应用服务器抓取到的明 细记录的ID为001~010,若用户A的ID为123456,用户B的ID为654321,匹配规则为:以用户ID的指定位为依据,确定用户对应的当前明细记录在被抓取明细记录中的位置。举例来说,指定位为用户ID的倒数第二位,则用户A对应的当前明细记录在被抓取明细记录中的位置为5,即ID为005的明细记录;用户B对应的当前明细记录在被抓取明细记录中的位置为2,即ID为002的明细记录。In order to prevent concurrent users from preempting the same detailed record and implementing lock-free processing, the embodiment of the present application may first capture the detailed records of the specified number from all the detailed records in the idle state, and then combine the user IDs according to the A certain matching rule determines a corresponding current detail record for each user from the specified number of detailed records. For example, if the number of specified records is 10 and the ID records with IDs from 001 to 100 are idle, the application server captures the details. The ID of the fine record is 001 to 010. If the ID of user A is 123456 and the ID of user B is 654321, the matching rule is: based on the specified digit of the user ID, the current detail record corresponding to the user is determined in the captured detail record. The location in . For example, if the specified bit is the penultimate bit of the user ID, the current detail record corresponding to the user A in the captured detail record is 5, that is, the detail record with the ID 005; the current detail record corresponding to the user B. The position in the captured detail record is 2, that is, the detail record with ID 002.
需要说明的是,本申请实施例可以依序设置多条匹配规则,如果无法通过当前匹配规则为用户确定明细记录,则可依序利用下一条匹配规则进行明细记录匹配,直至为用户确定出对应的当前明细记录。或者,如果通过当前匹配规则为用户确定出多条明细记录,则可随机从确定出的多条明细记录中确定当前明细记录,或者还可结合其它匹配规则为用户确定对应的当前明细记录。本申请实施例对此可不做具体限定,只要为每个用户确定一条当前明细记录即可。It should be noted that, in this embodiment, multiple matching rules may be set in sequence. If the current matching rule cannot be used to determine the detailed record for the user, the next matching rule may be used to perform detailed record matching until the user is determined to correspond. Current detail record. Alternatively, if a plurality of detailed records are determined for the user by using the current matching rule, the current detailed record may be randomly determined from the determined plurality of detailed records, or the corresponding current detailed record may be determined for the user in combination with other matching rules. This embodiment of the present application may not specifically limit this, as long as a current detailed record is determined for each user.
举例来说,本申请实施例中的匹配规则还可为:匹配用户ID与明细记录ID的指定位,使二者相同或存在预设对应关系,本申请对此可不做具体限定。For example, the matching rule in the embodiment of the present application may be: matching the specified bit of the user ID and the detailed record ID, so that the two are the same or have a preset corresponding relationship, which may be specifically limited in this application.
参考图5,示出了本申请信息处理方法实施例2的流程图,可以包括以下步骤:Referring to FIG. 5, a flowchart of Embodiment 2 of the information processing method of the present application is shown, which may include the following steps:
步骤201,生成活动对应的热点账户,所述热点账户包括预设条数的明细记录,所述明细记录包括所述活动的标识、所述明细记录的标识、所述明细记录的状态和标的物参数。Step 201: Generate a hotspot account corresponding to the activity, where the hotspot account includes a preset number of detailed records, where the detailed record includes an identifier of the activity, an identifier of the detailed record, a status of the detailed record, and a subject matter parameter.
步骤201的实现过程可参见上文图2所示步骤101,此处不再赘述。For the implementation process of step 201, refer to step 101 shown in FIG. 2 above, and details are not described herein again.
步骤202,响应于用户针对所述活动发送的访问请求,判断所述热点账户处于空闲状态的明细记录的数目是否低于预设值,如果否,则执行步骤203。Step 202: Determine, according to the access request sent by the user for the activity, whether the number of the detailed records of the hotspot account in an idle state is lower than a preset value, and if no, perform step 203.
本申请实施例主要针对于秒级并发量很高的场景,为了避免出现明细记录分配不足现象,即,处于空闲状态的明细记录数目小于并发访问的用户数目,应用服务器在为每个用户分配对应的当前明细记录之前,可 先判断下目前处于空闲状态的明细记录的数目是否低于预设值,如果未低于预设值,则可继续执行为用户确定当前明细记录的步骤。The embodiment of the present application is directed to a scenario in which the number of concurrent transmissions is very high. In order to avoid the insufficient allocation of detailed records, that is, the number of detailed records in the idle state is smaller than the number of concurrently accessed users, the application server allocates a corresponding number for each user. Before the current detail record, It is first determined whether the number of detailed records currently in the idle state is lower than a preset value, and if not lower than the preset value, the step of determining the current detailed record for the user may be continued.
举例来说,预设值可以为预先设定的指定数值,如,指定数值为100条,即,热点账户处于空闲状态的明细记录的数目大于100条时,便可继续执行为用户确定当前明细记录的步骤。或者,预设值可以为预先设定的比值,如,比值为20%,即,热点账户处于空闲状态的明细记录的数目大于预设条数的20%时,便可继续执行为用户确定当前明细记录的步骤。或者,预设值可以为并发访问的用户数目,如,并发访问的用户数目为100,即,热点账户处于空闲状态的明细记录的数目大于100条时,便可继续执行为用户确定当前明细记录的步骤。For example, the preset value may be a preset specified value. For example, if the specified value is 100, that is, when the number of the detailed records of the hotspot account in the idle state is greater than 100, the execution may determine the current details for the user. The steps of recording. Alternatively, the preset value may be a preset ratio, for example, the ratio is 20%, that is, when the number of the detailed records of the hotspot account in the idle state is greater than 20% of the preset number, the execution may be continued to determine the current for the user. The steps for detail recording. Alternatively, the preset value may be the number of concurrently accessed users. For example, the number of concurrently accessed users is 100. That is, when the number of detailed records of the hotspot account in the idle state is greater than 100, the current detailed record may be determined for the user. A step of.
步骤203,从所述热点账户中,为每个用户查找一条对应的当前明细记录,所述当前明细记录的状态为空闲。Step 203: Find, from the hotspot account, a corresponding current detail record for each user, where the status of the current detail record is idle.
步骤204,将所述当前明细记录分配给对应的用户,并更新所述当前明细记录的状态为占用。Step 204: Assign the current detailed record to the corresponding user, and update the status of the current detailed record to occupy.
步骤203、204的实现过程可参见上文图2所示步骤102、103,此处不再赘述。For the implementation process of the steps 203 and 204, refer to the steps 102 and 103 shown in FIG. 2 above, and details are not described herein again.
可选地,热点账户还包括预分配数和/或未分配数,则在步骤202判断热点账户处于空闲状态的明细记录的数目低于预设值时,应用服务器还可执行以下步骤:判断所述未分配数是否大于零,如果是,则利用所述未分配数生成新的明细记录,再执行所述为每个用户查找一条对应的当前明细记录。Optionally, the hotspot account further includes a pre-allocated number and/or an unallocated number, and when it is determined in step 202 that the number of the detailed records of the hotspot account in the idle state is lower than a preset value, the application server may further perform the following steps: determining the location Whether the unallocated number is greater than zero, and if so, generating a new detailed record by using the unallocated number, and performing the searching for a corresponding current detailed record for each user.
本申请实施例中,预分配数指的是预设条数的明细记录的标的物参数之和,未分配数指的是总分配数与预分配数之间的差值。以上文所举抢红包活动为例,总分配数为100万元红包、生成因子为0.8、红包金额为5元,则16万条明细记录对应的预分配数为16*5=80万元,未分配数为100-80=20万元。In the embodiment of the present application, the pre-allocation number refers to the sum of the object parameters of the predetermined number of detailed records, and the unallocated number refers to the difference between the total number of allocations and the pre-allocated number. For example, in the above article, the total redemption activity is 1 million yuan, the generation factor is 0.8, and the red envelope amount is 5 yuan. The pre-allocation number corresponding to 160,000 detailed records is 16*5=800,000 yuan. The unallocated number is 100-80=200,000 yuan.
如果未分配数大于零,则说明红包或商品目前还有余量,可结合未分配数,继续生成新的明细记录,供应用服务器分配。需要说明的是,应 用服务器可以先从剩余明细记录(即,预设条数的明细记录中处于空闲状态的明细记录)中为用户确定当前明细记录,并在不足时再从新的明细记录中为用户确定当前明细记录。或者,应用服务器可以先从新的明细记录中为用户确定当前明细记录,并在不足时再从剩余明细记录中为用户确定当前明细记录。或者,应用服务器可以不对剩余明细记录和新的明细记录做区分,直接从中为用户确定当前明细记录。If the unallocated number is greater than zero, it indicates that the red envelope or the commodity currently has a margin, and can be combined with the unallocated number to continue to generate a new detailed record, which is allocated by the server. It should be noted that The server may first determine the current detailed record for the user from the remaining detailed records (ie, the detailed records in the idle state of the predetermined number of detailed records), and determine the current detailed record for the user from the new detailed record when insufficient. . Alternatively, the application server may first determine the current detail record for the user from the new detail record, and then determine the current detail record for the user from the remaining detail records when insufficient. Alternatively, the application server may not distinguish between the remaining detail records and the new detail records, and directly determine the current detail records for the user.
可选地,作为一种示例,应用服务器也可判断预分配数是否小于总分配数,如果是,则利用未分配数生成新的明细记录,再执行所述为每个用户查找一条对应的当前明细记录。具体过程可参照上文关于未分配数所介绍的方案,此处不再赘述。Optionally, as an example, the application server may also determine whether the pre-allocated number is less than the total allocation number, and if yes, generate a new detailed record by using the unallocated number, and then perform the method to find a corresponding current for each user. Detailed record. For the specific process, refer to the scheme introduced above for the unallocated number, and details are not described herein again.
可选地,如果经判断未分配数等于零,或者预分配数等于总分配数,为了提高处理用户请求的速度,应用服务器还可计算处于空闲状态的明细记录数目与并发访问的用户数目之间的差值,并按照并发访问用户发送访问请求的时间戳排序,直接向与所述差值相符且排序靠后的用户(即,分配不到明细记录的用户),反馈活动结束页面。举例来说,红包账户中剩余3条处于空闲状态的明细记录,当前有5个用户并发向应用服务器发送访问请求,且5个用户按照时间戳排序依次为1、2、3、4、5,对应于此,应用服务器可为用户1、2和3分别分配一条当前明细记录,即,用户1、2和3分别领取到一个红包,同时,应用服务器还可向用户4和5返回抢红包活动结束页面。如此,还可缩短应用服务器响应用户4和5的时间,提高用户4和5的用户体验。Optionally, if it is determined that the unallocated number is equal to zero, or the pre-allocated number is equal to the total allocated number, in order to increase the speed of processing the user request, the application server may also calculate the number of detailed records in the idle state and the number of users concurrently accessed. The difference is sorted according to the timestamp of the concurrent access user sending the access request, and the activity end page is directly fed back to the user who matches the difference and is sorted backward (ie, the user who is not assigned the detailed record). For example, the remaining three records in the red envelope account are in the idle state. Currently, five users concurrently send access requests to the application server, and the five users are sorted by timestamps in order of 1, 2, 3, 4, and 5. Corresponding to this, the application server can respectively assign a current detail record to users 1, 2 and 3, that is, users 1, 2 and 3 respectively receive a red envelope, and at the same time, the application server can also return red packets to users 4 and 5. End page. In this way, the time for the application server to respond to users 4 and 5 can be shortened, and the user experience of users 4 and 5 can be improved.
综上可知,本申请实施例在分配不足时,可根据实际情况生成新的明细记录,且过程中不会涉及数据迁移,也不会对正在进行的活动、已存在的明细记录、已建立的明细记录与用户之间的对应关系等等产生影响。In summary, in the embodiment of the present application, when the allocation is insufficient, a new detailed record can be generated according to the actual situation, and the data migration is not involved in the process, and the ongoing activity, the existing detailed record, and the established The correspondence between the detail record and the user has an influence.
可选地,本申请实施例在活动结束后,还可包括结算步骤。举例来说,针对抢红包活动,结算步骤指的是计算红包余额;针对抢商品活动,结算步骤指的是计算剩余商品数。具体地,本申请实施例提供了如下两种结算实现方式: Optionally, the embodiment of the present application may further include a settlement step after the activity ends. For example, for the redemption activity, the settlement step refers to calculating the red envelope balance; for the grab product activity, the settlement step refers to calculating the number of remaining products. Specifically, the embodiment of the present application provides the following two settlement implementation manners:
实现方式一,应用服务器释放掉热点账户中所有处于空闲状态的明细记录,并作如下更新:预分配数为零,未分配数=总分配数-所有处于占用状态的明细记录的标的物参数之和。其中,未分配数即为结算值。In the first implementation manner, the application server releases all the detailed records in the hotspot account that are in an idle state, and updates as follows: the pre-allocation number is zero, the unallocated number = the total allocation number - all the target parameters of the detailed records in the occupied state with. Among them, the unallocated number is the settlement value.
实现方式二,应用服务器计算结算值=未分配数+所有处于空闲状态的明细记录数量的标的物参数之和。In the second implementation mode, the application server calculates the settlement value=unallocated number+the sum of the target parameters of all the detailed records in the idle state.
与上述本申请一种信息处理方法实施例1所提供的方法相对应,参见图6,本申请还提供了一种信息处理装置实施例1,在本实施例中,该装置可以包括:Corresponding to the method provided in Embodiment 1 of the information processing method of the present application, referring to FIG. 6, the present application further provides an embodiment 1 of an information processing apparatus. In this embodiment, the apparatus may include:
生成单元301,用于生成活动对应的热点账户,所述热点账户包括预设条数的明细记录,所述明细记录包括所述活动的标识、所述明细记录的标识、所述明细记录的状态和标的物参数;The generating unit 301 is configured to generate a hotspot account corresponding to the activity, where the hotspot account includes a preset number of detailed records, where the detailed record includes an identifier of the activity, an identifier of the detailed record, and a status of the detailed record And target parameters;
查找单元302,用于响应于用户针对所述活动发送的访问请求,从所述热点账户中,为每个用户查找一条对应的当前明细记录,所述当前明细记录的状态为空闲;The searching unit 302 is configured to, according to the access request sent by the user for the activity, search for a corresponding current detail record for each user from the hotspot account, where the status of the current detail record is idle;
分配单元303,用于将所述查找单元查到的所述当前明细记录分配给对应的用户,并更新所述当前明细记录的状态为占用。The allocating unit 303 is configured to allocate the current detailed record found by the searching unit to the corresponding user, and update the status of the current detailed record to occupy.
查找单元可按照方法实施例介绍的方案,为每个用户确定一个对应的当前明细记录,此处不再赘述。The locating unit can determine a corresponding current detail record for each user according to the solution introduced in the method embodiment, and details are not described herein again.
针对多用户并发访问,本申请实施例中的查找单元可具体体现为以下三种实现方式:For the multi-user concurrent access, the searching unit in the embodiment of the present application may be embodied in the following three implementation manners:
实现方式一,如果多个用户并发发送访问请求,且所述明细记录的标识采用自增设计,所述查找单元包括:In a first implementation manner, if multiple users send an access request concurrently, and the identifier of the detailed record adopts an auto-increment design, the searching unit includes:
第一获得单元,用于获得缓存服务器为每个用户分配的明细记录标识,所述标识为所述缓存服务器根据每个用户发送访问请求的时间戳排序,按照自增设计分配;a first obtaining unit, configured to obtain a detailed record identifier allocated by the cache server for each user, where the identifier is sorted according to a timestamp of each user sending an access request, and is allocated according to an auto-increment design;
第一查找子单元,用于根据所述标识,为每个用户查找各自对应的当前明细记录。The first search subunit is configured to find, for each user, a corresponding current detail record according to the identifier.
实现方式二,如果多个用户并发发送访问请求,所述查找单元包括: In a second implementation manner, if multiple users send an access request concurrently, the searching unit includes:
第二查找子单元,用于根据每个用户发送访问请求的时间戳排序,从所述热点账户处于空闲状态的所有明细记录中,依次为每个用户查找一条对应的当前明细记录。The second search sub-unit is configured to sort the timestamps of the access requests sent by each user, and sequentially search for a corresponding current detailed record for each user from all the detailed records in which the hotspot account is in an idle state.
实现方式三,如果多个用户并发发送访问请求,所述查找单元包括:In a third implementation manner, if multiple users send an access request concurrently, the searching unit includes:
第二获得单元,用于从所述热点账户处于空闲状态的所有明细记录中,获得指定条数的明细记录;a second obtaining unit, configured to obtain a detailed record of the specified number of pieces from all the detailed records in which the hotspot account is in an idle state;
第三查找子单元,用于利用每个用户的身份标识,从所述指定条数的明细记录中,为每个用户确定一条对应的当前明细记录。And a third search subunit, configured to determine, by using the identity of each user, a corresponding current detail record for each user from the specified record of the specified number of records.
可选地,在上述方案的基础上,所述装置还包括:Optionally, based on the foregoing solution, the device further includes:
第一判断单元,用于在所述查找单元查找所述当前明细记录之前,判断所述热点账户处于空闲状态的明细记录的数目是否低于预设值,如果否,则通知所述查找单元查找所述当前明细记录。a first determining unit, configured to determine, before the searching unit searches for the current detailed record, whether the number of detailed records in which the hotspot account is in an idle state is lower than a preset value, and if not, notifying the searching unit to search The current detail record.
可选地,如果所述热点账户处于空闲状态的明细记录的数目低于所述预设值,且所述热点账户还包括预分配数和/或未分配数,所述预分配数为所述预设条数的明细记录的标的物参数之和,所述未分配数为总分配数与所述预分配数之差,则所述装置还包括:Optionally, if the number of the detailed records of the hotspot account in an idle state is lower than the preset value, and the hotspot account further includes a pre-allocated number and/or an unallocated number, the pre-allocated number is the And the unassigned number is the difference between the total number of allocations and the pre-allocated number, and the device further includes:
第二判断单元,用于在所述热点账户处于空闲状态的明细记录的数目低于所述预设值时,判断所述未分配数是否大于零,如果是,则利用所述未分配数生成新的明细记录,并通知所述查找单元查找所述当前明细记录;或者,a second determining unit, configured to determine, when the number of the detailed records in which the hotspot account is in an idle state, is lower than the preset value, whether the unallocated number is greater than zero, and if yes, generate the unallocated number a new detail record, and notifying the lookup unit to find the current detail record; or,
第三判断单元,用于在所述热点账户处于空闲状态的明细记录的数目低于所述预设值时,判断所述预分配数是否小于所述总分配数,如果是,则利用所述未分配数生成新的明细记录,并通知所述查找单元查找所述当前明细记录。a third determining unit, configured to determine, when the number of the detailed records of the hotspot account in an idle state is lower than the preset value, whether the pre-allocated number is less than the total allocation number, and if yes, using the The unassigned number generates a new detail record and notifies the lookup unit to look up the current detail record.
本申请还提供了一种智能设备,该智能设备的处理器上集成了前述的信息处理装置。The application also provides a smart device, the aforementioned information processing device is integrated on the processor of the smart device.
需要说明的是,本说明书中的各个实施例均采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似的部分互相参见即可。对于系统类实施例而言,由于其与方法 实施例基本相似,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。It should be noted that each embodiment in the specification is described in a progressive manner, and each embodiment focuses on differences from other embodiments, and the same similar parts between the embodiments are referred to each other. can. For system class embodiments, due to its method The embodiments are basically similar, so the description is relatively simple, and the relevant parts can be referred to the description of the method embodiments.
最后,还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。Finally, it should also be noted that in this context, relational terms such as first and second are used merely to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply these entities. There is any such actual relationship or order between operations. Furthermore, the term "comprises" or "comprises" or "comprises" or any other variations thereof is intended to encompass a non-exclusive inclusion, such that a process, method, article, or device that comprises a plurality of elements includes not only those elements but also Other elements, or elements that are inherent to such a process, method, item, or device. An element that is defined by the phrase "comprising a ..." does not exclude the presence of additional equivalent elements in the process, method, item, or device that comprises the element.
以上对本申请所提供的一种信息推送方法及装置进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。 The information pushing method and device provided by the present application are described in detail above. The principles and implementation manners of the present application are described in the specific examples. The description of the above embodiments is only used to help understand the method of the present application. And the core ideas of the present invention; at the same time, those skilled in the art, according to the idea of the present application, there will be changes in the specific embodiments and application scopes. In summary, the contents of this specification should not be construed as limits.

Claims (12)

  1. 一种信息处理方法,其特征在于,该方法包括如下步骤:An information processing method, characterized in that the method comprises the following steps:
    生成活动对应的热点账户,所述热点账户包括预设条数的明细记录,所述明细记录包括所述活动的标识、所述明细记录的标识、所述明细记录的状态和标的物参数;Generating a hotspot account corresponding to the activity, where the hotspot account includes a predetermined number of detailed records, the detailed record including an identifier of the activity, an identifier of the detailed record, a status of the detailed record, and a target parameter;
    响应于用户针对所述活动发送的访问请求,从所述热点账户中,为每个用户查找一条对应的当前明细记录,所述当前明细记录的状态为空闲;Responding to an access request sent by the user for the activity, searching for a corresponding current detail record for each user from the hotspot account, the status of the current detail record is idle;
    将所述当前明细记录分配给对应的用户,并更新所述当前明细记录的状态为占用。Assigning the current detail record to the corresponding user, and updating the status of the current detail record to occupy.
  2. 根据权利要求1所述的方法,其特征在于,如果多个用户并发发送访问请求,且所述明细记录的标识采用自增设计,所述为每个用户查找一条对应的当前明细记录,具体为:The method according to claim 1, wherein if a plurality of users send an access request concurrently, and the identifier of the detailed record adopts an auto-increment design, the user searches for a corresponding current detailed record for each user, specifically :
    获得缓存服务器为每个用户分配的明细记录标识,所述标识为所述缓存服务器根据每个用户发送访问请求的时间戳排序,按照自增设计分配;Obtaining, by the cache server, a detailed record identifier assigned to each user, where the identifier is sorted according to a timestamp of each user sending an access request, and is allocated according to an auto-increment design;
    根据所述标识,为每个用户查找各自对应的当前明细记录。According to the identifier, each user is searched for a corresponding current detail record.
  3. 根据权利要求1所述的方法,其特征在于,如果多个用户并发发送访问请求,所述为每个用户查找一条对应的当前明细记录,具体为:The method according to claim 1, wherein if a plurality of users concurrently send an access request, the user searches for a corresponding current detail record for each user, specifically:
    根据每个用户发送访问请求的时间戳排序,从所述热点账户处于空闲状态的所有明细记录中,依次为每个用户查找一条对应的当前明细记录。According to the timestamp order of each user sending the access request, each user is searched for a corresponding current detail record in all the detailed records in which the hotspot account is in an idle state.
  4. 根据权利要求1所述的方法,其特征在于,如果多个用户并发发送访问请求,所述为每个用户查找一条对应的当前明细记录,具体为:The method according to claim 1, wherein if a plurality of users concurrently send an access request, the user searches for a corresponding current detail record for each user, specifically:
    从所述热点账户处于空闲状态的所有明细记录中,获得指定条数的明细记录;Obtaining a detailed record of the specified number of entries from all the detailed records in which the hotspot account is in an idle state;
    利用每个用户的身份标识,从所述指定条数的明细记录中,为每个用户确定一条对应的当前明细记录。Using each user's identity, a corresponding current detail record is determined for each user from the specified number of detailed records.
  5. 根据权利要求1至4任一项所述的方法,其特征在于,所述为每个用户查找一条对应的当前明细记录之前,还包括:The method according to any one of claims 1 to 4, wherein before the finding a corresponding current detail record for each user, the method further comprises:
    判断所述热点账户处于空闲状态的明细记录的数目是否低于预设值, 如果否,则执行所述为每个用户查找一条对应的当前明细记录。Determining whether the number of detailed records in which the hotspot account is in an idle state is lower than a preset value, If not, then perform a search for each user to find a corresponding current detail record.
  6. 根据权利要求5所述的方法,其特征在于,所述热点账户还包括预分配数和/或未分配数,所述预分配数为所述预设条数的明细记录的标的物参数之和,所述未分配数为总分配数与所述预分配数之差,则在所述热点账户处于空闲状态的明细记录的数目低于所述预设值时,所述方法还包括:The method according to claim 5, wherein the hotspot account further comprises a pre-allocated number and/or an unallocated number, wherein the pre-allocated number is a sum of object parameters of the predetermined number of detailed records. And the unallocated number is the difference between the total number of allocations and the pre-allocated number, and the method further includes: when the number of the detailed records of the hotspot account being in an idle state is lower than the preset value, the method further includes:
    判断所述未分配数是否大于零,如果是,则利用所述未分配数生成新的明细记录,再执行所述为每个用户查找一条对应的当前明细记录;Determining whether the unallocated number is greater than zero, and if yes, generating a new detailed record by using the unallocated number, and performing the searching for a corresponding current detailed record for each user;
    或者,or,
    判断所述预分配数是否小于所述总分配数,如果是,则利用所述未分配数生成新的明细记录,再执行所述为每个用户查找一条对应的当前明细记录。Determining whether the pre-allocated number is less than the total allocation number, and if so, generating a new detailed record by using the unallocated number, and performing the searching for a corresponding current detailed record for each user.
  7. 一种信息处理装置,其特征在于,该装置包括:An information processing apparatus, characterized in that the apparatus comprises:
    生成单元,用于生成活动对应的热点账户,所述热点账户包括预设条数的明细记录,所述明细记录包括所述活动的标识、所述明细记录的标识、所述明细记录的状态和标的物参数;a generating unit, configured to generate a hotspot account corresponding to the activity, where the hotspot account includes a preset number of detailed records, where the detailed record includes an identifier of the activity, an identifier of the detailed record, a status of the detailed record, and Subject parameter
    查找单元,用于响应于用户针对所述活动发送的访问请求,从所述热点账户中,为每个用户查找一条对应的当前明细记录,所述当前明细记录的状态为空闲;a searching unit, configured to search for a corresponding current detail record for each user from the hotspot account in response to an access request sent by the user for the activity, where the status of the current detail record is idle;
    分配单元,用于将所述查找单元查到的所述当前明细记录分配给对应的用户,并更新所述当前明细记录的状态为占用。And an allocating unit, configured to allocate the current detailed record found by the searching unit to a corresponding user, and update the status of the current detailed record to occupy.
  8. 根据权利要求7所述的装置,其特征在于,如果多个用户并发发送访问请求,且所述明细记录的标识采用自增设计,所述查找单元包括:The apparatus according to claim 7, wherein if the plurality of users concurrently send an access request, and the identifier of the detailed record adopts an auto-increment design, the searching unit comprises:
    第一获得单元,用于获得缓存服务器为每个用户分配的明细记录标识,所述标识为所述缓存服务器根据每个用户发送访问请求的时间戳排序,按照自增设计分配;a first obtaining unit, configured to obtain a detailed record identifier allocated by the cache server for each user, where the identifier is sorted according to a timestamp of each user sending an access request, and is allocated according to an auto-increment design;
    第一查找子单元,用于根据所述标识,为每个用户查找各自对应的当前明细记录。The first search subunit is configured to find, for each user, a corresponding current detail record according to the identifier.
  9. 根据权利要求7所述的装置,其特征在于,如果多个用户并发发 送访问请求,所述查找单元包括:The apparatus according to claim 7, wherein if a plurality of users are concurrently issued Sending an access request, the searching unit includes:
    第二查找子单元,用于根据每个用户发送访问请求的时间戳排序,从所述热点账户处于空闲状态的所有明细记录中,依次为每个用户查找一条对应的当前明细记录。The second search sub-unit is configured to sort the timestamps of the access requests sent by each user, and sequentially search for a corresponding current detailed record for each user from all the detailed records in which the hotspot account is in an idle state.
  10. 根据权利要求7所述的装置,其特征在于,如果多个用户并发发送访问请求,所述查找单元包括:The apparatus according to claim 7, wherein if a plurality of users concurrently send an access request, the searching unit comprises:
    第二获得单元,用于从所述热点账户处于空闲状态的所有明细记录中,获得指定条数的明细记录;a second obtaining unit, configured to obtain a detailed record of the specified number of pieces from all the detailed records in which the hotspot account is in an idle state;
    第三查找子单元,用于利用每个用户的身份标识,从所述指定条数的明细记录中,为每个用户确定一条对应的当前明细记录。And a third search subunit, configured to determine, by using the identity of each user, a corresponding current detail record for each user from the specified record of the specified number of records.
  11. 根据权利要求7至10任一项所述的装置,其特征在于,所述装置还包括:The device according to any one of claims 7 to 10, wherein the device further comprises:
    第一判断单元,用于在所述查找单元查找所述当前明细记录之前,判断所述热点账户处于空闲状态的明细记录的数目是否低于预设值,如果否,则通知所述查找单元查找所述当前明细记录。a first determining unit, configured to determine, before the searching unit searches for the current detailed record, whether the number of detailed records in which the hotspot account is in an idle state is lower than a preset value, and if not, notifying the searching unit to search The current detail record.
  12. 根据权利要求11所述的装置,其特征在于,所述热点账户还包括预分配数和/或未分配数,所述预分配数为所述预设条数的明细记录的标的物参数之和,所述未分配数为总分配数与所述预分配数之差,则所述装置还包括:The device according to claim 11, wherein the hotspot account further comprises a pre-allocated number and/or an unallocated number, wherein the pre-allocated number is a sum of object parameters of the predetermined number of detailed records. The unallocated number is the difference between the total number of allocations and the pre-allocated number, and the device further includes:
    第二判断单元,用于在所述热点账户处于空闲状态的明细记录的数目低于所述预设值时,判断所述未分配数是否大于零,如果是,则利用所述未分配数生成新的明细记录,并通知所述查找单元查找所述当前明细记录;a second determining unit, configured to determine, when the number of the detailed records in which the hotspot account is in an idle state, is lower than the preset value, whether the unallocated number is greater than zero, and if yes, generate the unallocated number a new detail record, and notifying the search unit to find the current detail record;
    或者,or,
    第三判断单元,用于在所述热点账户处于空闲状态的明细记录的数目低于所述预设值时,判断所述预分配数是否小于所述总分配数,如果是,则利用所述未分配数生成新的明细记录,并通知所述查找单元查找所述当前明细记录。 a third determining unit, configured to determine, when the number of the detailed records of the hotspot account in an idle state is lower than the preset value, whether the pre-allocated number is less than the total allocation number, and if yes, using the The unassigned number generates a new detail record and notifies the lookup unit to look up the current detail record.
PCT/CN2016/073144 2015-02-09 2016-02-02 Information processing method and device WO2016127854A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510067932.2 2015-02-09
CN201510067932.2A CN105991571B (en) 2015-02-09 2015-02-09 A kind of information processing method and device

Publications (1)

Publication Number Publication Date
WO2016127854A1 true WO2016127854A1 (en) 2016-08-18

Family

ID=56614973

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/073144 WO2016127854A1 (en) 2015-02-09 2016-02-02 Information processing method and device

Country Status (2)

Country Link
CN (1) CN105991571B (en)
WO (1) WO2016127854A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117808602A (en) * 2024-03-01 2024-04-02 联动优势电子商务有限公司 Hot account billing method and related device based on sub-account expansion

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108255827A (en) * 2016-12-28 2018-07-06 卓望数码技术(深圳)有限公司 The processing method and system of a kind of hot spot data
CN108615145A (en) * 2018-04-09 2018-10-02 交通银行股份有限公司 A kind of method and system of account parallel access money
CN110569470B (en) * 2019-09-09 2022-03-11 北京字节跳动网络技术有限公司 User matching method and device, readable medium and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1561043A (en) * 2004-02-20 2005-01-05 中兴通讯股份有限公司 Multi-user concurrent insertion device and its method
CN103164256A (en) * 2011-12-08 2013-06-19 深圳市快播科技有限公司 Processing method and system capable of achieving one machine supporting high concurrency
CN103347062A (en) * 2013-06-24 2013-10-09 北京汉柏科技有限公司 Virtual computing resource distribution method
WO2014103112A1 (en) * 2012-12-26 2014-07-03 カルチュア・コンビニエンス・クラブ株式会社 Provision device, program, and provision method
CN104077381A (en) * 2012-05-02 2014-10-01 北京奇虎科技有限公司 Webpage access request handling method and distribution method

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103095741A (en) * 2011-10-27 2013-05-08 阿里巴巴集团控股有限公司 Handling method and system of distributing limited resources by multi-user
CN103325032A (en) * 2012-03-21 2013-09-25 阿里巴巴集团控股有限公司 Data processing method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1561043A (en) * 2004-02-20 2005-01-05 中兴通讯股份有限公司 Multi-user concurrent insertion device and its method
CN103164256A (en) * 2011-12-08 2013-06-19 深圳市快播科技有限公司 Processing method and system capable of achieving one machine supporting high concurrency
CN104077381A (en) * 2012-05-02 2014-10-01 北京奇虎科技有限公司 Webpage access request handling method and distribution method
WO2014103112A1 (en) * 2012-12-26 2014-07-03 カルチュア・コンビニエンス・クラブ株式会社 Provision device, program, and provision method
CN103347062A (en) * 2013-06-24 2013-10-09 北京汉柏科技有限公司 Virtual computing resource distribution method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117808602A (en) * 2024-03-01 2024-04-02 联动优势电子商务有限公司 Hot account billing method and related device based on sub-account expansion

Also Published As

Publication number Publication date
CN105991571B (en) 2019-04-09
CN105991571A (en) 2016-10-05

Similar Documents

Publication Publication Date Title
CN109949111B (en) Electronic bill identification distribution method, electronic bill generation method, device and system
KR101959153B1 (en) System for efficient processing of transaction requests related to an account in a database
US11341131B2 (en) Query scheduling based on a query-resource allocation and resource availability
US11321321B2 (en) Record expansion and reduction based on a processing task in a data intake and query system
US11599541B2 (en) Determining records generated by a processing task of a query
US11580107B2 (en) Bucket data distribution for exporting data to worker nodes
US11442935B2 (en) Determining a record generation estimate of a processing task
US20200364223A1 (en) Search time estimate in a data intake and query system
US20190258637A1 (en) Partitioning and reducing records at ingest of a worker node
JP5719323B2 (en) Distributed processing system, dispatcher and distributed processing management device
WO2016127854A1 (en) Information processing method and device
CN104348679A (en) Bucket testing method, device and system
CN110110006A (en) Data managing method and Related product
CN110457128B (en) Task allocation method, device and system
JP2019512143A (en) Data processing method and apparatus
US11863675B2 (en) Data flow control in distributed computing systems
TW201727517A (en) Data storage and service processing method and device
CN110602215B (en) Resource processing method based on alliance block chain and alliance block chain system
CN115118784A (en) Computing resource scheduling method, device and system
CN104731660B (en) data distributing method, device and system
CN110119396A (en) Data managing method and Related product
WO2024041505A1 (en) Data acquisition method and apparatus, and device
WO2016092604A1 (en) Data processing system and data access method
US10572486B2 (en) Data communication in a distributed data grid
CN106570006A (en) Multimedia file recommendation system and releasing information storage method

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: 16748655

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: 16748655

Country of ref document: EP

Kind code of ref document: A1