Requity-related operation response method and device and storage medium

By cache the user account's equity information to the cache space when preset events, the problem of slow user operation response speed in the online trading system is solved, and faster operation response and higher user experience are achieved.

CN119903534AInactive Publication Date: 2025-04-29BEIJING FENGHUANG XUE YI SCI & TECH CO LTD

Patent Information

Application Number
CN202411957924.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-04-29
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In online trading systems, user operation response speed is slow, especially during payment and other operations, resulting in poor user experience and reduced operation efficiency.

Method used

When a preset event is detected, the user account's equity information is stored in advance from the database to the cache space, and then directly determines whether the user has relevant equity from the cache space during the target operation, and calls the corresponding equity interface to perform the operation.

Benefits of technology

By caching user rights information in advance, frequent access to the database is reduced, operation response speed is improved, user experience and system efficiency are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119903534A_ABST
    Figure CN119903534A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses an operation response method and device related to rights and interests and a storage medium. The operation response method related to the rights and interests comprises the steps that when a preset event is detected, the rights and interests information of a user account stored in a database is stored in a cache space in advance, and when a target operation is detected, whether the user account has the rights and interests related to the target operation or not is determined according to the rights and interests information stored in the cache space; and when the user account has rights and interests related to the target operation, calling a rights and interests interface related to the target operation to execute the target operation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data security technology, and in particular to a rights-related operation response method, device and storage medium. Background Art

[0002] In today's online trading systems, performance has become a top priority, and a 0.1% improvement can bring considerable commercial value. In order to improve user experience and increase user stickiness, the system response needs to be fast and accurate. When a user clicks on payment or other related operations, the payment result must be responded to quickly and accurately. Summary of the invention

[0003] In view of this, the main purpose of the present invention is to provide a method, device and storage medium for operation response related to rights and interests.

[0004] The technical solution of the present invention is achieved in this way:

[0005] The present disclosure provides a method for responding to operations related to rights and interests, including:

[0006] When a preset event is detected, the rights and interests information of the user account stored in the database is stored in the cache space in advance;

[0007] When a target operation is detected, determining whether the user account has rights and interests related to the target operation according to the rights and interests information stored in the cache space;

[0008] When the user account has rights and interests related to the target operation, the rights and interests interface related to the target operation is called to execute the target operation.

[0009] Based on the above solution, the preset event includes at least one of the following:

[0010] A registration event of the user account;

[0011] A login event of the user account;

[0012] The target page opening event related to the target operation execution;

[0013] A hover event of the operation cursor in a target area of ​​the target page, the target area displays a target control related to the target operation, and the display area of ​​the target area is larger than the display area of ​​the target control.

[0014] Based on the above solution, when a preset event is detected, the rights and interests information of the user account stored in the database is stored in the cache space in advance, including:

[0015] When the preset event is detected, a hash table is generated in advance according to the rights and interests information of the user account; the hash table is used to record the rights and interests information of the user account;

[0016] The hash table is cached in the cache space.

[0017] Based on the above solution, the hash table includes: the user account, rights and interests information and rights and interests flag; or,

[0018] The hash table includes: the user account, rights and interests information, rights and interests flag bit and interface information of the rights and interests interface.

[0019] Based on the above solution, the method further includes:

[0020] Receiving a notification message sent by a database; the notification message is used to indicate a change in the rights and interests of the user account;

[0021] According to the notification message, the equity information stored in the cache space is updated.

[0022] Based on the above solution, the method further includes:

[0023] Setting the validity period of the equity information in the cache space;

[0024] When the validity period expires, the cached rights and interests information is discarded or the rights and interests information of the user account is acquired again from the database.

[0025] Based on the above scheme, the target operation includes at least one of the following: payment operation; download operation; view operation; forwarding operation.

[0026] The second aspect provides an operation response device related to rights and interests, including: a storage module, which is used to store the rights and interests information of the user account stored in the database in advance to the cache space when a preset event is detected; a determination module, which is used to determine whether the user account has the rights and interests related to the target operation according to the rights and interests information stored in the cache space when a target operation is detected; and a calling module, which is used to call the rights and interests interface related to the target operation to execute the target operation when the user account has the rights and interests related to the target operation.

[0027] A third aspect provides a computer storage medium storing computer-readable instructions, which can execute the method described in any technical solution of the first aspect after being executed.

[0028] The fourth aspect provides a computer-readable instruction, wherein after being executed, the computer-readable instruction can execute the method described in any technical solution of the first aspect.

[0029] An embodiment of the present invention provides a method, device and storage medium for responding to operations related to rights and interests, which pre-stores the rights and interests information of user accounts stored in a database into a cache space. In this way, when a target operation is detected, it is directly determined whether the user account has rights and interests related to the target operation based on the rights and interests information in the cache space. If there are rights and interests related to the target operation, the rights and interests interface of the rights and interests is called to execute the target operation, so that when the target account has rights and interests, the rights and interests can be used and the efficiency of operation execution will not be reduced due to the use of rights and interests. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 A schematic diagram of a flow chart of a rights-related operation response method provided in some embodiments of the present invention;

[0031] Figure 2 A flowchart of an operation response method related to rights and interests is provided for some embodiments of the present invention;

[0032] Figure 3 A schematic diagram of a flow chart of a rights-related operation response method provided in some embodiments of the present invention;

[0033] Figure 4 A schematic diagram of a flow chart of a rights-related operation response method provided in some embodiments of the present invention;

[0034] Figure 5 A flowchart of an operation response method related to rights and interests is provided for some embodiments of the present invention;

[0035] Figure 6 A schematic diagram of the composition structure of an operation response device related to rights and interests provided in some embodiments of the present invention;

[0036] Figure 7 A schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0037] In some cases, users may purchase in advance or obtain multiple rights through incentive activities. When users purchase a certain product, service, or perform a dictation operation, they need to refer to the relevant rights to determine the payment price and / or the operating parameters for performing the relevant operations. Taking payment as an example, the billing method is to traverse all assets and charge the best. Traversing assets will call asset services, and the network input and output (IO) is huge. However, the actual situation is that not all users have relevant rights information. If the current user downloads information or pays for settlement, the rights settlement interface should not be called without a certain type of rights. This method of traversing and calling the rights interface one by one will lead to unnecessary traversal and calls, resulting in a slow response rate.

[0038] The embodiments of the present invention aim to provide a method, device and storage medium for responding to operations related to rights and interests, aiming to solve problems such as slow response rate and unnecessary calls caused by rights and interests traversal.

[0039] like Figure 1 As shown, the embodiment of the present disclosure provides a method for responding to operations related to rights and interests, which may include:

[0040] S1101: When a preset event is detected, the rights and interests information of the user account stored in the database is stored in the cache space in advance;

[0041] S1102: When a target operation is detected, determining whether the user account has rights and interests related to the target operation according to the rights and interests information stored in the cache space;

[0042] S1103: When the user account has rights and interests related to the target operation, call a rights and interests interface related to the target operation to execute the target operation.

[0043] In some embodiments, the rights-related operation response method may be executed by a server or a terminal device. For example, the server may be a website server, an application server, etc.

[0044] In some embodiments, the preset event may be a trigger event for pre-caching the equity information into the cache space. The preset event usually occurs before the trigger operation of the target operation or the execution of the target operation, rather than reading the equity information from the database during the execution of the target operation. That is, the equity information of the user account is read in advance and stored in the cache space.

[0045] In some embodiments, the rights and interests information of the user account stored in the database is stored in Redis in advance. In this way, when the target operation is detected, it is directly determined whether the user account has rights and interests related to the target operation based on the rights and interests information in the cache space. If there are rights and interests related to the target operation, a rights and interests interface is called to perform the target operation. In some embodiments, if there are no rights and interests related to the target operation, the target operation is directly executed.

[0046] In some embodiments, the rights and interests information may reflect the membership rights and interests of the user account relative to non-member users. For example, the monthly rights and interests of monthly members for watching videos, downloading website materials, and storing network data. Of course, different types of members have different rights and interests. For example, plus members, senior members, and special members have different rights and interests.

[0047] In some embodiments, the rights and interests information may reflect the rights and interests of the user account relative to ordinary users (Very Important Person, VIP). For another example, VIP members may include ordinary VIP members and super VIP members.

[0048] In some embodiments, the equity interface is called to obtain the operation parameters for executing the target operation. Exemplarily, the preferential information for executing the payment operation is obtained by calling the equity interface. Exemplarily, the preferential information may include but is not limited to at least one of the following: preferential amount, discount, red envelope and other information for a single payment. In some embodiments, whether the payment is free can be known by calling the equity interface.

[0049] For example, different members have different network bandwidth rights, for example, some members enjoy unlimited network speed, and there is no upper limit on the network. For another example, some members are monthly users with fixed bandwidth. In this way, when performing Internet access permission operations, corresponding operations can be performed according to the rights of the user account.

[0050] In other embodiments, by calling the equity interface, the first operation parameter of the target operation execution is transmitted to the called equity interface, and after receiving the first operation parameter, the equity interface generates a second operation parameter corresponding to the equity and executes the target operation according to the second operation parameter. For example, user A is preparing to purchase product B, and user A has a discount coupon. When calling the equity interface of the discount coupon, the original price of product B is transmitted to the equity interface. The equity interface determines that the original price meets the discount, and then deducts the discount value from the original price and deducts the amount from the designated account of user A.

[0051] In the disclosed embodiment, when a preset event is detected, the rights and interests information of the user account is cached in advance to the cache space, so that it is not necessary to read the rights and interests information from the hard disk corresponding to the database or to obtain the rights and interests through trial calls of the rights and interests interface one by one through the rights and interests check service after the target operation is started. This can shorten the delay of executing the target operation and improve the response rate.

[0052] In some embodiments, the preset event includes at least one of the following: a registration event of the user account; a login event of the user account; an opening event of a target page related to the execution of the target operation;

[0053] A hover event of the operation cursor in a target area of ​​the target page, the target area displays a target control related to the target operation, and the display area of ​​the target area is larger than the display area of ​​the target control.

[0054] When a user account is newly registered, the type and / or level of the user account may be configured during registration. Thus, when a registration event is detected, the rights and interests information of the user account is read from the database and written into the cache space after the registration is completed, in case of emergency.

[0055] In some embodiments, when a login event of an old user account is detected, it can be considered that a preset event is detected. The login of a user account indicates that the server or client may need to be triggered to perform a target operation, so the equity information can be cached in the cache space in advance.

[0056] In some embodiments, the operation storage that triggers the execution of the target operation is set on the target page, that is, when not all pages will trigger the target operation, when an event of opening the target page (i.e., an open event) is detected, it is considered that a preset event has been detected. In some embodiments, the entrance or space that triggers the execution of the target operation is displayed at a specific location on the target page. In the embodiments of the present disclosure, it can be detected that the operation cursor hovers within the target area containing the target control, and then it is considered that a preset event has been detected. Exemplarily, the target area can be a circular area or a rectangular area with a preset radius centered on the target control.

[0057] Of course, the above are merely examples of preset events, and the specific implementation is not limited to the above examples.

[0058] An application or website may be configured with multiple rights, and these multiple rights may correspond to different rights interfaces. In this case, calling the rights interfaces one by one for trial will obviously lead to unnecessary calls of many rights interfaces, resulting in a large delay in the execution of the target operation. In addition, when the application or website faces a large number of users, some rights interfaces will be busy due to unnecessary calls, further exacerbating the problem of large execution delays of corresponding operations.

[0059] In some embodiments, when a preset event is detected, storing the rights and interests information of the user account stored in the database in the cache space in advance includes:

[0060] When the preset event is detected, a hash table is generated in advance according to the rights and interests information of the user account; the hash table is used to record the rights and interests information of the user account;

[0061] The hash table is cached in the cache space.

[0062] In the embodiment of the present disclosure, in order to facilitate the subsequent reading of the rights and interests information from the cache space to quickly know whether the corresponding user account has the corresponding rights and interests, the rights and interests information will be written in the form of a hash table and stored in the cache space. In this way, on the one hand, the amount of data stored in the form of a hash table is small, and on the other hand, the hash table is retrieved according to the rights and interests associated with the target operation, and the speed is fast.

[0063] In some embodiments, the hash table includes: the user account, rights and interests information, and a rights and interests flag.

[0064] In some embodiments, a user account has a hash table, and all rights and interests of the user account are written into the hash table.

[0065] In some embodiments, the equity information may include an equity name and / or an equity identifier. The equity identifier may be a number and / or a code for the equity. The equity identifier may be composed of a string to identify the equity.

[0066] Exemplarily, the rights flag may include one or more bits, and different bit values ​​of these bits represent having corresponding rights and not having corresponding rights. For example, if the value of bit A is 1, it means that the user account has the rights corresponding to bit A, otherwise the user account does not have the rights corresponding to bit A.

[0067] Exemplarily, "user:{user_account}->{"isMonth":"1","isWxt":"1","isPlus":"1","existCoupon":"1"" is a hash table for a user. For example, "user_account" represents a user account. "isMonth", "isWxt", "isPlus" and "existCoupon" are all rights names in the rights information. The remaining values ​​"1" or "0" are all the values ​​of the rights flag.

[0068] In some embodiments, the hash table includes: the user account, equity information, equity flag bit and interface information of the equity interface.

[0069] For example, when the user account has a certain permission, the rights and interests information, rights and interests flag and interface information of the rights and interests are set adjacently in the hash table. In some embodiments, if the hash table retrieves that the user account has a specific right and interest, the interface information of the rights and interests interface is obtained at the same time, that is, the cache space reads the interface information and calls the corresponding rights and interests interface. In other embodiments, if the hash table does not contain interface information, it is determined that the user account has the corresponding rights and interests by querying and obtaining the interface information of the corresponding rights and interests interface based on the mapping relationship between the rights and interests information and the interface information. If the hash table includes interface information, the query operation of the mapping relationship between the rights and interests information and the interface information can be reduced again.

[0070] In some embodiments, the hash table may include interface information corresponding to each piece of rights and interests information. In other embodiments, in order to reduce the amount of data in the hash table, only the interface information corresponding to the rights and interests of the user account is written into the hash table.

[0071] In some embodiments, the rights and interests information is not limited to a hash table. For example, the rights and interests information of the user account is represented by an array or a vector arranged with keywords. At this time, it can be based on the keyword matching of the rights and interests or the identification information matching of the rights and interests. If the match is successful, it is determined that there is a corresponding right and interest, otherwise it can be considered that there is no corresponding right and interest.

[0072] In some embodiments, Figure 2 As shown, the method also includes:

[0073] S1104: receiving a notification message sent by a database; the notification message is used to indicate a change in the rights and interests of the user account;

[0074] S1105: According to the notification message, update the equity information stored in the cache space.

[0075] In the disclosed embodiment, a message subscription is set between the user service component that performs the above operations and the database. In this way, when the database detects that the rights and interests of a user account have changed, it will actively send a notification message to the user service component, so that the user service component can update the rights and interests information of the user account in the cache space and reduce the incorrect use of rights and interests.

[0076] In some embodiments, the database may store entitlement information for user accounts on disk.

[0077] In some embodiments, the database may include multiple levels of storage space, for example, the storage characteristics of the nth level storage space are better than the storage characteristics of the n+1th level storage space. Exemplarily, the storage characteristics may include: response rate, read / write heat, compression status, etc. For example, the response rate of the nth level storage space is faster than the response rate of the n+1th level storage space. The response rate includes a write rate and / or a read rate. The read / write heat of the nth level storage space is higher than the read / write heat of the n+1th level storage space. The read / write heat includes the total number of accesses, the access frequency, the number of storages of a single data block, and the storage heat. The compression rate of the nth level storage space is lower than the compression rate of the n+1th level storage space. Exemplarily, the information stored in the nth level storage space is not compressed, while the n+1th level storage space is compressed. In some embodiments, the storage medium and / or storage strategy of the nth level storage space and the n+1th level storage space are different. Thus, when storing the rights and interests information of the user account in the database, the rights and interests information of the user account will be stored in the storage space of the corresponding level according to the number of read and write times of the rights and interests information of the user account and / or the read and write frequency in the current period.

[0078] In some embodiments, the user service component transmits the account information of the online user account to the database, so that in S1104, the user service component will receive the notification message sent by the database when it detects the update of the rights and interests of the online user account. For example, after the database receives the online user account information, it can record the online status and / or offline status of the user account. In this case, when the server or the user service component of the server determines that the user account is offline, it sends an offline notification to the database to facilitate the database to record the online status and / or offline status of the user account.

[0079] In some embodiments, when a server or a user service component in a server reads the rights and interests information of a user account from a database, the database or the server or the user service component in the server will set the value of a specified flag. In this way, when the database finds that the rights and interests information of a user account has changed, it can determine whether to send a notification message to the server or the user service component in the server based on the value of the specified flag. For example, when the specified flag has a first value, the database will send a notification message to the server when it detects a change in the rights and interests of the user account. If the specified flag has a second value, when the database detects a change in the rights and interests of the user account, the updated rights and interests information will be directly submitted to the server the next time the user account logs in to the server, thereby reducing unnecessary information interaction between the server or the user service component in the server and the database.

[0080] In some embodiments, the notification message may include at least one of the following: a user account; updated rights and interests information of the user account; updated rights and interests information of the user account.

[0081] If the notification message includes the updated rights and interests information of the user account, it means that the notification message contains the rights and interests information of all rights and interests of the user, and the hash table can be directly regenerated according to the notification message and written into the cache space.

[0082] If the notification message includes the updated rights and interests information of the user account, the rights and interests flag bits of one or more rights and interests in the hash table in the current cache space can be modified according to the notification message. If the notification message includes the updated rights and interests information of the user account, the notification message has the characteristic of less information.

[0083] In some embodiments, the method may include:

[0084] Setting the validity period of the equity information in the cache space;

[0085] When the validity period expires, the cached rights and interests information is discarded or the rights and interests information of the user account is acquired again from the database.

[0086] In some embodiments, a validity period is set for the rights information of the cache space, so that when the validity period expires, the cache space can be released by discarding the rights information, thereby avoiding long-term occupation of the cache space due to not setting a validity period.

[0087] In some embodiments, if the user account is still online when the validity period expires, the rights and interests information of the user account is re-acquired from the database and written into the cache space.

[0088] In some embodiments, if the equity information is discarded by releasing the cache space when the validity period expires, the equity information is written into the cache space again when the preset event is detected again.

[0089] In some embodiments, when the validity period has not expired and it is detected that the user account has been offline for a preset period of time, the cache space is released to reduce unnecessary cache space occupation.

[0090] In some embodiments, the target operation includes at least one of the following: a payment operation; a download operation; a view operation; a forwarding operation. Of course, this is only an example of the target operation, and the specific implementation is not limited to this example.

[0091] In some embodiments, the service components designed for the operation response method related to rights and interests may include: a user service component, a cache component, and an interface service component. The user service component can be used to implement user services such as user registration, login, and preset event detection. The cache service can be used to write rights and interests information into the cache space and read rights and interests information from the cache space. The interface service component can be used to call the rights and interests interface. It can be seen that at least the setting of the rights and interests check service is omitted, reducing the development and maintenance of the rights and interests detection service and the related operations flowing through the rights and interests check service when the target operation is executed. Exemplarily, the interface service component may include a deduction interface service corresponding to the payment operation.

[0092] In other embodiments, the service components designed for the operation response method related to rights and interests may include: user service components, cache components, rights and interests detection service components, and interface service components. After the cache component reads the rights and interests information from the cache space or determines the rights and interests of the user account, it submits the rights and interests information of the corresponding rights and interests to the rights and interests detection service component for the rights and interests detection (or verification) of the rights and interests detection service component to ensure that the target operation related to rights and interests is executed correctly.

[0093] In some embodiments, the business involved in the rights-related operation response method can be applied to a distributed system. The distributed system may include: a first subsystem, a second subsystem, a third subsystem, and a fourth subsystem. These subsystems belong to different security domains. Exemplarily, the first subsystem, the second subsystem, and the third subsystem may implement different business functions for the same or different one or more businesses. In this system, in order to facilitate the login of user accounts, users can use one user account to log in to different subsystems based on single sign-on (Single Sign-On, SSO). The fourth subsystem may be a cache subsystem. For example, the cache subsystem can be used to cache the rights and interests information of user accounts. In order to achieve a fast response to operations such as payment operations, the following requirements need to be met: fast judgment: immediately determine whether the user has a certain right; real-time change: real-time update when the user's rights and interests change; high concurrency and low latency: low latency performance is still maintained in the case of massive concurrency. In this multi-subsystem communication system, the rights and interests information of the user account is stored in the fourth subsystem, so that any subsystem that can execute the target operation can read the rights and interests information from the fourth subsystem to quickly execute the target operation.

[0094] The following two optional methods are provided to meet the above requirements.

[0095] Method 1:

[0096] During the user login phase, when the user logs in, it is necessary to obtain the user's rights and interests information (such as monthly membership, online school rights, plus membership, premium membership, etc.), and then cache this information in Redis. This allows for quick access to this information in subsequent payment or download operations, and pre-filtering of users without rights and interests.

[0097] Specific implementation steps may include:

[0098] When a user logs in, the system obtains all the user's rights and interests information from the database.

[0099] Cache the user's rights and interests information in Redis, using a hash table structure with user:{user_account}->{″isMonth″:″1″,″isWxt″:″1″,″isPlus″:″1″,″existCoupon″:″1″,″existResourceCard″:″1″,″existUserAssets″:″1″} as the key storage.

[0100] Set the cache validity period (TTL) to ensure the timeliness of the data.

[0101] Set the cache storage space. For example, the number of active users in two days is about 500,000. Each key size is about 100 bytes, and the total space occupied by 500,000 users is 100*500000 / 1024 / 1024≈48MB.

[0102] To be notified when the equity changes, for example, Redis needs to subscribe to the change message and update the equity in Redis.

[0103] The specific implementation steps may include: when a user activates or cancels a benefit, a change message is sent to notify the benefit change service. The benefit change service sets the corresponding benefit flag of user:{user_account}->{″isMonth″:″1″,″isWxt″:″1″,″isPlus″:″1″,″existCoupon″:″1″,″existResourceCard″:″1″,″existUserAssets″:″1″} in the hash table structure to 1 or 0 according to the change message. Benefit flag bit description: 0-no benefit; 1-some benefit; 2-unknown.

[0104] During the billing interface call phase, when the user makes a payment or download operation, it is necessary to obtain the user's rights and interests information from the cache, and decide whether to call the corresponding interface based on this information. The specific achievable steps include: obtaining the user's rights and interests information from the Redis cache. Checking whether the user has the required rights and interests. If the user has the corresponding rights and interests, calling the corresponding interface. If the user does not have the required rights and interests, returning the corresponding error message or prompt. In order to implement the above operations, the following functions, functional components or services are introduced in the system.

[0105] Data storage service, set up a database to store the user's basic information and rights information. For example, the database can be Redis. The database can be used to cache the user's rights information, reduce frequent access to the database, and improve response speed.

[0106] The key components to accomplish the above operations may include:

[0107] 1. User Service component, used for user login, registration and other operations. When a user logs in, the user's rights and interests information is obtained from the database and cached in Redis. Redis is used to cache the user's rights and interests information, reducing frequent access to the database and improving response speed.

[0108] 2. The Cache Service component can be used to interact with Redis. It provides the functions of caching user rights information and obtaining user rights information from the cache. When the rights change, the corresponding rights cache is updated.

[0109] 3. The API Service component can be used to obtain all the user's rights and interests information based on the cache service, and make corresponding judgments on whether to call the corresponding payment interface (such as the monthly membership billing interface, the online school rights and interests billing interface, the card billing interface, the resource card billing interface, etc.). The query performance is fast, invalid requests are 100% filtered, and the payment interface call volume has dropped by 58%. In this way, the rights and interests check service in the relevant technology can be omitted, the development and maintenance of the rights and interests check service can be reduced, and the software or instruction size of the system can be reduced.

[0110] Method 2:

[0111] User login stage: When the user logs in, it is necessary to obtain the user's rights and interests information (such as monthly membership, online school rights, plus membership, premium membership, etc.), and then cache this information in Redis. This allows for quick access to this information in subsequent payment or download operations, and pre-filtering of users without rights and interests. Specific steps may include: When the user logs in, the system obtains all the user's rights and interests information from the database. Cache the user's rights and interests information in Redis, using a hash table structure with user: {user account}->{"isMonth":"1","isWxt":"1","isPlus":"1"} as the key for storage. For example Figure 3 As shown, the user login process may include: detecting user login, determining whether the login is successful, sending a login message if the login is successful, consuming the login message, and constructing a rights cache by the rights acquisition service. That is, the rights acquisition service stores the rights information in the cache space.

[0112] This stage can also include: setting the cache validity period (TTL) to ensure the timeliness of data and configuring the capacity of the cache space. Assume that the number of active users is about 500,000. Each value (key) is about 100 bytes in size, and the total space occupied by 500,000 users is 100*500,000 / 1024 / 1024≈48MB.

[0113] Step 2: Notify when changes occur. For example, when user rights change, it is necessary to subscribe to change messages and update the rights in Redis. Specific steps may include: when a user activates / cancels a right, send a change message to notify the rights change service. The rights change service sets the corresponding rights flag of user:{user_account}->{″isMonth″:″1″,″isWxt″:″1″,″isPlus″:″1″} in the hash table structure to 1 or 0 based on the change message. Rights flag bit description: 0 represents no rights; 1 represents a certain right; 2 represents unknown. Figure 4As shown, when a user changes rights, for example, adds or cancels rights, he sends an MQ message. The MQ message can be a message queue (MQ) message. The rights acquisition service updates the rights flag according to the MQ message.

[0114] Step 3: Effective call of the billing interface. When the user makes a payment or download operation, it is necessary to obtain the user's rights and interests information from the cache, and decide whether to call the corresponding interface based on this information. The specific operation steps may include: obtaining the user's rights and interests information from the Redis cache. Check whether the user has the required rights and interests. If the user has the corresponding rights and interests, call the corresponding interface. If the user does not have the required rights and interests, return the corresponding error message or prompt. In order to achieve the above operations, the following functions, functional components or services are introduced in the system. After completing the cache of the above rights and interests information, it is determined according to the user operation that the user is downloading the data, then query all rights and interests caches to determine whether the user has relevant rights and interests. If yes or unknown, request the payment interface to pay for this download. If the user does not have relevant rights and interests, determine whether there is the next right and interests. If the judgment result is no, a pop-up window prompts that there is no relevant right and interests. If the judgment result is yes, continue to determine whether the next right and interests are relevant rights and interests until all rights and interests are determined.

[0115] The data storage service can set up a database. The database is used to store the user's basic information and rights information. For example, the database can be Redis. The database can be used to cache the user's rights information, reduce frequent access to the database, and improve response speed.

[0116] The key components to accomplish the above operations may include:

[0117] 1. User Service component, used for user login, registration and other operations. When a user logs in, it obtains user rights information from the database and caches it in Redis.

[0118] 2. Cache Service component, used to interact with Redis.

[0119] Provides the functions of caching user rights information and obtaining user rights information from the cache.

[0120] When the equity changes, update the corresponding equity cache.

[0121] 3. Rights Check Service component, used to check the user's rights information before payment or download operation.

[0122] Obtain the user's rights and interests information from the cache service and make corresponding judgments.

[0123] 4. The fee deduction API service (API Service) is used to call the corresponding interface (such as the monthly membership billing interface, the online school benefits billing interface, etc.) according to the result of the rights and interests check service. Table 1 below is a comparison of the effect of payment using the method provided in this embodiment.

[0124]

[0125] Table 1

[0126] like Figure 6 As shown, the embodiment of the present disclosure provides an operation response device related to rights and interests, including:

[0127] The storage module 6101 is used to store the rights and interests information of the user account stored in the database into the cache space in advance when a preset event is detected;

[0128] A determination module 6102 is used to determine whether the user account has rights and interests related to the target operation according to the rights and interests information stored in the cache space when a target operation is detected;

[0129] The calling module 6103 is used to call the rights and interests interface related to the target operation to execute the target operation when the user account has rights and interests related to the target operation.

[0130] In some embodiments, the preset event includes at least one of the following: a registration event of the user account; a login event of the user account; an opening event of a target page related to the execution of a target operation; a hovering event of an operation cursor within a target area of ​​the target page, the target area displays a target control related to the target operation, and the display area of ​​the target area is larger than the display area of ​​the target control.

[0131] In some embodiments, the storage module is used to generate a hash table in advance according to the rights and interests information of the user account when the preset event is detected; the hash table is used to record the rights and interests information of the user account; and the hash table is cached in the cache space.

[0132] In some embodiments, the hash table includes: the user account, rights and interests information, and rights and interests flag; or,

[0133] The hash table includes: the user account, rights and interests information, rights and interests flag bit and interface information of the rights and interests interface.

[0134] In some embodiments, the device also includes: a receiving module for receiving a notification message sent by a database; the notification message is used to indicate a change in the rights and interests of the user account; and an updating module for updating the rights and interests information stored in the cache space according to the notification message.

[0135] In some embodiments, the device also includes: a setting module for setting the validity period of the rights and interests information in the cache space; and the storage module for discarding the cached rights and interests information or re-acquiring the rights and interests information of the user account from the database when the validity period expires.

[0136] In some embodiments, the target operation includes at least one of the following: a payment operation; a download operation; a view operation; a forwarding operation.

[0137] The embodiment of the present invention further provides an electronic device, such as Figure 7 As shown, the electronic device includes a processor 501 and a memory 502 connected to the processor 501 via a communication bus 503. The electronic device can be used to execute the rights-related operation response method provided by any of the above technical solutions.

[0138] The processor 501 can at least be used to execute the computer executable instructions to implement the following steps: when a preset event is detected, the rights and interests information of the user account stored in the database is stored in the cache space in advance; when a target operation is detected, it is determined whether the user account has the rights and interests related to the target operation according to the rights and interests information stored in the cache space; when the user account has the rights and interests related to the target operation, the rights and interests interface related to the target operation is called to execute the target operation.

[0139] The processor 501 may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. Here, the program executed by the processor 501 may be stored in a memory 502 connected to the processor 501 via a communication bus 503, and the memory 502 may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disk, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a disk memory or a tape memory. The volatile fast memory can be a random access memory (RAM), which is used as an external cache.By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), direct RAM bus random access memory (DRRAM). The memory 502 described in the embodiment of the present invention is intended to include but is not limited to these and any other suitable types of memory 502. The memory 502 in the embodiment of the present invention is used to store various types of data to support the operation of the processor 501. Examples of such data include: any computer program operated by the processor 501, such as an operating system and application programs; contact data; phone book data; messages; pictures; videos, etc. Among them, the operating system includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., which are used to implement various basic services and process hardware-based tasks.

[0140] In some embodiments, the memory 502 in the embodiments of the present invention may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile fast memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous DRAM (DDRSDRAM), enhanced synchronous DRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus DRAM (DRRAM). The memory 502 of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0141] The processor 501 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit in the processor 501 or the instruction in the form of software. The above processor 501 may be a general processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in the embodiment of the present invention can be directly embodied as a hardware decoding processor to be executed, or the hardware and software modules in the decoding processor are combined to be executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 502, and the processor 501 reads the information in the memory 502 and completes the steps of the above method in combination with its hardware. In some embodiments, the embodiments described herein may be implemented with hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit may be implemented in one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), general purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described herein, or a combination thereof.

[0142] For software implementation, the techniques described herein can be implemented by modules (e.g., procedures, functions, etc.) that perform the functions described herein. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.

[0143] Another embodiment of the present invention provides a computer storage medium, the computer readable storage medium stores an executable program, and when the executable program is executed by the processor 501, the steps of the video processing method applied to the endpoint device can be implemented. Figures 1 to 5 One or more of the methods shown.

[0144] In some embodiments, the computer storage medium may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.

[0145] It should be noted that the technical solutions described in the embodiments of the present invention can be combined arbitrarily without conflict.

[0146] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention.

Claims

1. A method for responding to an operation related to rights and interests, characterized in that: include: When a preset event is detected, the rights and interests information of the user account stored in the database is stored in the cache space in advance; When a target operation is detected, determining whether the user account has rights and interests related to the target operation according to the rights and interests information stored in the cache space; When the user account has rights and interests related to the target operation, the rights and interests interface related to the target operation is called to execute the target operation.

2. The method according to claim 1, characterized in that: The preset event includes at least one of the following: A registration event of the user account; A login event of the user account; The target page opening event related to the target operation execution; A hover event of the operation cursor in a target area of ​​the target page, the target area displays a target control related to the target operation, and the display area of ​​the target area is larger than the display area of ​​the target control.

3. The method according to claim 1 or 2, characterized in that: When a preset event is detected, the rights and interests information of the user account stored in the database is stored in the cache space in advance, including: When the preset event is detected, a hash table is generated in advance according to the rights and interests information of the user account; the hash table is used to record the rights and interests information of the user account; The hash table is cached in the cache space.

4. The method according to claim 3, characterized in that The hash table includes: the user account, rights and interests information and rights and interests flag; or, The hash table includes: the user account, rights and interests information, rights and interests flag bit and interface information of the rights and interests interface.

5. The method according to claim 1 or 2, characterized in that: The method further comprises: Receiving a notification message sent by a database; the notification message is used to indicate a change in the rights and interests of the user account; According to the notification message, the equity information stored in the cache space is updated.

6. The method according to claim 1 or 2, characterized in that: The method further comprises: Setting the validity period of the equity information in the cache space; When the validity period expires, the cached rights and interests information is discarded or the rights and interests information of the user account is acquired again from the database.

7. The method according to claim 6, characterized in that The target operation includes at least one of the following: Payment operations; Download operation; View operations; Forwarding operation.

8. An operation response device related to rights and interests, characterized in that: include: A storage module, used to store the rights and interests information of the user account stored in the database into the cache space in advance when a preset event is detected; a determination module, configured to determine, when a target operation is detected, whether the user account has rights and interests related to the target operation according to the rights and interests information stored in the cache space; The calling module is used to call the rights and interests interface related to the target operation to execute the target operation when the user account has the rights and interests related to the target operation.

9. A computer storage medium, characterized in that: The computer storage medium stores computer-readable instructions, and the computer-readable instructions can execute the method according to any one of claims 1 to 7 after being executed.

10. A computer-readable instruction, characterized in that: After being executed, the computer-readable instructions can perform the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Subscribed withholding method, resource access method and device

    CN112995244A

  • Enterprise user management method and system, electronic equipment and storage medium

    CN114519536A

  • High-performance ISV right and interest system docking method based on HTTP protocol

    CN116957660A

  • Video playing method and device and related equipment

    CN118678157A

  • System and method for caching entitlement sets

    US20030033354A1

Cited By

  • Right delivery-oriented short link suffix high-strength random generation method and system

    CN121598435A