Object interaction method and device, electronic equipment and storage medium
By receiving object interaction requests and updating the comparison of historical cumulative values and limit values, the consistency problem of interactive resource counting in high concurrency is solved, reducing error probability and enhancement of interactive experience.
Patent Information
- Application Number
- CN202310927910.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-26
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2043-07-26
AI Technical Summary
In high concurrency scenarios, it is difficult for business platforms to ensure the consistency of counting results of interactive resources, resulting in errors that are prone to processing object interaction requests, affecting the interactive experience.
By receiving object interaction requests, obtain the limits of target objects and interactive objects, screen historical cumulative values from the preset interactive database, update the overall and individual historical cumulative value, and compare with the limit value Do it.
Effectively ensure the consistency of the counting data of interactive resources, reduce the probability of error when dealing with the interactive request of the object, and enhance the user's interactive experience.
Smart Images

Figure CN119376828A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to an object interaction method, device, electronic device and storage medium. Background Art
[0002] In recent years, with the rapid development of Internet technology, more and more users choose to interact with various business platforms through online operations to complete different businesses. This requires the business platform system to be able to handle a large number of object requests at the same time. For example, during a specific time period, such as during a promotion, an e-commerce platform will face a large number of objects accessing, placing orders and paying at the same time, and it is necessary to have high concurrent processing capabilities to deal with sudden object requests. For example, on social media platforms, a large number of objects post updates, make comments, like, and other operations every day. These operations need to be updated in real time on the pages of other objects, so it is necessary to deal with high concurrent object activity requests.
[0003] In the above interaction process, the object usually requests some interaction resources in the business platform, but the number of interaction resources is limited, so the business platform usually imposes some restrictions on the interaction resources. For example, the number of times an object participates in an activity is restricted in different dimensions. Another example is the need to limit the number of items issued in an activity in different dimensions. Therefore, the business platform needs to count the data of the interaction resources requested by the object in real time in a high-concurrency scenario to determine whether it exceeds the limit.
[0004] During the research and practice of the prior art, the inventors of the present application discovered that since the business platform needs to count interactive resources from multiple different dimensions based on high-concurrency object activity requests, the amount of data involved is huge, and it is difficult to ensure the consistency of the counting results, which makes it easy to make errors when processing object requests, affecting the interactive experience of the object during interaction. Summary of the invention
[0005] The embodiments of the present application provide an object interaction method, device, electronic device and storage medium, which can enhance the interaction experience of interactive objects during interaction.
[0006] The present application provides an object interaction method, including:
[0007] receiving at least one object interaction request for an interactive resource of a target object, wherein the object interaction request carries interaction information of the interactive object for the interactive resource;
[0008] Acquire overall limit values of multiple overall dimensions corresponding to the target object and individual limit values of multiple individual dimensions corresponding to the interactive object;
[0009] Filtering out the historical cumulative value of the interactive resource from a preset interactive database, the historical cumulative value including the overall historical cumulative value of each overall dimension and the individual historical cumulative value of each individual dimension;
[0010] Based on the interaction information, the overall historical cumulative value is updated, and the updated overall historical cumulative value is compared with the overall limit value of the corresponding overall dimension;
[0011] When the updated overall history cumulative value is less than or equal to the overall limit value, the individual history cumulative value is updated, and based on the updated individual history cumulative value and the individual limit value, the target object interacts with the interactive object.
[0012] The present application also provides an object interaction device, including:
[0013] A receiving unit, configured to receive at least one object interaction request for an interactive resource of a target object, wherein the object interaction request carries interaction information of the interactive object for the interactive resource;
[0014] An acquisition unit, used to acquire overall limit values of a plurality of overall dimensions corresponding to the target object and individual limit values of a plurality of individual dimensions corresponding to the interactive object;
[0015] A screening unit, configured to screen out the historical cumulative value of the interactive resource from a preset interactive database, wherein the historical cumulative value includes the overall historical cumulative value of each overall dimension and the individual historical cumulative value of each individual dimension;
[0016] A comparing unit, configured to update the overall historical cumulative value based on the interaction information, and compare the updated overall historical cumulative value with the overall limit value of the corresponding overall dimension;
[0017] The interaction unit is used to update the individual history accumulation value when the updated overall history accumulation value is less than or equal to the overall limit value, and interact the target object with the interaction object based on the updated individual history accumulation value and the individual limit value.
[0018] In some embodiments, the object interaction device further includes:
[0019] An update detection unit, configured to extract a current interaction value of the interaction object for the interaction resource from the interaction information; and perform update detection on the historical accumulated value based on the current interaction value, the overall limit value and the individual limit value;
[0020] The comparison unit is specifically used to update the interaction information when the historical cumulative value meets the update conditions, and update the overall historical cumulative value based on the updated interaction information; and compare the updated overall historical cumulative value with the overall limit value of the corresponding overall dimension.
[0021] In some embodiments, the update detection unit is specifically used to add the current interaction value to the overall historical cumulative value to obtain a candidate overall historical cumulative value, and add the current interaction value to the individual historical cumulative value to obtain a candidate individual historical cumulative value; compare the candidate overall historical cumulative value with the overall limit value of the corresponding overall dimension to obtain an overall comparison result; compare the candidate individual historical cumulative value with the individual limit value of the corresponding individual dimension to obtain an individual comparison result; when the overall comparison result and the individual comparison result both meet the preset detection conditions, it is determined that the historical cumulative value meets the update condition.
[0022] In some embodiments, the object interaction device further includes:
[0023] A condition determination unit is used to determine that both the overall comparison result and the individual comparison result meet the preset detection conditions when the overall comparison result indicates that the overall historical cumulative value is less than the overall limit value of the corresponding overall dimension, and the individual comparison result indicates that the individual historical cumulative value is less than the individual limit value of the corresponding individual dimension.
[0024] In some embodiments, the object interaction device further includes:
[0025] a current interaction value comparison unit, configured to compare the current interaction value with the overall limit value of each overall dimension, and to compare the current interaction value with the individual limit value of each individual dimension;
[0026] The update detection unit is specifically used to add the current interaction value to the overall historical cumulative value to obtain a candidate overall historical cumulative value, including: when the current interaction value is less than the overall limit value and the current interaction value is less than the individual limit value, adding the current interaction value to the overall historical cumulative value to obtain a candidate overall historical cumulative value.
[0027] In some embodiments, the comparison unit is specifically used to update the current interaction value based on the updated interaction information to obtain an updated interaction value; and merge the updated interaction value with the overall historical cumulative value to obtain an updated overall historical cumulative value corresponding to each overall dimension.
[0028] In some embodiments, the preset interaction database includes a non-relational database, and the object interaction device further includes:
[0029] A storage unit is used to store the updated overall historical cumulative value in the non-relational database when the updated overall historical cumulative value is less than or equal to the overall limit value.
[0030] In some embodiments, the interaction unit is specifically used to compare the updated individual history cumulative value with the individual limit value of the corresponding individual dimension; when the updated individual history cumulative value is less than or equal to the individual limit value, the cumulative record of the interaction resource in the interaction object is updated based on the updated individual history cumulative value, and a preset first prompt information is sent to the terminal corresponding to the object interaction request, and the preset first prompt information is used to prompt that the interaction object has successfully interacted with the target object; when the updated individual history cumulative value is greater than the individual limit value, a preset second prompt information is sent to the interaction terminal corresponding to the object interaction request, and the preset second prompt information is used to prompt that the interaction between the interaction object and the target object has failed.
[0031] In some embodiments, the preset interactive database also includes a relational database and a non-relational database, and the storage unit is specifically used to obtain the number of dimensions of the multiple individual dimensions when the updated individual history cumulative value is less than or equal to the individual limit value; when the number of dimensions is greater than or equal to the number threshold, store the updated individual history cumulative value in the relational database; when the number of dimensions is less than the number threshold, store the updated individual history cumulative value in the non-relational database.
[0032] In some embodiments, the object interaction device further includes:
[0033] a system detection unit, configured to perform a system detection on the interactive system corresponding to the interactive resource to obtain a detection result of the interactive system when the updated individual history cumulative value is greater than the individual limit value, or the updated overall history cumulative value is greater than the overall limit value;
[0034] A return execution unit is used to return to execute by writing a message queue when the detection result indicates that there is an error in the interactive system: the step of obtaining the overall limit values of multiple overall dimensions corresponding to the target object and the individual limit values of multiple individual dimensions corresponding to the interactive object, so that the interactive object interacts with the target object.
[0035] In addition, an embodiment of the present application also provides an electronic device, including a memory storing multiple instructions; the processor loads instructions from the memory to execute the steps in any object interaction method provided in the embodiment of the present application.
[0036] In addition, an embodiment of the present application further provides a computer-readable storage medium, which stores a plurality of instructions, and the instructions are suitable for a processor to load to execute the steps in any one of the object interaction methods provided in the embodiment of the present application.
[0037] In addition, an embodiment of the present application also provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps in any object interaction method provided in the embodiment of the present application.
[0038] After receiving at least one object interaction request for an interactive resource of a target object, an embodiment of the present application obtains overall limit values of multiple overall dimensions corresponding to the target object and individual limit values of multiple individual dimensions corresponding to the interactive object; the object interaction request carries interaction information of the interactive object for the interactive resource; then, the historical cumulative value of the interactive resource is screened out from a preset interaction database, wherein the historical cumulative value includes the overall historical cumulative value of each overall dimension and the individual historical cumulative value of each individual dimension; then, based on the interaction information, the overall historical cumulative value is updated, and the updated overall historical cumulative value is compared with the overall limit value of the corresponding overall dimension; when the updated overall historical cumulative value is less than or equal to the overall limit value, the individual historical cumulative value is updated, and based on the updated individual historical cumulative value and the individual limit value, the target object interacts with the interactive object. When the historical accumulated value of the interactive resource is updated according to the object interaction request, the overall historical accumulated value in the historical accumulated value is affected by all object interaction requests, that is, it is greatly affected by the high-concurrency object interaction request, while the individual historical accumulated value is only affected by the corresponding single object interaction request. Therefore, by first updating the overall historical accumulated value, and then updating the individual historical accumulated value after the overall historical accumulated value is successfully updated, so that after the error-prone overall historical accumulated value is successfully updated, if the individual historical accumulated value is successfully updated, it is only necessary to process the erroneous individual historical accumulated value separately, without frequently returning to process the overall historical accumulated value, thereby effectively ensuring the data consistency when updating the historical accumulated value, and finally based on the updated individual historical accumulated value and the individual limit value, the target object interacts with the interactive object, which can reduce the error probability when processing object interaction requests and improve the user's interaction experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0040] Figure 1 This is a schematic diagram of a scenario of the object interaction method provided in an embodiment of the present application;
[0041] Figure 2 is another scenario schematic diagram of the object interaction method provided in an embodiment of the present application;
[0042] Figure 3 It is a flowchart of an object interaction method provided in an embodiment of the present application;
[0043] Figure 4 It is a schematic diagram of the architecture of an electronic device provided in an embodiment of the present application;
[0044] Figure 5 is a flowchart of another object interaction method provided in an embodiment of the present application;
[0045] Figure 6 The embodiment of the present application provides Figure 4 A flowchart diagram of an object interaction method implemented by an architecture;
[0046] Figure 7 is a structural schematic diagram of an object interaction device provided in an embodiment of the present application;
[0047] Figure 8 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0048] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0049] Embodiments of the present application provide an object interaction method, device, electronic device, and storage medium.
[0050] The object interaction device may be integrated into an electronic device, which may be a terminal, a server or other device.
[0051] Among them, the server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, network acceleration services (Content Delivery Network, CDN), as well as big data and artificial intelligence platforms.
[0052] The terminal may be a mobile phone, a tablet computer, a smart Bluetooth device, a laptop computer, or a personal computer (PC).
[0053] In some embodiments, the object interaction apparatus may also be integrated into multiple electronic devices. For example, the object interaction apparatus may be integrated into multiple servers, and the object interaction method of the present application may be implemented by multiple servers.
[0054] In some embodiments, the server may also be implemented in the form of a terminal. Figure 1 , taking the object interaction device integrated in the electronic device 12 as an example, the electronic device 12 can be a server, the server can be connected to the user's interactive terminal 11 in communication, the server can receive at least one object interaction request for the interactive resource of the target object sent by the user's interactive terminal, the object interaction request carries the interactive information of the interactive object for the interactive resource; and obtains the overall limit values of multiple overall dimensions corresponding to the target object and the individual limit values of multiple individual dimensions corresponding to the interactive object; then, the historical cumulative value of the interactive resource is screened out from the preset interactive database, the historical cumulative value includes the overall historical cumulative value of each overall dimension and the individual historical cumulative value of each individual dimension; then, based on the interactive information, the overall historical cumulative value is updated, and the updated overall historical cumulative value is compared with the overall limit value of the corresponding overall dimension; finally, when the updated overall historical cumulative value is less than or equal to the overall limit value, the individual historical cumulative value is updated, and based on the updated individual historical cumulative value and the individual limit value, the target object interacts with the interactive object. Among them, the above-mentioned interactive object can be regarded as a user, the above-mentioned target object can be an object for processing object interaction requests, and the interactive terminal corresponding to the object for processing object interaction requests can be the above-mentioned server.
[0055] In other embodiments, Figure 2As shown, the electronic device 30 can be a server, which can be respectively connected to the first interactive terminal 10 corresponding to the target object and the second interactive terminal 20 corresponding to the interactive object, and the server can receive the object interaction request sent by the first interactive terminal 10, process the object interaction request, and send the processing results to the first interactive terminal 10 and the second interactive terminal 20 respectively. For example, the server can correspond to an online shopping platform, the target object can correspond to a merchant platform, and the interactive object can correspond to a buyer user. The first interactive terminal 10 and the second interactive terminal 20 can include but are not limited to: a mobile phone, a tablet computer, a smart Bluetooth device, a laptop, a personal computer or a server.
[0056] Among them, the object interaction method provided in the embodiment of the present application relates to the field of communication technology, and specifically to an object interaction method.
[0057] Among them, artificial intelligence (AI) is a technology that uses digital computers to simulate human perception of the environment, acquire knowledge and use knowledge. This technology can enable machines to have functions similar to human perception, reasoning and decision-making. The basic technologies of artificial intelligence generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, and mechatronics. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, as well as machine learning / deep learning, autonomous driving, and smart transportation.
[0058] Distributed storage is a storage method that stores data in multiple physical nodes. Compared with traditional centralized storage, distributed storage has higher scalability, reliability and performance.
[0059] In a distributed storage system, data is divided into multiple blocks or objects and then stored in different nodes. These nodes can be physical servers, virtual machines, or instances of cloud service providers. Each node is usually responsible for storing a portion of the data and provides read and write access interfaces.
[0060] The following are some key concepts and characteristics of distributed storage:
[0061] Data redundancy: To improve reliability and fault tolerance, data is usually stored redundantly. Redundant copies can be stored on different nodes, so that when a node fails, data can still be obtained from other nodes.
[0062] Data Sharding: Data can be divided into multiple smaller fragments or blocks and these blocks can be stored on different nodes. This can improve the reading and writing performance of data and allow horizontal expansion of storage capacity.
[0063] Data consistency: Distributed storage systems need to ensure data consistency across different nodes. Common methods include replication protocols (such as Paxos or Raft) and consistent hashing algorithms.
[0064] Data access: Distributed storage systems provide various data access interfaces, such as key-value based, document-oriented, column-based, or file system interfaces. These interfaces allow applications to obtain and modify stored data on demand.
[0065] Scalability: Distributed storage systems can be expanded horizontally as needed by adding more nodes to increase storage capacity and processing power. This allows for the handling of large-scale data and high concurrent access needs.
[0066] It should be noted that the design and deployment of distributed storage systems is complex and requires consideration of factors such as data consistency, performance, security, and reliability. In practice, it is necessary to select appropriate distributed storage technologies and architectures based on specific scenarios and requirements.
[0067] It can be understood that in the specific implementation of the present application, it involves object interaction requests, interaction information, overall limit values, individual limit values, historical cumulative values, age, region and other related data. When the following embodiments of the present application are applied to specific products or technologies, permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0068] It should be noted that the description order of the following embodiments is not intended to limit the preferred order of the embodiments.
[0069] This embodiment will be described from the perspective of an object interaction device, which can be specifically integrated into an electronic device, which can be a server or a terminal; wherein the terminal can include a tablet computer, a laptop computer, a personal computer (PC), or other smart devices that can perform data processing.
[0070] In this embodiment, an object interaction method involving communication technology is provided, such as Figure 3 As shown, the specific process of the object interaction method can be as follows:
[0071] 101. Receive at least one object interaction request for an interactive resource of a target object, where the object interaction request carries interaction information of the interactive object for the interactive resource.
[0072] Among them, the interactive resources can be resources used to realize online interaction between the target object and the interactive object. For example, the interactive object can obtain the interactive resources of the target object by requesting the target object, thereby realizing the interaction with the target object. Among them, the interactive resources can be physical resources (such as physical goods sold by certain merchants) or virtual resources (for example, participation quotas for certain activities), which are not limited here. Among them, interactive resources can have different meanings in different scenarios. For example, in the scenario of online shopping, the interactive resources can be goods on sale; for example, in the scenario of online ticket booking, the interactive resources can be remaining tickets; for example, in the scenario of online course selection, the interactive resources can be quotas for a certain course; and so on.
[0073] The target object is an object that provides interactive resources, such as a merchant platform for selling goods, a host platform for holding events, an exam registration platform, and a course selection platform. It is understandable that there can be one or more target objects, and each target object can correspond to one or more interactive resources, that is, a target object can provide one interactive resource or multiple interactive resources at the same time, which is not limited here.
[0074] The interactive object is an object that requests interactive resources, such as a buyer who needs to purchase goods, a user who needs to participate in an activity, a candidate who needs to register for an exam, and a student who selects a course. In addition to individual users, the interactive object can also be a company, an institution, etc.
[0075] The interaction information may include a resource identifier of the interaction resource and an interaction value for the interaction resource, wherein the resource identifier of the interaction resource is used to determine which interaction resource in the target object the interaction object requests to obtain, and the interaction value represents the number of interaction resources requested to obtain by the interaction object.
[0076] The object interaction request is a request for the interactive object to obtain interactive resources from the target object, and the object interaction request carries interactive information, wherein the object interaction request can be used to instruct the electronic device to recount the interactive resources according to the interactive value in the object interaction request, and determine whether to issue the interactive resources to the interactive object according to the result of the recount. For example, the electronic device can accumulate the interactive value based on the original number of interactive resources according to the object interaction request to obtain the latest number of interactive resources, and can issue the interactive resources to the interactive object when it is determined that the latest number of interactive resources does not exceed a preset upper limit. The preset upper limit can be a custom setting of the target object on the electronic device according to its actual needs.
[0077] In some embodiments, the interactive object may send at least one object interaction request to the electronic device through its corresponding terminal. After the electronic device receives the at least one object interaction request, each object transaction request in the at least one object interaction request may be processed separately. The at least one object interaction request may be sent by the same interactive object or by different interactive objects, without limitation. The terminal corresponding to the interactive object may include, but is not limited to, devices such as smart phones, tablet computers, smart Bluetooth devices, laptop computers, and personal computers.
[0078] 102. Obtain overall limit values of multiple overall dimensions corresponding to the target object and individual limit values of multiple individual dimensions corresponding to the interactive object.
[0079] Among them, the individual dimension is a limiting dimension of the number of interactive resources issued set for a single interactive object, wherein the limiting dimension represents the dimension in which the number of interactive resources issued is limited, that is, for a single interactive object, the number of interactive resources issued can be limited from the individual dimension corresponding to the single interactive object. For example, the individual dimension corresponding to the single interactive object is region A. When the single interactive object is in region A, the number of interactive resources issued by the single interactive object is limited, for example, it cannot exceed the number of issued corresponding to region A. It can be understood that an individual dimension can be regarded as an aspect (or angle) in which the number of interactive resources issued is limited, and different individual dimensions are regarded as limiting the number of interactive resources issued from different aspects (or angles). For example, the individual dimension can include a specific time period, a specific region, a specific country, etc. It can be understood that the individual dimension can be a sub-dimension of the individual type dimension, wherein the individual type dimension can include one or more sub-dimensions of the same type. For example, the individual dimension can be obtained by taking the dimension value of the individual type dimension, wherein the dimension value can be used to determine a corresponding individual dimension from the individual type dimension. For example, the individual type dimension can be a time dimension, and correspondingly, the dimension value can be different time periods. For example, the dimension value is the first half of the year, the second half of the year, a certain month, etc., and the corresponding individual dimension is the first half of the year, the second half of the year, a certain month. For another example, the individual type dimension can be a country dimension, and the dimension value can be different countries. For example, if the dimension value is country A, then country A can be used as an individual dimension. Among them, the so-called individual can refer to a single interaction object. For example, an interaction object can be used as an individual, and multiple interaction objects can be used as multiple individuals in one-to-one correspondence.
[0080] The individual type dimension may include, but is not limited to, time, age, gender, region, country, etc. The time dimension may include time point, time period, etc., which are not limited here. The multiple individual dimensions corresponding to different interactive objects may be different. For example, the multiple individual dimensions corresponding to interactive object a include time and age, while the multiple individual dimensions corresponding to interactive object b include time, age, and region.
[0081] Among them, the individual limit value is the upper limit of the number of interactive resources issued for a single interactive object. For example, for interactive object b, its corresponding individual limit value is 100, then interactive object b can only obtain a maximum of 100 interactive resources from the target object. It can be understood that the individual limit values of multiple individual dimensions mean that each individual dimension in the multiple individual dimensions corresponds to an individual limit value. Among them, the individual limit values corresponding to different individual dimensions can be different or the same, and are not limited here. As an example, for example, for interactive object b, its corresponding multiple individual dimensions may include time, age, and region, and its corresponding individual limit value under the time dimension (such as within a week) is 50, the corresponding individual limit value under the age dimension (such as under 18 years old) is 30, and the corresponding individual limit value under the regional dimension (such as region A) is 40. Among them, under the same individual dimension, the dimension values are different, and the corresponding individual limit values may also be different. Among them, the dimension value refers to the variable used in the same dimension. For example, under the age dimension, the dimension value may include under 18 years old, over 18 years old, and so on; for another example, under the region dimension, the dimension value may include region A, region B, and so on. It can be understood that the dimension value corresponding to the individual dimension can be called the individual dimension value. The individual dimension in this embodiment can also refer to the individual dimension after the individual dimension value is determined. For example, under the age dimension, under 18 years old can be used as an individual dimension. Using the above example, taking the interactive object b as an example, under the age dimension, when the interactive object b is under 18 years old, the corresponding individual limit value is 30, and when the interactive object b is over 18 years old, the corresponding individual limit value is 50. For another example, under the region dimension, when the interactive object b is in region A, the corresponding individual limit value is 40, and when the interactive object b is in region B, the corresponding individual limit value is 20. For another example, in the time dimension, from the first time the interactive object b acquires the interactive resource to the current timing time, when the timing time does not exceed one week, the corresponding individual limit value is 50; when the timing time exceeds one week, the corresponding individual limit value is 100; when the timing time exceeds one month, the corresponding individual limit value is 300.
[0082] Among them, the overall dimension is a restriction dimension on the number of interactive resources issued set for all interactive objects, wherein the restriction dimension represents the dimension in which the number of interactive resources issued is restricted, that is, for all interactive objects, the number of interactive resources issued can be restricted from the overall dimension corresponding to all interactive objects. For example, if the overall dimension corresponding to all interactive objects is country B, then the number of interactive resources issued by all interactive objects in country B is restricted, for example, it cannot exceed the number of issued corresponding to country B. For example, the overall dimension may include a specific country, a specific region, a specific time, etc. Among them, the so-called overall may refer to the whole composed of all interactive objects, for example, if a single interactive object is regarded as an individual, then all individuals can be regarded as a whole. It can be understood that the overall dimension may be a sub-dimension of the overall type dimension, wherein the overall type dimension may include one or more sub-dimensions of the same type. For example, the overall dimension may be obtained by taking the dimension value of the overall type dimension, wherein the dimension value may be used to determine a corresponding overall dimension from the overall type dimension. For example, the overall type dimension may be a time dimension, and correspondingly, the dimension value may be different time periods, for example, the dimension value is the first half of the year, the second half of the year, etc., and the corresponding overall dimension is the first half of the year, the second half of the year. For another example, the overall type dimension may be a regional dimension, and the dimension value may be different countries. For example, if the dimension value is country B, then country B may be used as an overall dimension. The overall type dimension may include, but is not limited to, time, region, country, and other dimensions.
[0083] Among them, the overall limit value is the upper limit of the number of interactive resources issued for all interactive objects. For example, for all interactive objects, the corresponding overall limit value is 1000, then all interactive objects can only obtain 1000 interactive resources from the target object in total. It can be understood that the overall limit values of multiple overall dimensions indicate that each overall dimension in the multiple overall dimensions corresponds to an overall limit value. Among them, the overall limit values corresponding to different overall dimensions can be different or the same, and are not limited here. Taking the overall type dimension as the country dimension as an example, if the dimension value is country A, the corresponding overall dimension is country A. If the overall limit value corresponding to country A can be 2000, it means that the target object provides a total of 2000 interactive resources to all interactive objects in country A. Taking the overall type dimension as the time dimension as an example, if the dimension value is the period from time a to time b, the overall dimension is from time a to time b. When in the period from time a to time b, the corresponding overall limit value is 1000, which means that the target object provides a total of 1000 interactive resources to all interactive objects in the period from time a to time b.
[0084] In some implementations, a specific implementation of obtaining overall limit values of multiple overall dimensions corresponding to the target object and individual limit values of multiple individual dimensions corresponding to the interactive object may include:
[0085] The overall limit values of multiple overall dimensions corresponding to the target object and the individual limit values of multiple individual dimensions corresponding to the interactive object are obtained from a preset configuration database.
[0086] Among them, the configuration database may include configuration files (such as conf files), which allow users to configure the database extensively, including the behavior of the database server, performance optimization, security settings, etc. The user can use a text editor to open the corresponding configuration file and configure it according to the instructions in the comments or documents. In the configuration file, the user can find and modify some important configuration options, such as: database storage path, buffer size and cache settings, maximum connection limit, security settings, such as user authentication and access control, logging settings, character set and sorting rules, etc. It can be understood that since the configuration file can put some file paths that the user wants to access or open, it is sufficient to change the configuration file directly without changing the code. In this embodiment, the overall limit values of multiple overall dimensions corresponding to the target object and the individual limit values of multiple individual dimensions corresponding to the interactive object can be configured into the configuration database through the configuration file. Exemplarily, the overall type dimension, individual type dimension, and dimension value that the user needs to expand can be configured into the configuration database, so that multiple overall dimensions can be obtained through the overall type dimension and dimension value, and multiple individual dimensions can be obtained through the individual type dimension and dimension value. In this way, when users want to adjust (such as modify, add, or delete) the overall type dimension or individual type dimension, they can directly modify the corresponding field in the configuration file without having to rewrite the code. This avoids the problem of requiring additional development and requiring an iterative version of the service to support the need to limit the new dimension, thereby improving interaction efficiency.
[0087] The configuration database may be set locally in the electronic device, or may be set in a cloud device for data storage that is connected to the electronic device for communication, and there is no limitation on this. The configuration database pre-stores a plurality of interaction rule information, and each interaction rule information may include overall interaction rule information and individual interaction rule information. The overall interaction rule information represents the restriction rules for the whole that includes all interaction objects when acquiring interaction resources, and the individual interaction rule information represents the restriction rules for each interaction object when acquiring interaction resources. The overall interaction rule information may include a first mapping relationship between a target object, an interaction resource, an overall dimension, and an overall restriction value. Exemplarily, the first mapping relationship may be as shown in Table 1.
[0088] Table 1
[0089]
[0090] The individual interaction rule information may include a second mapping relationship between a target object, an interaction object, an interaction resource, an individual dimension, and an individual restriction value.
[0091] Table 2
[0092]
[0093]
[0094] As an example, the object interaction request also carries a first object identifier, a second object identifier, an interaction resource identifier, and an interaction rule identifier, wherein the first object identifier is used to identify a target object corresponding to the object interaction request from a plurality of preset target objects, and the second object identifier is used to identify an interaction object corresponding to the object interaction request from a plurality of preset interaction objects; the interaction resource identifier is used to identify an interaction resource corresponding to the object interaction request from a plurality of interaction resources; and the interaction rule identifier is used to identify interaction rule information corresponding to the object interaction request from a plurality of preset interaction rule information. Among them, the identifiers in the first object identifier, the second object identifier, the interaction resource identifier, and the interaction rule identifier can be a name or an identity document (ID), which is not limited to this.
[0095] After the electronic device obtains an object interaction request, it can first extract the interaction rule identifier from the object interaction request to obtain the corresponding interaction rule information from the configuration database, and then filter the interaction rule information based on the first object identifier, the second object identifier, and the interaction resource identifier to obtain the corresponding individual restriction value and the overall restriction value.
[0096] Following the above example, the interaction rule information obtained by the electronic device according to the object interaction request includes Table 1 and Table 2. For example, the first object identifier, the second object identifier, and the interaction resource identifier extracted by the electronic device from the object interaction request are the target object a, the interaction object 2, the interaction resource a, and the target object a, respectively. Then, according to Table 1, it can be determined that the multiple overall dimensions corresponding to the target object a include overall dimension 1 and overall dimension 2, and the overall restriction value corresponding to the overall dimension 1 is M1, and the overall restriction value corresponding to the overall dimension 2 is M2; and according to Table 2, it can be determined that the multiple individual dimensions corresponding to the interaction object 2 include individual dimension 2 and individual dimension 3, and the individual restriction value corresponding to the individual dimension 2 is N3, and the individual restriction value corresponding to the individual dimension 4 is N4. Thus, the overall restriction values of the multiple overall dimensions corresponding to the target object and the individual restriction values of the multiple individual dimensions corresponding to the interaction object are obtained.
[0097] 103. Filter out historical cumulative values of interactive resources from a preset interactive database, where the historical cumulative values include overall historical cumulative values of each overall dimension and individual historical cumulative values of each individual dimension.
[0098] The overall historical cumulative value is the cumulative number of interactive resources recorded for all interactive objects up to now. Under different overall dimensions, the overall historical cumulative value is different. For example, the overall historical cumulative value of interactive resource a in country A is 100, while the overall historical cumulative value of interactive resource a in country B is 50. For another example, in the most recent month, the overall historical cumulative value of interactive resource a is 100, and in the most recent year, the overall historical cumulative value of interactive resource a is 1000. For example, in the scenario where the target object issues interactive resources, the overall historical cumulative value can also be regarded as the total amount of interactive resources that the target object has issued to all interactive objects.
[0099] The individual history cumulative value is the cumulative number of interaction resources recorded for a single interaction object up to the present. For example, the interaction objects include user A and user B. There is one individual history cumulative value for user A and another individual history cumulative value for user B. For an interaction object, its individual history cumulative value is different under different overall dimensions. For example, taking user A as an example, the individual history cumulative value corresponding to user A in region A is different from the individual history cumulative value corresponding to user A in region B.
[0100] The preset interaction database may be used to store relevant data generated by processing object interaction requests, wherein the relevant data includes but is not limited to the information carried by the object interaction request, and the overall historical cumulative value and the individual historical cumulative value updated based on each object interaction request. The preset interaction database may be composed of one or more types of databases. For example, the preset interaction database may include at least one of a relational database and a non-relational database, wherein the relational database may include a MySQL database or an enterprise-level distributed database (TDSQ). The relational database may include a remote dictionary service database (Remote Dictionary Server, Redis). The preset interaction database may be set locally in the electronic device, or in a cloud device for data storage that is communicatively connected to the electronic device, without limitation.
[0101] In some implementations, a specific implementation of filtering out the historical accumulated value of the interaction resource from the preset interaction database may include:
[0102] According to the first object identifier, the second object identifier, the interactive resource identifier, and the interactive rule information carried in the object interaction request, the historical cumulative value of the interactive resource is screened out from the preset interactive database. Among them, the preset interactive database stores the third mapping relationship between the target object, the interactive object, the interactive resource, the personal dimension, and the individual cumulative value. In addition, the preset interactive database also stores the fourth mapping relationship between the target object, the interactive resource, the overall dimension, and the overall cumulative value. As an example, the third mapping relationship can be shown in Table 3, and the fourth mapping relationship can be shown in Table 4.
[0103] Table 3
[0104]
[0105] Table 4
[0106]
[0107] According to Table 3, after obtaining the object interaction request, the individual dimension for which the individual historical cumulative value needs to be obtained can be determined based on the interaction rule information in the object interaction request, and then the corresponding individual historical cumulative value can be screened out from Table 3 based on the individual dimension, the first object identifier, the second object identifier, and the interaction resource identifier. According to Table 4, after obtaining the object interaction request, the object interaction request can first determine the overall dimension for which the overall historical cumulative value needs to be obtained based on the interaction rule information, and then the corresponding overall historical cumulative value can be screened out from Table 4 based on the overall dimension, the first object identifier, and the interaction resource identifier. Thus, the historical cumulative value of the interaction resource is obtained. It can be understood that the individual historical cumulative values in Table 3 and the overall historical cumulative values in Table 4 are updated in real time according to the object interaction request.
[0108] Exemplarily, for example, the first object identifier, the second object identifier, and the interactive resource identifier extracted by the electronic device from the object interaction request are the target object a, the interactive object 2, the interactive resource a, and the target object a, respectively. Then, it can be determined according to Table 1 that the multiple overall dimensions corresponding to the target object a include overall dimension 1 and overall dimension 2, and the overall historical cumulative value corresponding to the overall dimension 1 is L1, and the overall historical cumulative value corresponding to the overall dimension 2 is L2; and according to Table 2, it can be determined that the multiple individual dimensions corresponding to the interactive object 2 include individual dimension 2 and individual dimension 3, and the individual historical cumulative value corresponding to the individual dimension 2 is K3, and the individual historical cumulative value corresponding to the individual dimension 4 is K4.
[0109] As an example, taking the preset interactive database as Redis (a cross-platform non-relational database) database as an example, based on the object interaction request, the individual dimension and overall dimension for which the historical cumulative value needs to be obtained can be obtained, and then the individual dimension, overall dimension, interactive resource identifier, first object identifier, and second object identifier are assembled to obtain the Redis key (key value of the database), and finally the historical cumulative value to be obtained is determined from the Redis database based on the Redis key. Among them, the Redis key is the key value in the Redis database. Each data in the Redis database is identified by a unique key (key). The key value of Redis is globally unique, so it is very important to ensure that there will be no conflict with other data when using the key.
[0110] 104. Based on the interactive information, the overall historical cumulative value is updated, and the updated overall historical cumulative value is compared with the overall limit value of the corresponding overall dimension.
[0111] In some implementations, specific implementations of updating the overall historical cumulative value based on the interaction information may include:
[0112] Extract the interaction value in the interaction information, and then for the overall historical cumulative value corresponding to each overall dimension, add the interaction value to the overall historical cumulative value to obtain the updated overall historical cumulative value corresponding to each overall dimension. For example, taking the first object identifier, the second object identifier, and the interactive resource identifier extracted by the electronic device from the object interaction request as the target object a, the interactive object 2, the interactive resource a, and the target object a as an example, then according to Table 4, it can be determined that the multiple overall dimensions corresponding to the target object a include overall dimension 1 and overall dimension 2, and the overall historical cumulative value corresponding to the overall dimension 1 is L1, and the overall historical cumulative value corresponding to the overall dimension 2 is L2. If the interaction value is D, then it can be determined that the updated overall historical cumulative value corresponding to the overall dimension 1 is (L1+D), and the updated overall historical cumulative value corresponding to the overall dimension 2 is (L2+D).
[0113] Therein, the updated overall historical cumulative value is compared with the overall limit value of the corresponding overall dimension.
[0114] Continuing with the above example, the updated overall historical cumulative value (L1+D) corresponding to overall dimension 1 can be compared with the overall limit value M1 corresponding to overall dimension 1 to obtain a comparison result indicating whether (L1+D) exceeds M1. The updated overall historical cumulative value (L2+D) corresponding to overall dimension 2 can be compared with the overall limit value M2 corresponding to overall dimension 2 to obtain a comparison result indicating whether (L2+D) exceeds M2.
[0115] After filtering out the historical accumulated values of the interaction resources from the preset interaction database, the following steps are also included:
[0116] A1, extracting the current interaction value of the interaction object for the interaction resource from the interaction information.
[0117] The current interaction value may be an interaction value carried in an object interaction request currently received by the electronic device.
[0118] A2, based on the current interaction value, overall limit value and individual limit value, the historical cumulative value is updated and tested.
[0119] In step A2, the specific implementation of updating and detecting the historical cumulative value based on the current interaction value, the overall limit value and the individual limit value may include:
[0120] A21. Add the current interaction value to the overall historical cumulative value to obtain a candidate overall historical cumulative value, and add the current interaction value to the individual historical cumulative value to obtain a candidate individual historical cumulative value.
[0121] Exemplarily, taking the current interaction value as D1, the first object identifier, the second object identifier, and the interaction resource identifier in the object interaction request as the target object a, the interaction object 2, the interaction resource a, and the target object a as an example, for each overall dimension (e.g., overall dimension 1 and overall dimension 2), the overall historical cumulative value L1 corresponding to the overall dimension 1 is added to the current interaction value D1 to obtain the candidate overall historical cumulative value (L1+D1) corresponding to the overall dimension 1, and the overall historical cumulative value L2 corresponding to the overall dimension 2 is added to the current interaction value D1 to obtain the candidate overall historical cumulative value (L2+D1) corresponding to the overall dimension 2. For each individual dimension (e.g., individual dimension 2 and individual dimension 3), the individual historical cumulative value K3 corresponding to the individual dimension 2 is added to the current interaction value D1 to obtain the candidate individual historical cumulative value (K3+D1) corresponding to the individual dimension 2, and the individual historical cumulative value K4 corresponding to the individual dimension 2 is added to the current interaction value D1 to obtain the candidate individual historical cumulative value (K4+D1) corresponding to the individual dimension 2.
[0122] Wherein, before the current interaction value is added to the overall historical cumulative value to obtain the candidate overall historical cumulative value, it also includes:
[0123] The current interaction value is compared to the overall limit value for each overall dimension, and the current interaction value is compared to the individual limit value for each individual dimension.
[0124] Continuing with the above example, for example, according to Table 1, the overall limit value corresponding to the overall dimension 1 is M1, and the overall limit value corresponding to the overall dimension 2 is M2. According to Table 2, the individual limit value corresponding to the individual dimension 2 is N3, and the individual limit value corresponding to the individual dimension 3 is N4. Then, by comparison, it can be determined whether the current interaction value D1 exceeds the overall limit value M1, whether the current interaction value D1 exceeds the overall limit value M2, whether the current interaction value D1 exceeds the individual limit value N3, and whether the current interaction value D1 exceeds the individual limit value N4, and the corresponding comparison results can be obtained.
[0125] Accordingly, the current interaction value is added to the overall historical cumulative value to obtain a candidate overall historical cumulative value, including: when the current interaction value is less than the overall limit value and the current interaction value is less than the individual limit value, the current interaction value is added to the overall historical cumulative value to obtain a candidate overall historical cumulative value.
[0126] Continuing with the above example, if the current interaction value D1 does not exceed any one of the overall limit value M1, the overall limit value M2, the individual limit value N3, and the individual limit value N4, then the step of adding the current interaction value to the overall historical cumulative value to obtain the candidate overall historical cumulative value can be executed.
[0127] Considering that if the current interaction value in the interactive object request directly exceeds the overall limit value or the individual limit value, then the historical cumulative value obtained by accumulating the current interaction value will inevitably exceed the limit value, resulting in the inevitable failure of the interaction. Therefore, in this embodiment, it is possible to first determine whether the current interaction value in the interactive object request exceeds the overall limit value or the individual limit value to preliminarily filter out invalid object interaction requests, thereby improving the interaction efficiency.
[0128] A22. Compare the candidate population historical cumulative value with the population limit value of the corresponding population dimension to obtain the overall comparison result.
[0129] Continuing with the above example, for example, for overall dimension 1, the candidate overall historical cumulative value (L1+D1) can be compared with the overall limit value M1 to obtain the overall comparison result corresponding to the overall dimension 1; for overall dimension 2, the candidate overall historical cumulative value (L2+D1) can be compared with the overall limit value M2 to obtain the overall comparison result corresponding to the overall dimension 2.
[0130] A23. Compare the candidate individual historical cumulative value with the individual limit value of the corresponding individual dimension to obtain an individual comparison result.
[0131] Continuing with the above example, for individual dimension 2, the candidate individual historical cumulative value (K3+D1) can be compared with the individual limit value N3 to obtain the overall comparison result corresponding to individual dimension 2; for individual dimension 3, the candidate individual historical cumulative value (K4+D1) can be compared with the individual limit value N4 to obtain the individual comparison result corresponding to individual dimension 3.
[0132] A24. When both the overall comparison result and the individual comparison result meet the preset detection conditions, it is determined that the historical cumulative value meets the update conditions.
[0133] The specific implementation method of performing the preset detection condition detection on the overall comparison result and the individual comparison result can be as follows:
[0134] When the overall comparison result indicates that the overall historical cumulative value is less than the overall limit value of the corresponding overall dimension, and the individual comparison result indicates that the individual historical cumulative value is less than the individual limit value of the corresponding individual dimension, it is determined that both the overall comparison result and the individual comparison result meet the preset detection conditions.
[0135] Continuing with the above example, for example, when the candidate overall historical cumulative value (L1+D1) is less than the overall limit value M1, the candidate overall historical cumulative value (L2+D1) is less than the overall limit value M2, the individual historical cumulative value (K3+D1) is less than the individual limit value N3, and the individual historical cumulative value (K4+D1) is less than the individual limit value N4, it can be determined that both the overall comparison result and the individual comparison result meet the preset detection conditions, and then it can be determined that the historical cumulative value meets the update conditions.
[0136] In some embodiments, considering that the frequency of high concurrency of the candidate overall historical cumulative value is greater than the candidate individual historical cumulative value, it is possible to determine whether the individual comparison result meets the preset detection condition after determining that the overall comparison result meets the preset detection condition, thereby improving the detection efficiency of the preset detection condition.
[0137] Accordingly, in step 104, based on the interaction information, the overall historical cumulative value is updated, and the specific implementation of comparing the updated overall historical cumulative value with the overall limit value of the corresponding overall dimension may include:
[0138] A3: When the historical cumulative value meets the update condition, the interaction information is updated, and based on the updated interaction information, the overall historical cumulative value is updated.
[0139] The specific implementation of updating the interaction information may include: determining the moment of receiving the object interaction request (i.e., receiving the current interaction information) as the first moment, determining the moment of determining that the historical cumulative value meets the update condition as the second moment, if no other object interaction requests other than the object interaction request corresponding to the current interaction information are detected during the period from the first moment to the second moment, the current interaction information may be determined as the updated interaction information, if other object interaction requests other than the object interaction request corresponding to the current interaction information are detected during the period from the first moment to the second moment, the interaction information in the other object interaction requests may be extracted and fused with the current interaction information to obtain the updated interaction information. The fusion process includes but is not limited to adding the interaction value corresponding to the current interaction information to the interaction value corresponding to the interaction information in the other object interaction requests.
[0140] In step A3, the specific implementation of updating the overall historical cumulative value based on the updated interaction information may include:
[0141] A31, based on the updated interaction information, update the current interaction value to obtain an updated interaction value.
[0142] Exemplarily, for example, the updated interaction information can be represented by D2. Using the above example, for example, if other object interaction requests other than the object interaction request corresponding to the current interaction information are detected during the period from the first moment to the second moment, and the interaction information in the other object interaction requests includes the interaction value d0, then the interaction value d0 can be added to the current interaction value D1 to obtain the updated interaction value D2, where D2=D1+d0, and the updated interaction value D2 is used as the interaction value in the updated interaction information. If no other object interaction requests other than the object interaction request corresponding to the current interaction information are detected during the period from the first moment to the second moment, then the interaction value in the current interaction information can be determined as the updated interaction value, that is, D2=D1.
[0143] A32, merge the updated interaction value with the overall historical cumulative value to obtain the updated overall historical cumulative value corresponding to each overall dimension.
[0144] Continuing with the above example, for each overall dimension (for example, overall dimension 1 and overall dimension 2), the overall historical cumulative value L1 corresponding to the overall dimension 1 can be added to the updated interaction value D2 to obtain the updated overall historical cumulative value (L1+D2) corresponding to the overall dimension 1, and the overall historical cumulative value L2 corresponding to the overall dimension 2 can be added to the updated interaction value D2 to obtain the updated overall historical cumulative value (L2+D2) corresponding to the overall dimension 2.
[0145] Among them, the updated interaction value and the overall historical cumulative value are merged, and weighted summation processing can also be performed after assigning weight values to the updated interaction value and the overall historical cumulative value respectively. For example, the updated overall historical cumulative value can be expressed as k1*L2+k2*D2, wherein k1 and k2 are weight coefficients respectively, and their specific values can be customized according to actual needs.
[0146] A4, compares the updated overall historical cumulative value with the overall limit value of the corresponding overall dimension.
[0147] Continuing with the above example, for the overall dimension 1, the updated overall historical cumulative value (L1+D2) can be compared with the overall limit value M1 to obtain the overall comparison result corresponding to the overall dimension 1; for the overall dimension 2, the updated overall historical cumulative value (L2+D2) can be compared with the overall limit value M2 to obtain the overall comparison result corresponding to the overall dimension 2.
[0148] In some implementations, after step 104, the following steps may also be included:
[0149] When the updated overall historical cumulative value is less than or equal to the overall limit value, the updated overall historical cumulative value is stored in the non-relational database.
[0150] Using the above example, if it is determined that (L1+D2)≤M1 and (L2+D2)≤M2, the updated overall historical cumulative value can be stored in a non-relational database, which can be a Redis database.
[0151] In some embodiments, when the interactive database is a Redis database, the preset Lua script of the Redis database can be used to implement the update of the overall historical cumulative value based on the interactive information. When the Lua script is used to implement the process of updating the overall historical cumulative value based on the interactive information, this process is exclusive, no other requests will be processed in the middle, and no concurrent security issues will occur, so that consistency can be guaranteed. Among them, when the interactive database is a Redis database, in terms of data structure, since a record needs to store the cumulative values of four time dimensions: daily limit, weekly limit, monthly limit, and the entire activity period, the data structure in the database can use a hash table (HashTable).
[0152] 105. When the updated overall historical cumulative value is less than or equal to the overall limit value, the individual historical cumulative value is updated, and based on the updated individual historical cumulative value and the individual limit value, the target object interacts with the interactive object.
[0153] Among them, the specific implementation method of updating the individual historical cumulative value can refer to the implementation method of updating the overall historical cumulative value, and the interaction value is merged with the individual historical cumulative value to obtain the updated individual historical cumulative value corresponding to each overall dimension. Continuing with the above example, taking the interaction value as the updated interaction value D2, and the individual dimensions including individual dimension 2 and individual dimension 3 in Table 3 as an example, for individual dimension 2, the updated individual historical cumulative value can be obtained as (D2+K3), and for individual dimension 3, the updated individual historical cumulative value can be obtained as (D2+K4).
[0154] Wherein, in step 105, based on the updated individual historical cumulative value and the individual limit value, the target object interacts with the interactive object, including:
[0155] Compare the updated individual historical cumulative value with the individual limit value of the corresponding individual dimension.
[0156] Continuing with the above example, for individual dimension 2, the updated individual historical cumulative value (K3+D2) can be compared with the individual limit value N3 to obtain the individual comparison result corresponding to individual dimension 2; for individual dimension 3, the updated individual historical cumulative value (K4+D2) can be compared with the individual limit value N4 to obtain the individual comparison result corresponding to individual dimension 3.
[0157] When the updated individual history cumulative value is less than or equal to the individual limit value, the cumulative record of the interactive resource in the interactive object is updated based on the updated individual history cumulative value, and the preset first prompt information is sent to the terminal corresponding to the object interaction request. The preset first prompt information is used to prompt that the interactive object has successfully interacted with the target object.
[0158] Among them, the cumulative record may include the interactive resources recorded in each interaction between the interactive object and the target object, the updated individual historical cumulative value for each interactive resource after each interaction, the time of each interaction, etc., so that the interactive object can view the details of the interaction at any time. For example, the interactive process is a commodity purchase process, the interactive object is user A, and the interactive resources can be commodity A and commodity B. The cumulative record may record that after the most recent interaction (such as November 11), the cumulative number of commodity A purchased by user A is 100, and the cumulative number of commodity B purchased is 300. The cumulative record may be stored in the interactive terminal corresponding to the interactive object.
[0159] Continuing with the above example, if it is determined that (K3+D2)≤N3, and (K4+D2)≤N4, the electronic device can send the updated individual history cumulative value to the interactive terminal corresponding to the interactive object to instruct the interactive terminal to update the cumulative record of the corresponding interactive resource. The interactive terminal is the interactive terminal corresponding to the object interaction request received this time. In addition, the electronic device can also generate a preset first prompt information when it is determined that the updated individual history cumulative value is less than or equal to the individual limit value, and send the preset first prompt information to the interactive terminal corresponding to the object interaction request to remind the interactive object that the interaction with the target object is successful. The first prompt information may include but is not limited to: text information, video information, image information, and audio information, etc. The first prompt information may have different contents in different interactive scenarios. For example, in the scenario of online course selection, the first prompt information may be "You have successfully selected xx course", for example, in the scenario of online shopping, the first prompt information may be "You have successfully purchased xx goods, the quantity is xx".
[0160] In some implementations, the electronic device may also determine that the individual history cumulative value is successfully updated based on the current object interaction request when determining that the updated individual history cumulative value is less than or equal to the individual limit value, and may write the updated individual history cumulative value into the interaction database.
[0161] When the updated individual history cumulative value is greater than the individual limit value, a preset second prompt information is sent to the interaction terminal corresponding to the object interaction request, and the preset second prompt information is used to prompt that the interaction object fails to interact with the target object.
[0162] Continuing with the above example, if it is determined that (K3+D2)>N3, or (K4+D2)>N4, the preset second prompt information can be sent to the interaction terminal corresponding to the object interaction request to prompt that the interaction object and the target object have failed to interact. The first prompt information can include but is not limited to: text information, video information, image information, audio information, etc.
[0163] In some implementations, the electronic device may determine that the update of the individual history cumulative value based on the current object interaction request fails when determining that the updated individual history cumulative value is greater than the individual limit value, and may not write the updated individual history cumulative value into the interaction database.
[0164] The preset interactive database also includes a relational database and a non-relational database. After comparing the updated individual historical cumulative value with the individual limit value of the corresponding individual dimension, it also includes:
[0165] When the updated individual history cumulative value is less than or equal to the individual limit value, the number of dimensions of multiple individual dimensions is obtained.
[0166] The number of dimensions of the multiple individual dimensions may be the number of dimensions of all individual dimensions involved when the electronic device processes all object interaction requests. The larger the number of dimensions, the larger the amount of data to be processed by the electronic device.
[0167] When the number of dimensions is greater than or equal to the quantity threshold, the updated individual historical cumulative values are stored in the relational database.
[0168] When the number of dimensions is less than the quantity threshold, the updated individual historical cumulative values are stored in the non-relational database.
[0169] Exemplarily, for example, the number of dimensions is m, and the number threshold is m0. When m≥m0, the updated individual historical cumulative value can be stored in a relational database. When m<m0, the updated individual historical cumulative value can be stored in a non-relational database.
[0170] The relational database may be a MySQL database or a TDSQL database, and the non-relational database may be a Redis database. It is understandable that the Redis database is suitable for scenarios with a small amount of data and high performance requirements, while the MySQL database or the TDSQL database is suitable for scenarios with a large amount of data and low performance requirements. When a relational database such as a TDSQL database is used to store updated individual historical cumulative values, transactions and row locks can be used to ensure data consistency and atomicity.
[0171] In some embodiments, the electronic device may also determine the number of all interactive objects. When the number of all interactive objects exceeds a first threshold, it indicates that the amount of data to be processed by the electronic device is large, and the updated individual historical cumulative value may be stored in a relational database. When the number of all interactive objects does not exceed the first threshold, it indicates that the amount of data to be processed by the electronic device is small, and the updated individual historical cumulative value may be stored in a non-relational database.
[0172] In some implementations, the electronic device may also determine the total number of interactive resources to be processed. When the total number of interactive resources exceeds a second threshold, it indicates that the amount of data to be processed by the electronic device is large, and the updated individual historical cumulative value may be stored in a relational database. When the total number of interactive resources does not exceed the second threshold, it indicates that the amount of data to be processed by the electronic device is small, and the updated individual historical cumulative value may be stored in a non-relational database.
[0173] In some implementations, the updated individual history cumulative value may be stored in a relational database or a non-relational database in combination with the number of dimensions, the number of all interactive objects, and the total number of interactive resources. For example, when the number of dimensions is less than a quantity threshold, the number of all interactive objects does not exceed a first threshold, and the total number of interactive resources does not exceed a second threshold, the updated individual history cumulative value is stored in a non-relational database; otherwise, the updated individual history cumulative value is stored in a relational database. This enables effective storage of the updated individual history cumulative value.
[0174] It is understandable that if the Redis database is used as the storage database for updated individual historical cumulative values, it is necessary to reasonably set the expiration time and expiration policy of each individual historical cumulative value according to actual needs, so as to delete expired data in the Redis database in time and improve the use efficiency of the Redis database.
[0175] The object interaction method further includes:
[0176] When the updated individual history cumulative value is greater than the individual limit value, or the updated overall history cumulative value is greater than the overall limit value, a system detection is performed on the interactive system corresponding to the interactive resource to obtain a detection result of the interactive system.
[0177] The system detection may be to detect the hardware involved in the interactive system, for example, to detect whether the communication device is working properly, and for example, to detect whether the memory is working properly, etc. Exemplarily, the detection result of the interactive system may include network delays and request processing timeouts due to temporary failure of the communication device, data storage failures due to temporary failure of the memory, etc., indicating that there are errors in the interactive system.
[0178] When the detection result indicates that there is an error in the interactive system, the execution is returned by writing to the message queue: the steps of obtaining the overall limit values of multiple overall dimensions corresponding to the target object and the individual limit values of multiple individual dimensions corresponding to the interactive object are performed, so that the interactive object interacts with the target object.
[0179] Exemplarily, when the detection result indicates that there is an error in the interactive system, the electronic device can return to execute step 102 and the steps after step 102 by writing a message queue (MQ) until the interaction between the interactive object and the target object is successful (for example, the updated individual history cumulative value is less than or equal to the individual limit value, and the updated overall history cumulative value is less than or equal to the overall limit value), or until the detection result indicates that there is no error in the interactive system. This can avoid the situation where the interaction fails due to a fault in the interactive system, reduce the error probability of the interaction, and improve the user's interactive experience.
[0180] Among them, message queue (MQ) is a technology used to decouple communication between applications, which can improve the reliability and scalability of the system. In a distributed system, if you want to ensure the consistency between multiple services, you need to take corresponding measures, and MQ is also one of the common solutions.
[0181] There are three main ways to achieve consistency through MQ:
[0182] Sender transaction: Before sending a message, a transaction will be opened and the message will be added to the transaction. After all business operations are completed, the transaction will be committed. At this time, the message will also be submitted to the MQ Broker (message middleware in the message queue system) to ensure that multiple systems succeed or fail at the same time.
[0183] Idempotent processing on the consumer side: After receiving a message, the consumer side needs to perform idempotent processing, that is, the same message will only be processed once to avoid repeated operations. By storing the ID of the message that has been processed on the consumer side, it can be determined whether it is a duplicate message.
[0184] Consumer transactions: Consumers can also use transactions when processing messages, placing them in the same transaction with other business operations to ensure that related businesses can get the correct processing results when consumption succeeds or fails.
[0185] It can be seen that in this embodiment, after receiving at least one object interaction request for the interactive resource of the target object, the overall limit values of multiple overall dimensions corresponding to the target object and the individual limit values of multiple individual dimensions corresponding to the interactive object are obtained; the object interaction request carries the interaction information of the interactive object for the interactive resource; then, the historical cumulative value of the interactive resource is screened out from the preset interaction database, wherein the historical cumulative value includes the overall historical cumulative value of each overall dimension and the individual historical cumulative value of each individual dimension; then, based on the interaction information, the overall historical cumulative value is updated, and the updated overall historical cumulative value is compared with the overall limit value of the corresponding overall dimension; when the updated overall historical cumulative value is less than or equal to the overall limit value, the individual historical cumulative value is updated, and based on the updated individual historical cumulative value and the individual limit value, the target object interacts with the interactive object. When the historical accumulated value of the interactive resource is updated according to the object interaction request, the overall historical accumulated value in the historical accumulated value is affected by all object interaction requests, that is, it is greatly affected by the high-concurrency object interaction request, while the individual historical accumulated value is only affected by the corresponding single object interaction request. Therefore, by first updating the overall historical accumulated value, and then updating the individual historical accumulated value after the overall historical accumulated value is successfully updated, so that after the error-prone overall historical accumulated value is successfully updated, if the individual historical accumulated value is successfully updated, it is only necessary to process the erroneous individual historical accumulated value separately, without frequently returning to process the overall historical accumulated value, thereby effectively ensuring the data consistency when updating the historical accumulated value, and finally based on the updated individual historical accumulated value and the individual limit value, the target object interacts with the interactive object, which can reduce the error probability when processing object interaction requests and improve the user's interaction experience.
[0186] The object interaction scheme provided by the embodiment of the present application can be applied in various high-concurrency scenarios. For example, taking the scenario of a merchant platform launching a promotional activity as an example, the merchant platform will receive a large number of commodity purchase requests sent by users during the activity, and interact with users based on the commodity purchase request. In this scenario, the merchant platform often has the need to limit the number of times users participate in the activity rules in different dimensions, as well as the need to limit the number of items issued by the activity in different dimensions. Limiting these resources can help formulate more complete activity rules (such as limiting the number of seconds sold for a certain product in a flash sale activity, limiting the number of times users participate in discounts in a discount activity), ensure the fairness and sustainability of the activity, and prevent the behavior of malicious users from causing adverse effects on the activity and preventing asset loss. The scheme provided by the embodiment of the present application can effectively ensure the data consistency when updating the historical cumulative value of the commodity (such as the data of the sold commodities for individual users and all users), further reducing the probability of error when processing commodity purchase requests, thereby improving the user's purchasing experience.
[0187] For example, the scenario of limiting the number of items distributed by an activity is used as an example for explanation. In this scenario, the items distributed by the activity correspond to the above-mentioned interactive resources, the users correspond to the interactive objects, the merchants who distribute the items correspond to the target objects, the number of items distributed to all users corresponds to the overall historical cumulative value, the number of items distributed to a single user corresponds to the individual historical cumulative value, and the number of items requested by the user corresponds to the interactive value. Figure 4 As shown, the architecture for processing the object interaction method in the electronic device may include a business logic layer, a computing layer, and a storage layer. The business logic layer includes an activity model module, a standard limited service module (hereinafter referred to as the standard limited service), a total limit module, and an individual limit module.
[0188] The activity model module is used to receive object interaction requests and extract overall interaction rule information, individual interaction rule information, and interaction information from the object interaction requests.
[0189] The business logic layer is responsible for understanding the business logic corresponding to the object interaction request. For example, the business logic may be to update the overall historical cumulative value first, and then update the individual historical cumulative value after the overall historical cumulative value is successfully updated.
[0190] The standard limited-time service can send the overall interaction rule information to the overall limit module, and obtain a set of overall dimensions and overall limit values corresponding to the overall dimensions from the configuration database through the overall limit module, that is, the overall limit values of multiple overall dimensions corresponding to the target object. In addition, the standard limited-time service can also send the overall interaction rule information to the individual limit module, and obtain a set of individual dimensions and individual limit values corresponding to the individual interaction rule information from the configuration database through the individual limit module, that is, the individual limit values of multiple individual dimensions corresponding to the interaction object.
[0191] Among them, the calculation layer may include a counting module, which may be responsible for receiving the interaction rule information (such as the number of restrictions for the day, week, month, and the entire activity period) and the interaction value that needs to be accumulated at the time of accumulation. When accumulation is required, that is, when the individual historical cumulative value or the overall historical cumulative value is updated, it can be atomically accumulated with the help of the storage layer, and determine whether the corresponding limit value is reached. For example, after receiving the call from the business logic layer, the counting module can re-count the overall historical cumulative value, that is, update the overall historical cumulative value according to the interaction information; it can also re-count the individual historical cumulative value, that is, update the individual historical cumulative value according to the interaction information, and store the updated individual historical cumulative value in a relational database. Among them, when using the Redis database to store the overall historical cumulative value, the calculation layer can also include a preset script extension module corresponding to the Redis database, and the preset script extension module can be a lua extension module, and the lua extension module can realize the update of the overall historical cumulative value, and store the updated overall historical cumulative value in a non-relational database.
[0192] The storage layer may include a non-relational database, a relational database, and a configuration database, wherein the configuration database is used to store the overall limit values of multiple overall dimensions corresponding to the target object and the individual limit values of multiple individual dimensions corresponding to the interactive object. A non-relational database (such as a Redis database) may be used to store the updated overall historical cumulative value. A relational database may be used to store the updated individual historical cumulative value.
[0193] The method described in the above embodiment will be further described in detail below.
[0194] In this embodiment, an electronic device, where the electronic device is a server, is taken as an example to describe the method of the embodiment of the present application in detail.
[0195] like Figure 5 As shown, the specific process of an object interaction method is as follows:
[0196] 201. A server receives at least one object interaction request for an interactive resource of a target object, where the object interaction request carries interaction information of the interactive object for the interactive resource.
[0197] 202. The server obtains overall limit values of multiple overall dimensions corresponding to the target object and individual limit values of multiple individual dimensions corresponding to the interactive object.
[0198] 203. The server selects historical cumulative values of interactive resources from a preset interactive database, where the historical cumulative values include overall historical cumulative values of each overall dimension and individual historical cumulative values of each individual dimension.
[0199] 204. The server extracts the current interaction value of the interaction object for the interaction resource from the interaction information.
[0200] 205. The server updates and detects the historical cumulative value based on the current interaction value, the overall limit value, and the individual limit value.
[0201] In some implementations, specific implementations of step 205 may include:
[0202] S1, the server adds the current interaction value to the overall historical cumulative value to obtain a candidate overall historical cumulative value, and adds the current interaction value to the individual historical cumulative value to obtain a candidate individual historical cumulative value.
[0203] In some implementations, in step S1, before the server adds the current interaction value to the overall historical cumulative value to obtain the candidate overall historical cumulative value, the following steps may also be included:
[0204] The server compares the current interaction value with the overall limit value for each overall dimension, and compares the current interaction value with the individual limit value for each individual dimension.
[0205] The server adds the current interaction value to the overall historical cumulative value to obtain a candidate overall historical cumulative value, including: when the current interaction value is less than the overall limit value and the current interaction value is less than the individual limit value, the current interaction value is added to the overall historical cumulative value to obtain a candidate overall historical cumulative value.
[0206] S2, the server compares the candidate population historical cumulative value with the population limit value of the corresponding population dimension to obtain the overall comparison result.
[0207] S3, the server compares the candidate individual historical cumulative value with the individual limit value of the corresponding individual dimension to obtain the individual comparison result.
[0208] S4, when both the overall comparison result and the individual comparison result meet the preset detection condition, the server determines that the historical cumulative value meets the update condition.
[0209] In some implementations, the object interaction method further includes:
[0210] When the overall comparison result indicates that the overall historical cumulative value is less than the overall limit value of the corresponding overall dimension, and the individual comparison result indicates that the individual historical cumulative value is less than the individual limit value of the corresponding individual dimension, the server determines that both the overall comparison result and the individual comparison result meet the preset detection conditions.
[0211] 206. When the historical cumulative value meets the update condition, the server updates the interaction information, and updates the overall historical cumulative value based on the updated interaction information.
[0212] In some implementations, in step 206, updating the overall historical cumulative value based on the updated interaction information may include:
[0213] The server updates the current interaction value based on the updated interaction information to obtain an updated interaction value.
[0214] The server merges the updated interaction value with the overall historical cumulative value to obtain the updated overall historical cumulative value corresponding to each overall dimension.
[0215] 207. The server compares the updated overall historical cumulative value with the overall limit value of the corresponding overall dimension.
[0216] In some implementations, the preset interactive database includes a non-relational database, and after step 207, the following may also be included:
[0217] When the updated overall historical cumulative value is less than or equal to the overall limit value, the server stores the updated overall historical cumulative value in the non-relational database.
[0218] 208. When the updated overall historical cumulative value is less than or equal to the overall limit value, the server updates the individual historical cumulative value, and interacts the target object with the interactive object based on the updated individual historical cumulative value and the individual limit value.
[0219] In some implementations, step 208 may include:
[0220] The server compares the updated individual historical cumulative value with the individual limit value of the corresponding individual dimension.
[0221] When the updated individual history cumulative value is less than or equal to the individual limit value, the server updates the cumulative record of the interactive resource in the interactive object based on the updated individual history cumulative value, and sends the preset first prompt information to the interactive terminal corresponding to the object interaction request. The preset first prompt information is used to prompt that the interactive object has successfully interacted with the target object.
[0222] When the updated individual history cumulative value is greater than the individual limit value, the server sends a preset second prompt message to the interaction terminal corresponding to the object interaction request, where the preset second prompt message is used to prompt that the interaction object fails to interact with the target object.
[0223] In some implementations, the object interaction method may further include:
[0224] When the updated individual history cumulative value is greater than the individual limit value, or the updated overall history cumulative value is greater than the overall limit value, the server performs a system detection on the interactive system corresponding to the interactive resource to obtain a detection result of the interactive system.
[0225] When the detection result of the server indicates that there is an error in the interactive system, it returns to execute by writing to the message queue: obtaining the overall limit values of multiple overall dimensions corresponding to the target object and the individual limit values of multiple individual dimensions corresponding to the interactive object, so that the interactive object interacts with the target object.
[0226] Exemplarily, the server may include: Figure 4 The architecture shown below is combined with Figure 4 The architecture shown in the figure illustrates the specific implementation of steps 201 to 208:
[0227] like Figure 6 As shown, the activity model module can send the received object interaction request to the standard limited-time service module. The standard limited-time service module searches the configuration database for corresponding restriction configuration information based on the object interaction request, wherein the restriction configuration information includes multiple individual dimensions, multiple overall dimensions, individual restriction values of each individual dimension, and overall restriction values of each overall dimension.
[0228] After finding the corresponding restriction configuration information from the configuration database, the standard limited-time service module can assemble a Redis key based on the restriction configuration information, and then find the overall historical cumulative value corresponding to each overall dimension from the Redis database based on the Redis key.
[0229] Then, the standard limited-time service module can call the counting module to calculate the sum of the overall historical cumulative value corresponding to the overall dimension and the interaction value in the object interaction request for each overall dimension. If the sum of the overall historical cumulative value and the interaction value in the object interaction request is less than the overall limit value corresponding to the overall dimension, it is determined that the overall historical cumulative value can be accumulated. Otherwise, it is determined that the overall historical cumulative value cannot be accumulated, and if it cannot be accumulated, the information that the object interaction request processing fails is returned to the activity model module.
[0230] When it is determined that the overall historical cumulative value can be accumulated, the standard limited service module can continue to call the counting module, and for each individual dimension, calculate the sum of the individual historical cumulative value corresponding to the individual dimension and the interaction value in the object interaction request. If the sum of the individual historical cumulative value and the interaction value in the object interaction request is less than the individual limit value corresponding to the individual dimension, it is determined that the individual historical cumulative value can be accumulated. Otherwise, it is determined that the individual historical cumulative value cannot be accumulated, and if it cannot be accumulated, the information that the object interaction request processing fails is returned to the activity model module.
[0231] If it is determined that the individual history can be accumulated, the standard limited service module can call the preset Lua extension script of the Redis database to perform: the operation of updating the overall historical cumulative value based on the interactive information. For example, the preset Lua extension script can first check whether the order corresponding to the object interaction request exists. If it exists, the overall historical cumulative value is updated based on the interactive information, and it is determined whether the updated overall historical cumulative value exceeds the corresponding overall limit value. If it does not exceed, the updated overall historical cumulative value can be written to the Redis database, and the write result fed back by the Redis database is obtained, where the write result may include write failure or write success. In addition, the updated overall historical cumulative value can be written to the order corresponding to the object interaction request, thereby realizing atomic operations. If it exceeds, the information that the object interaction request fails to be processed can be returned to the active model module. In addition, when it is determined that the updated overall historical cumulative value exceeds the corresponding overall limit value, the standard limited service module can perform a system detection on the interactive system. If a system error is detected, the object interaction request can be reprocessed by writing a message queue. Among them, in this embodiment, the use of lua script extension can ensure the following process: reading orders -> judging whether the order has been accumulated -> reading accumulated data (such as the overall historical accumulated value) -> increasing the accumulated quantity in each time dimension -> writing data -> recording orders, so that this process is exclusive, no other requests will be processed in the middle, and no concurrent security issues will occur, thereby ensuring consistency. Among them, the role of the order is to ensure idempotence and provide a basis for the rollback interface. Among them, the Redis database can use the cluster version, which is not limited by the performance of a single machine, and is convenient for expansion when necessary.
[0232] After writing the updated overall historical cumulative value to the order corresponding to the object interaction request, the standard limited service module can update the individual historical cumulative value based on the interaction information to obtain the updated individual historical cumulative value. For example, you can first check whether the order corresponding to the object interaction request exists. If it does, the individual historical cumulative value is updated based on the interaction information, and it is determined whether the updated individual historical cumulative value exceeds the corresponding individual limit value. If it does not exceed, the updated individual historical cumulative value can be written to the Redis database, and the write result fed back by the Redis database can be obtained. In addition, the updated overall historical cumulative value can be written to the order corresponding to the object interaction request, and the information that the object interaction request is successfully processed can be returned to the activity model module. Among them, when updating the individual historical cumulative value, transactions and row locks can be used to ensure data consistency and atomicity. For example, the update process for the individual historical cumulative value can be as follows: start transaction->insert order, the status is locked->check individual historical cumulative value->update individual historical cumulative value based on interaction information->update cumulative record->update order status.
[0233] If it exceeds, the information that the interaction request processing of the object failed can be returned to the active model module, and the preset Lua script can be rolled back to the step of updating the overall historical cumulative value based on the interaction information until it is determined that the updated individual historical cumulative value does not exceed the corresponding individual limit value.
[0234] In addition, when it is determined that the updated individual historical cumulative value exceeds the corresponding individual limit value, the standard limited-time service module can perform a system check on the interactive system. If a system error is detected, the object interaction request can be reprocessed by writing a message queue.
[0235] In summary, the object interaction method provided in this embodiment can support the target object (such as a merchant) to arbitrarily customize the counting / limiting capabilities of the extended dimension, and enable the upstream activity rule-related services to accumulate the quantity without perception of the dimension when the interactive object (such as a user) participates in the activity. And through the redis lua script extension method and the business's own service layer logic, the number of individual and overall interactive resources in the day, week, month, and entire activity of multiple extended dimensions can be accumulated at the same time, achieving final consistency. The storage layer can still only use the Redis database, without additional dependence on the storage service. Of course, Redis can also be used for hot data such as the overall historical cumulative value, and the individual historical cumulative value can use a relational database such as the TDSQL database to reduce the complexity of the business logic layer of the service part.
[0236] In order to better implement the above method, the embodiment of the present application also provides an object interaction device, which can be integrated in an electronic device, and the electronic device can be a terminal, a server, etc. Among them, the terminal can be a mobile phone, a tablet computer, a smart Bluetooth device, a laptop, a personal computer, etc.; the server can be a single server or a server cluster composed of multiple servers.
[0237] For example, in this embodiment, the method of the embodiment of the present application will be described in detail by taking the object interaction device being specifically integrated into an electronic device as an example.
[0238] For example, Figure 7 As shown, the object interaction device may include a receiving unit 301, an acquiring unit 302, a screening unit 303, a comparing unit 304 and an interaction unit 305, wherein:
[0239] (i) a receiving unit 301, configured to receive at least one object interaction request for an interactive resource of a target object, wherein the object interaction request carries interaction information of the interactive object for the interactive resource;
[0240] (ii) an acquisition unit 302, used to acquire overall limit values of multiple overall dimensions corresponding to the target object and individual limit values of multiple individual dimensions corresponding to the interactive object;
[0241] (iii) a screening unit 303, configured to screen out historical cumulative values of interactive resources from a preset interactive database, wherein the historical cumulative values include overall historical cumulative values of each overall dimension and individual historical cumulative values of each individual dimension;
[0242] (iv) a comparison unit 304, configured to update the overall historical cumulative value based on the interaction information, and compare the updated overall historical cumulative value with the overall limit value of the corresponding overall dimension;
[0243] (V) An interaction unit 305, configured to update the individual history accumulation value when the updated overall history accumulation value is less than or equal to the overall limit value, and interact the target object with the interaction object based on the updated individual history accumulation value and the individual limit value.
[0244] In some embodiments, the object interaction device further includes:
[0245] The update detection unit is used to extract the current interaction value of the interaction object for the interaction resource from the interaction information; based on the current interaction value, the overall limit value and the individual limit value, update the historical accumulated value.
[0246] The comparison unit 304 is specifically used to update the interaction information when the historical cumulative value meets the update condition, and update the overall historical cumulative value based on the updated interaction information; and compare the updated overall historical cumulative value with the overall limit value of the corresponding overall dimension.
[0247] In some embodiments, the update detection unit is specifically used to add the current interaction value to the overall historical cumulative value to obtain a candidate overall historical cumulative value, and add the current interaction value to the individual historical cumulative value to obtain a candidate individual historical cumulative value; compare the candidate overall historical cumulative value with the overall limit value of the corresponding overall dimension to obtain an overall comparison result; compare the candidate individual historical cumulative value with the individual limit value of the corresponding individual dimension to obtain an individual comparison result; when the overall comparison result and the individual comparison result both meet the preset detection conditions, it is determined that the historical cumulative value meets the update condition.
[0248] In some embodiments, the object interaction device further includes:
[0249] The condition determination unit is used to determine that both the overall comparison result and the individual comparison result meet the preset detection conditions when the overall comparison result indicates that the overall historical cumulative value is less than the overall limit value of the corresponding overall dimension, and the individual comparison result indicates that the individual historical cumulative value is less than the individual limit value of the corresponding individual dimension.
[0250] In some embodiments, the object interaction device further includes:
[0251] The current interaction value comparison unit 304 is used to compare the current interaction value with the overall limit value of each overall dimension, and to compare the current interaction value with the individual limit value of each individual dimension.
[0252] The update detection unit is specifically used to add the current interaction value to the overall historical cumulative value to obtain a candidate overall historical cumulative value, including: when the current interaction value is less than the overall limit value and the current interaction value is less than the individual limit value, the current interaction value is added to the overall historical cumulative value to obtain a candidate overall historical cumulative value.
[0253] In some implementations, the comparison unit 304 is specifically used to update the current interaction value based on the updated interaction information to obtain an updated interaction value; and merge the updated interaction value with the overall historical cumulative value to obtain an updated overall historical cumulative value corresponding to each overall dimension.
[0254] In some implementations, the preset interaction database includes a non-relational database, and the object interaction device further includes:
[0255] The storage unit is used to store the updated overall historical cumulative value in the non-relational database when the updated overall historical cumulative value is less than or equal to the overall limit value.
[0256] In some embodiments, the interaction unit 305 is specifically used to compare the updated individual history cumulative value with the individual limit value of the corresponding individual dimension; when the updated individual history cumulative value is less than or equal to the individual limit value, the cumulative record of the interaction resource in the interaction object is updated based on the updated individual history cumulative value, and a preset first prompt information is sent to the terminal corresponding to the object interaction request, and the preset first prompt information is used to prompt that the interaction object and the target object have successfully interacted; when the updated individual history cumulative value is greater than the individual limit value, a preset second prompt information is sent to the interaction terminal corresponding to the object interaction request, and the preset second prompt information is used to prompt that the interaction object and the target object have failed.
[0257] In some embodiments, the preset interactive database also includes a relational database and a non-relational database, and a storage unit, which is specifically used to obtain the number of dimensions of multiple individual dimensions when the updated individual historical cumulative value is less than or equal to the individual limit value; when the number of dimensions is greater than or equal to the number threshold, the updated individual historical cumulative value is stored in the relational database; when the number of dimensions is less than the number threshold, the updated individual historical cumulative value is stored in the non-relational database.
[0258] In some embodiments, the object interaction device further includes:
[0259] The system detection unit is used to perform system detection on the interactive system corresponding to the interactive resource to obtain the detection result of the interactive system when the updated individual history cumulative value is greater than the individual limit value, or the updated overall history cumulative value is greater than the overall limit value.
[0260] The return execution unit is used to return to execution by writing a message queue when the detection result indicates that there is an error in the interactive system: the steps of obtaining the overall limit values of multiple overall dimensions corresponding to the target object and the individual limit values of multiple individual dimensions corresponding to the interactive object, so that the interactive object interacts with the target object.
[0261] In specific implementation, the above units can be implemented as independent entities, or can be arbitrarily combined to be implemented as the same or several entities. The specific implementation of the above units can refer to the previous method embodiments, which will not be repeated here.
[0262] The embodiment of the present application also provides an electronic device, which can be a terminal, a server, etc. The terminal can be a mobile phone, a tablet computer, a smart Bluetooth device, a laptop, a personal computer, etc. The server can be a single server or a server cluster composed of multiple servers, etc.
[0263] In some embodiments, the object interaction apparatus may also be integrated into multiple electronic devices. For example, the object interaction apparatus may be integrated into multiple servers, and the object interaction method of the present application may be implemented by multiple servers.
[0264] In this embodiment, the electronic device of this embodiment is a server as an example for detailed description, for example, Figure 8 As shown, it shows a schematic diagram of the structure of the electronic device involved in the embodiment of the present application, specifically:
[0265] The electronic device may include components such as a processor 401 with one or more processing cores, a memory 402 with one or more computer-readable storage media, a power supply 403, an input module 404, and a communication module 405. Those skilled in the art will appreciate that Figure 8 The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0266] The processor 401 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. By running or executing software programs and / or modules stored in the memory 402 and calling data stored in the memory 402, it performs various functions of the electronic device and processes data, thereby monitoring the electronic device as a whole. In some embodiments, the processor 401 may include one or more processing cores; in some embodiments, the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 401.
[0267] The memory 402 can be used to store software programs and modules. The processor 401 executes various functional applications and data processing by running the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 402 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.
[0268] The electronic device also includes a power supply 403 for supplying power to various components. In some embodiments, the power supply 403 can be logically connected to the processor 401 through a power management system, so as to manage charging, discharging, and power consumption through the power management system. The power supply 403 can also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.
[0269] The electronic device may further include an input module 404, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0270] The electronic device may further include a communication module 405. In some embodiments, the communication module 405 may include a wireless module. The electronic device may perform short-range wireless transmission through the wireless module of the communication module 405, thereby providing the user with wireless broadband Internet access. For example, the communication module 405 may be used to help the user send and receive emails, browse web pages, and access streaming media.
[0271] Although not shown, the electronic device may further include a display unit, etc., which will not be described in detail herein. Specifically in this embodiment, the processor 401 in the electronic device will load the executable files corresponding to the processes of one or more application programs into the memory 402 according to the following instructions, and the processor 401 will run the application programs stored in the memory 402, thereby realizing various functions, as follows:
[0272] receiving at least one object interaction request for an interactive resource of a target object, wherein the object interaction request carries interaction information of the interactive object for the interactive resource;
[0273] Obtaining overall limit values of multiple overall dimensions corresponding to the target object and individual limit values of multiple individual dimensions corresponding to the interactive object;
[0274] Filter out historical cumulative values of interactive resources from a preset interactive database, where the historical cumulative values include the overall historical cumulative values of each overall dimension and the individual historical cumulative values of each individual dimension;
[0275] Based on the interaction information, the overall historical cumulative value is updated, and the updated overall historical cumulative value is compared with the overall limit value of the corresponding overall dimension;
[0276] When the updated overall historical cumulative value is less than or equal to the overall limit value, the individual historical cumulative value is updated, and based on the updated individual historical cumulative value and the individual limit value, the target object interacts with the interactive object.
[0277] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0278] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0279] To this end, an embodiment of the present application provides a computer-readable storage medium, in which a plurality of instructions are stored, and the instructions can be loaded by a processor to execute the steps in any object interaction method provided in the embodiment of the present application. For example, the instructions can execute the following steps:
[0280] At least one object interaction request for an interactive resource of a target object is received, where the object interaction request carries interaction information of the interactive object for the interactive resource.
[0281] Obtain overall limit values of multiple overall dimensions corresponding to the target object and individual limit values of multiple individual dimensions corresponding to the interactive object.
[0282] The historical cumulative values of the interactive resources are screened out from the preset interactive database, where the historical cumulative values include the overall historical cumulative values of each overall dimension and the individual historical cumulative values of each individual dimension.
[0283] Based on the interaction information, the overall historical cumulative value is updated, and the updated overall historical cumulative value is compared with the overall limit value of the corresponding overall dimension.
[0284] When the updated overall historical cumulative value is less than or equal to the overall limit value, the individual historical cumulative value is updated, and based on the updated individual historical cumulative value and the individual limit value, the target object interacts with the interactive object.
[0285] The storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0286] According to one aspect of the present application, a computer program product or computer program is provided, the computer program product or computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method provided in the above embodiment.
[0287] Since the instructions stored in the storage medium can execute the steps in any object interaction method provided in the embodiments of the present application, the beneficial effects that can be achieved by any object interaction method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0288] The above is a detailed introduction to an object interaction method, device, electronic device and computer-readable storage medium provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the ideas of the present application, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. An object interaction method, characterized in that: include: receiving at least one object interaction request for an interactive resource of a target object, wherein the object interaction request carries interaction information of the interactive object for the interactive resource; Acquire overall limit values of multiple overall dimensions corresponding to the target object and individual limit values of multiple individual dimensions corresponding to the interactive object; Filtering out the historical cumulative value of the interactive resource from a preset interactive database, the historical cumulative value including the overall historical cumulative value of each overall dimension and the individual historical cumulative value of each individual dimension; Based on the interaction information, the overall historical cumulative value is updated, and the updated overall historical cumulative value is compared with the overall limit value of the corresponding overall dimension; When the updated overall history cumulative value is less than or equal to the overall limit value, the individual history cumulative value is updated, and based on the updated individual history cumulative value and the individual limit value, the target object interacts with the interactive object.
2. The object interaction method according to claim 1, characterized in that: After the historical accumulated value of the interaction resource is screened out from the preset interaction database, the method further includes: Extracting the current interaction value of the interaction object for the interaction resource from the interaction information; Based on the current interaction value, the overall limit value and the individual limit value, update detection is performed on the historical cumulative value; The updating of the overall historical cumulative value based on the interaction information, and comparing the updated overall historical cumulative value with the overall limit value of the corresponding overall dimension, includes: When the historical cumulative value meets the update condition, the interaction information is updated, and based on the updated interaction information, the overall historical cumulative value is updated; Compare the updated overall historical cumulative value with the overall limit value of the corresponding overall dimension.
3. The object interaction method according to claim 2, characterized in that: The updating detection of the historical accumulated value based on the current interaction value, the overall limit value and the individual limit value includes: The current interaction value is added to the overall historical cumulative value to obtain a candidate overall historical cumulative value, and the current interaction value is added to the individual historical cumulative value to obtain a candidate individual historical cumulative value; Compare the candidate population historical cumulative value with the population limit value of the corresponding population dimension to obtain a population comparison result; Compare the candidate individual historical cumulative value with the individual limit value of the corresponding individual dimension to obtain an individual comparison result; When both the overall comparison result and the individual comparison result satisfy the preset detection condition, it is determined that the historical cumulative value meets the update condition.
4. The object interaction method according to claim 3, characterized in that: The method further comprises: When the overall comparison result indicates that the overall historical cumulative value is less than the overall limit value of the corresponding overall dimension, and the individual comparison result indicates that the individual historical cumulative value is less than the individual limit value of the corresponding individual dimension, it is determined that both the overall comparison result and the individual comparison result meet the preset detection conditions.
5. The object interaction method according to claim 3, characterized in that: Before adding the current interaction value to the overall historical cumulative value to obtain the candidate overall historical cumulative value, the method further includes: Comparing the current interaction value with the overall limit value of each overall dimension, and comparing the current interaction value with the individual limit value of each individual dimension; The adding the current interaction value to the overall historical cumulative value to obtain a candidate overall historical cumulative value includes: when the current interaction value is less than the overall limit value and the current interaction value is less than the individual limit value, adding the current interaction value to the overall historical cumulative value to obtain a candidate overall historical cumulative value.
6. The object interaction method according to claim 2, characterized in that: The updating of the overall historical cumulative value based on the updated interaction information includes: Based on the updated interaction information, the current interaction value is updated to obtain an updated interaction value; The updated interaction value is merged with the overall historical cumulative value to obtain an updated overall historical cumulative value corresponding to each overall dimension.
7. The object interaction method according to any one of claims 1 to 6, characterized in that: The preset interaction database includes a non-relational database, and after updating the overall historical cumulative value based on the interaction information and comparing the updated overall historical cumulative value with the overall limit value of the corresponding overall dimension, it also includes: When the updated overall historical cumulative value is less than or equal to the overall limit value, the updated overall historical cumulative value is stored in the non-relational database.
8. The object interaction method according to any one of claims 1 to 6, characterized in that: The step of causing the target object to interact with the interactive object based on the updated individual historical cumulative value and the individual limit value includes: Compare the updated individual historical cumulative value with the individual limit value of the corresponding individual dimension; When the updated individual history cumulative value is less than or equal to the individual limit value, the cumulative record of the interactive resource in the interactive object is updated based on the updated individual history cumulative value, and a preset first prompt information is sent to the interactive terminal corresponding to the object interaction request, where the preset first prompt information is used to prompt that the interactive object has successfully interacted with the target object; When the updated individual history cumulative value is greater than the individual limit value, a preset second prompt information is sent to the interaction terminal corresponding to the object interaction request, and the preset second prompt information is used to prompt that the interaction object fails to interact with the target object.
9. The object interaction method according to claim 8, characterized in that: The preset interactive database also includes a relational database and a non-relational database. After comparing the updated individual historical cumulative value with the individual limit value of the corresponding individual dimension, it also includes: When the updated individual history cumulative value is less than or equal to the individual limit value, obtaining the number of dimensions of the multiple individual dimensions; When the number of dimensions is greater than or equal to a number threshold, storing the updated individual historical cumulative value in the relational database; When the number of dimensions is less than a quantity threshold, the updated individual historical cumulative values are stored in the non-relational database.
10. The object interaction method according to claim 8, characterized in that: Said also includes: When the updated individual history cumulative value is greater than the individual limit value, or the updated overall history cumulative value is greater than the overall limit value, performing a system detection on the interactive system corresponding to the interactive resource to obtain a detection result of the interactive system; When the detection result indicates that there is an error in the interactive system, the execution is returned by writing to the message queue: the step of obtaining the overall limit values of multiple overall dimensions corresponding to the target object and the individual limit values of multiple individual dimensions corresponding to the interactive object, so that the interactive object interacts with the target object.
11. An object interaction device, characterized in that: include: A receiving unit, configured to receive at least one object interaction request for an interactive resource of a target object, wherein the object interaction request carries interaction information of the interactive object for the interactive resource; An acquisition unit, used to acquire overall limit values of a plurality of overall dimensions corresponding to the target object and individual limit values of a plurality of individual dimensions corresponding to the interactive object; A screening unit, used to screen out the historical cumulative value of the interactive resource from a preset interactive database, wherein the historical cumulative value includes the overall historical cumulative value of each overall dimension and the individual historical cumulative value of each individual dimension; A comparing unit, configured to update the overall historical cumulative value based on the interaction information, and compare the updated overall historical cumulative value with the overall limit value of the corresponding overall dimension; The interaction unit is used to update the individual history accumulation value when the updated overall history accumulation value is less than or equal to the overall limit value, and interact the target object with the interaction object based on the updated individual history accumulation value and the individual limit value.
12. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory stores a plurality of instructions; the processor loads instructions from the memory to execute the steps in the object interaction method according to any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the steps in the object interaction method according to any one of claims 1 to 10.
14. A computer program product, characterized in that The method comprises a computer program / instruction, wherein when the computer program / instruction is executed by a processor, the steps in the object interaction method according to any one of claims 1 to 10 are implemented.
Citation Information
Patent Citations
Device control and management system
BE1013506A4
Access flow limiting method and device, electronic equipment and storage medium
CN113010818A
Current limiting control method, current limiting control device, storage medium and electronic equipment
CN113411269A
Frequency limiting method and device, electronic equipment and storage medium
CN115730327A
Information processor, information processing system, use limitation method, program, and recording medium with the program recorded thereon
JP2011197949A