Electronic resource processing method, device, electronic equipment and storage medium

By simplifying the calculation method for judging the type of electronic resource combinations, the server's computing resource usage is reduced, the problems of slow response speed and insufficient concurrency capabilities of online game servers are solved, and the user experience is improved.

CN115282605BActive Publication Date: 2024-10-11BEIJING CHIZICHENG GRP CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202210884809.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-26
Publication Date
2024-10-11
Estimated Expiration
2042-07-26

AI Technical Summary

Technical Problem

When online game servers process electronic resource combination types, they occupy high computing resources, resulting in slow response speed and insufficient concurrency capabilities, which affects the user experience.

Method used

By dividing the user's electronic resources into combinations based on numerical values, and matching them with the preset value sets, the combination type is determined, the amount of calculation is simplified, and the CPU and memory usage are reduced.

Benefits of technology

It achieves fast and low-occupancy determination of user electronic resource combination types, improves system performance and user experience, and reduces memory usage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115282605B_ABST
    Figure CN115282605B_ABST
Patent Text Reader

Abstract

The present application discloses an electronic resource processing method, device, electronic device and storage medium. The method includes: the server determines that the first user's multiple electronic resources do not contain electronic resources with variable attributes; the server divides all the first user's current electronic resources according to the numerical values ​​corresponding to the electronic resources, obtains the number of electronic resources of each numerical value, and forms a combination of the number of electronic resources of the first user based on the number of electronic resources of various numerical values; the server matches the combination of the number of electronic resources with multiple preset numerical value sets, and the multiple preset numerical value sets correspond to multiple preset electronic resource combination types respectively; the electronic resource combination type corresponding to the successfully matched numerical value set is determined as the combination type to which the first user's current electronic resources belong. The embodiments of the present application can reduce computing resource usage, improve server performance, and enhance user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of software testing technology, and in particular to an electronic resource processing method, device, electronic device and computer-readable storage medium. Background Art

[0002] Generally, in theory, online game servers should be able to support an unlimited number of clients online at the same time, which is a great test for server performance. In addition, the clients of large online games usually do not perform logical processing on data, and most of the logical calculations are processed on the server side. The frequency of data transmission between the client and the server is high, and the connection is usually maintained for a long time. Therefore, the response speed, concurrency, connection stability and other performance of the server side determine the user experience of the client user. Therefore, online game servers have high requirements for hardware and overall system architecture. The server should be secure, highly maintainable, highly scalable, load-balanced and support high concurrent requests. For this reason, the selection and architecture construction of some large online game servers are different from those of conventional network servers, all of which aim to improve the performance of game servers. In this technical context, the purpose of this article is to provide a computer resource-friendly virtual electronic resource processing solution to optimize the CPU usage of the server central processing unit and optimize the memory usage, thereby improving the overall performance of the game server and improving the user experience. Summary of the invention

[0003] In view of this, embodiments of the present application provide an electronic resource processing method, device, electronic device, and computer-readable storage medium to solve at least one technical problem.

[0004] In a first aspect, an embodiment of the present application provides an electronic resource processing method, which is applied to a server, wherein the electronic resources include electronic resources with variable attributes and electronic resources with immutable attributes, and the attributes of the electronic resources are at least represented by numerical values ​​corresponding to the electronic resources; the electronic resource processing method includes:

[0005] The server determines that the first user's multiple electronic resources do not include electronic resources with variable attributes;

[0006] The server divides all current electronic resources of the first user according to the values ​​corresponding to the electronic resources, obtains the number of electronic resources of each value, and forms a combination of the number of electronic resources of the first user based on the numbers of electronic resources of various values;

[0007] The server matches the electronic resource number combination with a plurality of preset value sets, and the plurality of preset value sets correspond to a plurality of preset electronic resource combination types respectively; wherein, when the server matches the electronic resource number combination with a first value set, a single number in the electronic resource number combination is compared with each value in the first value set, and if the current number in the electronic resource number combination is less than or equal to the current value in the first value set, the current value in the first value set is marked; each number in the electronic resource number combination is traversed, and during the traversal process, the marked values ​​in the first value set are not included in the comparison range; when traversing to the last number, if there are one or more unmarked values ​​in the first value set, and at least one unmarked value is greater than or equal to the last number, the match is successful;

[0008] The server determines the electronic resource combination type corresponding to the successfully matched value set as the combination type to which the current electronic resource of the first user belongs.

[0009] According to the method of the embodiment of the present application, before the server divides all current electronic resources of the first user according to the numerical values ​​corresponding to the electronic resources, the method also includes: the server determines that the multiple electronic resources of the first user include at least one electronic resource with variable attributes; and the server filters the at least one electronic resource with variable attributes.

[0010] According to the method of the embodiment of the present application, optionally, a single preset numerical value combination includes N numerical values, the sum obtained by adding the N numerical values ​​is equal to 5, and 2≤N≤5.

[0011] According to the method of an embodiment of the present application, optionally, the multiple preset numerical combinations include: {1,4}, {2,3}, {1,2,2} and {1,1,1,2}; wherein {1,4} corresponds to the first combination type, {2,3} corresponds to the second combination type, {1,2,2} corresponds to the third combination type, and {1,1,1,2} corresponds to the fourth combination type.

[0012] According to the method of an embodiment of the present application, optionally, the set of numerical values ​​that successfully matches the current number combination of electronic resources of the first user is {1,1,1,1,1}, and the difference between the maximum value and the minimum value in the current electronic resources of the first user is less than or equal to 5, then the server determines that the current electronic resources of the first user belong to the fifth combination type; if the difference between the maximum value and the minimum value is greater than 5, then the server determines that the current electronic resources of the first user belong to the sixth combination type.

[0013] In a second aspect, an embodiment of the present application provides an electronic resource processing device, wherein the electronic resources include electronic resources with variable attributes and electronic resources with immutable attributes, and the attributes of the electronic resources are at least represented by numerical values ​​corresponding to the electronic resources; the electronic resource processing device includes:

[0014] An attribute determination module, used to determine that the first user's multiple electronic resources do not include electronic resources with variable attributes;

[0015] a division module, configured to divide all current electronic resources of the first user according to the values ​​corresponding to the electronic resources, obtain the number of electronic resources of each value, and form a combination of the number of electronic resources of the first user based on the numbers of electronic resources of various values;

[0016] A matching module, used for matching the electronic resource number combination with a plurality of preset value sets, wherein the plurality of preset value sets correspond to a plurality of preset electronic resource combination types respectively; wherein, when the server matches the electronic resource number combination with a first value set, a single number in the electronic resource number combination is compared with each value in the first value set, and if the current number in the electronic resource number combination is less than or equal to the current value in the first value set, the current value in the first value set is marked; each number in the electronic resource number combination is traversed, and during the traversal process, the marked values ​​in the first value set are not included in the comparison range; when traversing to the last number, if there are one or more unmarked values ​​in the first value set, and at least one unmarked value is greater than or equal to the last number, the match is successful;

[0017] A result determination module is used to determine the electronic resource combination type corresponding to the successfully matched value set as the combination type to which the current electronic resource of the first user belongs.

[0018] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, the steps of the method described above are implemented.

[0019] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which computer program instructions are stored, and the computer program instructions, when executed by a processor, implement the steps of the method described above.

[0020] In a fifth aspect, an embodiment of the present application provides a computer program product, wherein the computer program product includes computer program instructions, and when the computer program instructions are executed by a processor, the steps of the method described above are implemented.

[0021] The solution provided in the embodiment of the present application is used to determine the combination type of the user's electronic resources. The matching process involves comparing the size of Arabic numerals in the numerical combination and simple marking actions. Once the match is successful, the combination type can be determined without continuing to match other numerical combinations. The implementation method is easy to understand, the system is easy to maintain, the CPU usage is friendly, the response speed is fast, and the system performance and user experience can be significantly improved. In addition, in addition to introducing numerical combinations corresponding to different combination types that occupy a small amount of memory, the embodiment of the present application will not introduce other larger memory usage, thereby achieving the technical advantage of optimizing memory usage. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following briefly introduces the drawings in the embodiments of the present application.

[0023] Figure 1 It is a schematic diagram of a system architecture of an embodiment of the present application.

[0024] Figure 2 It is a flowchart of the electronic resource processing method of the embodiment of the present application.

[0025] Figure 3 It is a schematic diagram of an operation process of the electronic resource processing method of an embodiment of the present application.

[0026] Figure 4 It is a structural block diagram of the electronic resource processing device according to an embodiment of the present application.

[0027] Figure 5 It is a schematic diagram of the main process of judging the combination type.

[0028] Figure 6 It is a schematic diagram of an electronic device used to implement the electronic resource processing method of an embodiment of the present application. DETAILED DESCRIPTION

[0029] The principles and spirit of the present application will be described below with reference to several exemplary embodiments. It should be understood that the purpose of providing these embodiments is to make the principles and spirit of the present application clearer and more thorough, so that those skilled in the art can better understand and implement the principles and spirit of the present application. The exemplary embodiments provided herein are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments herein, all other embodiments obtained by ordinary technicians of the art without creative work are within the scope of protection of this application.

[0030] The embodiments of the present application may be implemented as a system, device, apparatus, method, computer-readable storage medium or computer program product. Therefore, the present disclosure may be specifically implemented in at least one of the following forms: complete hardware, complete software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.

[0031] According to the implementation mode of the present application, the present application requests protection for an electronic resource processing method, device, electronic device and computer-readable storage medium.

[0032] Figure 1 A schematic diagram of a system architecture in an embodiment of the present application is schematically shown, including a server 10 and several terminal devices 20. In some examples, the terminal device 20 may be a general terminal device, such as a personal computer PC, a laptop computer, a mobile phone, a tablet computer, a vehicle-mounted device, a navigation device, a handheld gaming device, etc.; in some examples, the terminal device 20 may also be a smart wearable device, such as a head-mounted display device (HMD), an augmented reality (AR) device, a virtual reality (VR) device, an AR / VR helmet, an AR / VR glasses, a smart glove, a smart clothing, etc.

[0033] In some examples, software or an application APP with corresponding functions is installed in the terminal device 20. The server 10 may be a management server or an application server of the software or APP. The server 10 may be a single server, a server cluster consisting of multiple servers, a cloud server or a cloud server, etc. The terminal device 20 may be integrated with a module with networking functions, such as a wireless fidelity (Wifi) module, a Bluetooth module, a 2G / 3G / 4G / 5G communication module, etc., so as to connect to the server 10 through the network.

[0034] Exemplarily, the first user can log in to the first user account through the app installed in the mobile phone and communicate with the server 10; the second user can log in to the second user account through the software installed in the PC and communicate with the server 10.

[0035] In this document, terms such as first, second, etc. are only used to distinguish one entity (or operation) from another entity (or operation), and do not require or imply any order or association between these entities (or operations). In this document, the elements (such as parts, components, processes, steps) defined by the sentence "including..." do not exclude the existence of other elements in addition to the listed elements, that is, other elements that are not explicitly listed may also be included. In this document, any elements and their quantities in the drawings are used for illustration rather than limitation, and any names in the drawings are only used for distinction and do not have any limiting meaning.

[0036] The following is a detailed explanation of the principles and spirit of the present application with reference to several exemplary or representative embodiments of the present application.

[0037] First, a brief description of the concepts, technical terms and other related contents that may be involved in this article is given.

[0038] The electronic resources (or virtual resources, virtual electronic resources, network resources, network electronic resources) involved in this article are virtual resources provided by the online game platform for client users. Network electronic resources can include various forms or types, such as specified models, specified roles, specified props, or accessories of specified models, roles or props, such as accessories, decorations, parts, etc., or virtual property owned or related to specified models, roles or props, such as points, coupons, coins, cards, etc. The virtual resources used in different online games vary greatly. The electronic resources of online games and the combination between the electronic resources are directly related to the computing power required by the server. The scheme of the present invention is to plan the computing power of the server from the combination of electronic resources and electronic resources.

[0039] In some embodiments, the electronic resource can be characterized by at least a numerical value and an attribute corresponding to the electronic resource. For example, the numerical value corresponding to the electronic resource can be a positive integer: 1-10 or 1-15 or other numerical values. The attributes of the electronic resource can be in various forms, such as the characteristics corresponding to the electronic resource, such as classification, pattern, color or a combination thereof, such as a red square card, a black rose ring, etc.

[0040] In some embodiments, the computing power required by the server is related to the combination of multiple electronic resources of the user; more specifically, it is related to different combinations of values ​​and attributes of network electronic resources. In other words, the server needs to obtain the network electronic resources currently held by each user, and then determine the combination of electronic resources owned by different users. Different types of electronic resource combinations require different server computing power and different resources to be allocated.

[0041] In order to enable the server to call enough resources to provide the required computing power, the server will predict the computing power required in the future. Then, the server determines the combination type of electronic resources. "Combination type judgment" is one of the key links in the server's backend calculation, which directly affects the performance and user experience of the online game platform.

[0042] The technical problem existing in the prior art is that the online game server needs to have a high response speed and high concurrency capability, and maintain high-performance operation of the system platform for a long time, so as to provide online game users with fast and accurate network electronic resource combination type judgment and processing. Otherwise, if there are situations such as a sudden increase in CPU usage or serious memory usage, the performance of the server will be affected, the background will not be able to calculate quickly, and the calculation results will not be fed back to the client, which will cause the system platform or client to become stuck, buffer for a long time, etc. If this happens frequently, it will seriously affect the platform user experience.

[0043] In this case, people have made various efforts to optimize and improve the performance of online game servers as a whole. Multiple embodiments of the present application provide an electronic resource processing method. The core concept of the method is to greatly simplify the calculation amount of the combination type judgment of electronic resources by reasonably designing an algorithm, reduce the computing resource occupation of the judgment link, reduce the CPU occupation and memory occupation of the judgment link, and obtain a solution that is computing resource-friendly and does not introduce a large memory occupation.

[0044] refer to Figure 2 , shows a flowchart of the electronic resource processing method of the embodiment of the present application, which is applied to the server. The electronic resource is characterized by at least the value and attribute of the electronic resource. As understood, the difficulty of judging the electronic resource combination type lies in that the electronic resource is variable. In this embodiment, the electronic resource may include the following two types:

[0045] a. Electronic resources with variable attributes; and

[0046] b. Electronic resources with immutable attributes.

[0047] Based on this, the electronic resource processing method of the embodiment of the present application includes the following steps:

[0048] S101, the server determines that the first user's multiple electronic resources do not include electronic resources with variable attributes;

[0049] S102, the server divides all current electronic resources of the first user according to the values ​​corresponding to the electronic resources, obtains the number of electronic resources of each value, and forms a combination of the number of electronic resources of the first user based on the numbers of electronic resources of various values;

[0050] S103, the server matches the electronic resource number combination with a plurality of preset value sets, where the plurality of preset value sets correspond to a plurality of preset electronic resource combination types respectively;

[0051] When the server matches the electronic resource number combination with the first value set, it can be processed as follows:

[0052] Comparing a single number in the electronic resource number combination with each value in the first value set, and marking the current value in the first value set if the current number in the electronic resource number combination is less than or equal to the current value in the first value set;

[0053] Traversing each number in the electronic resource number combination, and in the traversal process, excluding the marked values ​​in the first value set from the comparison range;

[0054] When traversing to the last number, if there are one or more unmarked values ​​in the first value set, and at least one unmarked value is greater than or equal to the last number, the match is successful;

[0055] S104: The server determines the electronic resource combination type corresponding to the successfully matched value set as the combination type to which the current electronic resource of the first user belongs.

[0056] According to the algorithm design of the embodiment of the present application, the server can first determine whether the electronic resources of the current user (first user) contain electronic resources with variable attributes. After determining that there are no electronic resources with variable attributes, the electronic resources of the user are divided. The division standard is the numerical value or numerical size of the electronic resources, that is, electronic resources with the same numerical size are divided into one category, and one or more categories can be obtained, and each category contains one or more electronic resources with the same numerical value.

[0057] After the division, the number (or quantity, number) of electronic resources in each class is determined. For example, if the user currently has three virtual electronic resources, one of which has a value of K and the other two have values ​​of L, then they can be divided into two classes, one with one electronic resource and the other with two electronic resources. The number of electronic resources corresponding to each class is combined to form an "electronic resource number combination". For the convenience of description, the electronic resource number combination can be recorded as D. In this example, the electronic resource number combination D = {1,2}.

[0058] After obtaining the user's current electronic resource number combination D, it is matched with multiple pre-set numerical combinations. Specifically, here, the pre-set numerical combination is related to the combination type, and a single numerical combination contains multiple positive integers, that is, numerical combinations can be set for different combination types. For example, the numerical combination corresponding to the first combination type is {1,2,2}, and the numerical combination corresponding to the second combination type is {2,3}, and so on. The embodiment of the present application matches D with these numerical combinations, and the combination type corresponding to the successfully matched numerical combination is the combination type of the user's current electronic resources.

[0059] The following describes a process of matching the user's electronic resource number combination D with any one of a plurality of preset value combinations (hereinafter referred to as a first value combination, denoted as M).

[0060] (1) Record one number in the electronic resource number combination D as D1, record one number in the first numerical value combination M as M1, compare D1 with M1, and if D1≤M1, M1 is marked, for example, M1 is marked as "compared" (in operation, a fixed character may be used to represent it); if D1>M1, no mark is made;

[0061] (2) Next, D1 is compared with another number M2 in the first numerical combination M. If D1≤M2, M2 is marked; if D1>M2, no mark is made;

[0062] (3) This process continues until D1 is compared with every number in M, that is, D1 is used to traverse every value in M. At this point, the obtained M meets at least one of the following conditions:

[0063] ●Some values ​​in M ​​are marked, while others are not.

[0064] ●All values ​​in M ​​are marked;

[0065] ●All values ​​in M ​​are unmarked.

[0066] (4) After that, similarly, another number D2 in the electronic resource number combination D is compared with each number in M, and the values ​​that meet the requirements are marked. It should be noted that for the values ​​in M ​​that have been marked, there is no need to compare them again this time. For example, assuming that M1 has been marked, there is no need to compare D2 with M1. Instead, D2 is compared with unmarked M2, M3, etc. If D2≤M2, M2 is marked this time; this is repeated until D2 is used to traverse each value in M; similarly, D3 is used to traverse each value in M;

[0067] (5) In this way, each number in D is used to traverse each value in M, and during the traversal process, the marked values ​​in M ​​are no longer involved in the comparison;

[0068] (6) When the last number in D is traversed (denoted as D Z ), the following processing is performed: If there are still unmarked values ​​in M ​​at this time, and at least one of the unmarked values ​​is greater than or equal to D Z , it is considered that the match is successful, that is, the combination type of the electronic resources currently held by the user is the combination type corresponding to the first numerical combination M;

[0069] (7) On the contrary, when traversing to the last number D in D Z When all the values ​​in M ​​are marked, or, although there are still unmarked values ​​in M, none of these unmarked values ​​is greater than or equal to D Z The values ​​(that is, these unmarked values ​​are all less than D Z ), it is considered that the match has failed, and the combination type of the electronic resources currently held by the user is not the combination type corresponding to the first numerical combination M.

[0070] In order to determine the combination type corresponding to the user, it is necessary to continue to match the user's current electronic resource number combination D with the remaining numerical combinations in the preset multiple numerical combinations, and repeat the above processing steps (1)-(7). After the match is successful, the user combination type can be determined accordingly based on the successfully matched numerical combination.

[0071] It can be seen that according to the above embodiments of the present application, the combination type of the user's electronic resources is determined. In fact, the matching process only involves the comparison of the size of Arabic numerals and simple marking actions, and does not involve the comparison of the attributes of the electronic resources. In addition, once the match is successful, the combination type can be determined without continuing to match other numerical combinations. The implementation method is easy to understand, the system is easy to maintain, the CPU occupancy rate is quite low, the calculation speed is fast, the response is fast, and the user experience can be significantly improved. Compared with the previous full traversal judgment process (it is necessary to exhaust all possible combinations, make two-by-two comparisons, until the combination that meets the rules is finally determined to determine the user's combination type), the embodiment of the present application avoids the conventional forced full traversal processing, thereby greatly reducing the amount of calculation and reducing CPU occupancy; and, in addition to the introduction of the numerical combination corresponding to the combination type, the embodiment of the present application occupies less memory, so it can also achieve the technical advantage of optimizing memory occupancy.

[0072] Optionally, the following steps may also be performed in the embodiment of the present application:

[0073] S10: The server determines that the plurality of electronic resources of the first user include at least one electronic resource with a variable attribute;

[0074] S20: The server filters the electronic resources with at least one variable attribute.

[0075] The above two steps can be performed before the aforementioned step S101, that is, if virtual electronic resources with variable attributes are involved, the virtual electronic resources with variable attributes are filtered out, so that the remaining resources are all resources with immutable attributes, and then the subsequent steps S102-S104 are continued to be processed. The above processing can be performed for each participating user.

[0076] In an embodiment of the present application, optionally, a single preset numerical combination (that is, any numerical combination of a plurality of preset numerical combinations) includes N numerical values, each of which is a positive integer, and the sum of these N numerical values ​​is 5, and 2≤N≤5.

[0077] The reason for such design or setting is that, assuming there are 5 virtual electronic resources, according to the rules, the number of virtual electronic resources with the same numerical value is at most 4 and at least 1. Constructing numerical combinations corresponding to different combination types in accordance with the above-mentioned embodiment is consistent with the actual situation, and the matching results are accurate and reliable.

[0078] For example, a single numerical combination may contain at least 2 numerical values, which may be expressed as M = {M1, M2}, and the sum of the 2 numerical values ​​is M1 + M2 = 5;

[0079] For another example, a single numerical combination can contain a maximum of 5 numerical values, which can be expressed as M={M1, M2, M3, M4, M5}, and the sum of the 5 numerical values ​​is M1+M2+M3+M4+M5=5.

[0080] For another example, a single numerical combination may include 3 numerical values, which can be expressed as M = {M1, M2, M3}, and the sum of the 3 numerical values ​​is M1 + M2 + M3 = 5. The rest of the cases can be deduced in the same way.

[0081] As an example, optionally, multiple preset numerical value combinations may include the following forms: {1,4}, {2,3}, {1,2,2}, {1,1,1,2} and {1,1,1,1,1}, which conforms to the above construction method.

[0082] As an example, optionally, a plurality of preset value combinations and their corresponding combination types may be recorded as:

[0083] ①{1,4}, corresponding to Class A combination;

[0084] ②{2,3}, corresponding to type B combination;

[0085] ③{1,2,2}, corresponding to type C combination;

[0086] ④{1,1,1,2}, corresponding to Class D combination;

[0087] ⑤{1,1,1,1,1}, corresponding to Class E or Class F combination.

[0088] Optionally, in the matching process, the matching process can be performed in the order of ① to ⑤ (①→②→③→④→⑤). That is, after obtaining the user's current number combination D, D can be matched with ①{1,4} first. If the match is unsuccessful, D can be matched with ②{2,3} until the match is successful. The advantage of this process is that according to the combination types corresponding to the numerical combinations of ① to ⑤, according to the above smooth processing, redundant calculations can be avoided to the greatest extent, and resource optimization can be maximized. Optionally, the patterns of ① to ⑤ can be defined using C++ vector structures.

[0089] As an example, optionally, when the preset value combination is {1,1,1,1,1}, there are the following two cases:

[0090] ■Case 1: If the preset numerical combination that successfully matches the current number combination of electronic resources of the first user is {1,1,1,1,1}, and the difference between the maximum and minimum numerical values ​​in the current electronic resources of the first user is less than or equal to 5, then the combination type of the current electronic resources of the first user is a Class E combination.

[0091] ■Case 2: If the preset numerical value combination that successfully matches the current number combination of electronic resources of the first user is {1,1,1,1,1}, and the difference between the maximum value and the minimum value in the current electronic resources of the first user is greater than 5, then the combination type of the current electronic resources of the first user is a Class F combination.

[0092] The aforementioned Class A combination, Class B combination, Class C combination, Class D combination, Class E combination and Class F combination can be used to determine the ranking for players in online games, etc.

[0093] By operating in accordance with at least one of the above-mentioned embodiments of the present application, the step of determining the user's electronic resource combination type can be completed accurately and quickly, system resources can be saved, the processing logic is easy to understand, the operability is strong, the system is easy to maintain, and the overall system performance can be fundamentally improved, the user experience is improved, and the comprehensive competitiveness of the system is improved.

[0094] For the convenience of description, most of the embodiments of the present application are described as a combination of a series of actions. Those skilled in the art should know that the present application is not limited by the order of the actions described, because some steps in the embodiments of the present application can be processed in other orders or simultaneously.

[0095] To facilitate understanding, some operational modes that may be adopted in the embodiments of the present application are described below through illustrative specific examples.

[0096] The purpose of this example is to optimize the judgment algorithm of electronic resource combination types and propose quantity patterns corresponding to various combination types. When judging, matching is performed based on the quantity pattern. Once the matching quantity pattern is obtained, the corresponding combination category is obtained. There is no need to perform multiple combinations and comparisons, which can greatly save server computing power. Figure 3 , the processing steps of this example are as follows.

[0097] ●Step 1:

[0098] The current user has 5 electronic resources. Hereinafter, the original electronic resource group is denoted as C. First, the variable resources are filtered out to obtain a combination after removing the variable resources, which is denoted as C1.

[0099] Assume that C is {9S, 9H, 10C, Changeable1, changeable2}, and after filtering out the two virtual resources with changeable attributes, C1 is obtained as {9S, 9H, 10C}.

[0100] ●Step 2:

[0101] According to the numerical value of the virtual resources, C1 is classified and counted, and the result is recorded as D.

[0102] By classifying and counting {9S, 9H, 10C}, we can get that D includes two categories: one is: the values ​​of the two virtual resources are the same, both 9; the other is: there is only one virtual resource, which is 10, so we can get D is {2,1}.

[0103] ●Step 3:

[0104] When judging the combination category, D is traversed, that is, each number in D (which can be recorded as Di, Di is 2 or 1 in this example) is matched with the quantity pattern (which can be recorded as M).

[0105] The matching process of the quantity pattern is as follows: traverse the numbers in the result D obtained in step 2. For example, for the number Di, compare each number in the quantity pattern M in turn to see if there is a value in M ​​that has not been marked and is not less than Di. If so, mark the value and continue to compare it with other values ​​in M; if not, it means that the current quantity pattern M is not the category of the user's virtual resource group C; then continue to match the next quantity pattern.

[0106] The definition of the quantity mode can be defined using an ascending mode definition. The following is an exemplary definition of a quantity mode using a C++ vector structure:

[0107] (1) The quantity pattern corresponding to the A-type combination is defined as {1,4},

[0108] (2) The quantity pattern corresponding to the Class B combination is defined as {2,3},

[0109] (3) The quantity pattern corresponding to the C-type combination is defined as {1,2,2},

[0110] (4) The quantity pattern corresponding to the D-type combination is defined as {1,1,1,2},

[0111] (5) The quantity pattern corresponding to the E-type combination or the F-type combination is defined as {1,1,1,1,1},

[0112] In this example, the reason why the quantity pattern M is defined in ascending order is to be compatible with the unordered traversal processing of the combination D. Therefore, when matching, the smallest value that meets the quantity pattern requirements can be occupied, and the occupied values ​​need to be marked, for example, marked as "used", and each value can be used at most once.

[0113] The judgment logic of whether the quantity pattern matches is: if there is at least one number greater than or equal to the current comparison number (such as Di) among the unoccupied values, the match is considered successful.

[0114] In this example, if the result of D is 2 9s and 1 10, D = {2,1}. When D is matched with the quantity pattern {1,4} in item (1), the number 1 in {2,1} matches the number 1 in {1,4} (1≤1), and the number 2 in {2,1} matches the number 4 in {1,4} (2≤4), and the match is successful. Therefore, the category of the user's original virtual resource combination C meets the quantity pattern {1,4} of the Class A combination, and the original virtual resource combination C is judged to be a Class A combination. At this point, there is no need to match D with the quantity patterns in items (2)-(5), which can greatly save the computing power of the server and improve the overall performance of the system.

[0115] ●Step 4:

[0116] In the case of matching failure, it means that the current quantity pattern is not the category of the user's original virtual resource group C. Then, the above steps can be followed to match the next quantity pattern with D until a matching quantity pattern is found, and the corresponding combination category of the attribute variable virtual resources is obtained.

[0117] Some concepts that may be involved in the previous description are as follows. Attribute-variable virtual resources refer to: when they are paired with other attribute-immutable virtual resources of the current user, they can be used as any virtual resource other than the attribute-immutable virtual resources. A combination of virtual resources refers to: the current user is allocated, for example, 5 virtual resources, and these 5 virtual resources constitute a combination (the numerical value and mark color of each virtual resource in the combination corresponds to a combination category, and the server needs to determine which specific category it is). A combination category refers to: based on the judgment of each numerical value and color in the virtual resource combination, determine the combination category to which it belongs, which can be recorded as: Class A combination, Class B combination, Class C combination, Class D combination, Class E combination, Class F combination, Class G combination, and so on.

[0118] Corresponding to the method embodiment provided in the present application, the present application also provides an electronic resource processing device. Figure 4 The schematic diagram of the structure of an embodiment of an electronic resource processing device is shown. The electronic resource processing device 100 includes:

[0119] The attribute determination module 110 is used to determine that the first user's multiple electronic resources do not include electronic resources with variable attributes;

[0120] A division module 120, configured to divide all current electronic resources of the first user according to the values ​​corresponding to the electronic resources, obtain the number of electronic resources of each value, and form a combination of the number of electronic resources of the first user based on the numbers of electronic resources of various values;

[0121] A matching module 130 is used to match the electronic resource number combination with a plurality of preset value sets, wherein the plurality of preset value sets correspond to a plurality of preset electronic resource combination types respectively; wherein when the server matches the electronic resource number combination with a first value set, a single number in the electronic resource number combination is compared with each value in the first value set, and if the current number in the electronic resource number combination is less than or equal to the current value in the first value set, the current value in the first value set is marked; each number in the electronic resource number combination is traversed, and during the traversal process, the marked values ​​in the first value set are not included in the comparison range; when traversing to the last number, if there are one or more unmarked values ​​in the first value set, and at least one unmarked value is greater than or equal to the last number, the match is successful;

[0122] The result determination module 140 is used to determine the electronic resource combination type corresponding to the successfully matched value set as the combination type to which the current electronic resource of the first user belongs.

[0123] Optionally, the attribute determination module 110 is further used to determine whether the first user's multiple electronic resources include electronic resources with variable attributes; the electronic resource processing device 100 also includes a filtering module 150, which is used to filter the electronic resources with variable attributes among the first user's multiple electronic resources.

[0124] Optionally, a single preset numerical value combination includes N numerical values, the sum of the N numerical values ​​is equal to 5, and 2≤N≤5.

[0125] Optionally, the multiple preset numerical combinations include at least one of the following: {1,4}, {2,3}, {1,2,2} and {1,1,1,2}; wherein {1,4} corresponds to the first combination type, {2,3} corresponds to the second combination type, {1,2,2} corresponds to the third combination type, and {1,1,1,2} corresponds to the fourth combination type.

[0126] Optionally, the set of values ​​that successfully matches the current number of electronic resources of the first user is {1,1,1,1,1}, and the difference between the maximum value and the minimum value in the current electronic resources of the first user is less than or equal to 5, then the server determines that the current electronic resources of the first user belong to the fifth combination type, and if the difference between the maximum value and the minimum value is greater than 5, then the server determines that the current electronic resources of the first user belong to the sixth combination type.

[0127] It should be noted that the embodiments described in this article are preferred embodiments, and the actions, steps, modules or units involved are not necessarily required by the embodiments of this application. The descriptions of various embodiments in this article have different focuses. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0128] In order to help more accurately understand the design principles and technical advantages of the embodiments of the present application, the following briefly describes the calculation process of a server using a traditional algorithm to determine the category of a virtual resource combination.

[0129] Most existing servers use a brute force full traversal algorithm when performing combination category judgment, which consumes a lot of computing resources. The general process of the brute force full traversal algorithm is to first filter the virtual resources with variable attributes in the user's current combination to obtain the number of virtual resources remaining in the user, temporarily remove the virtual resources with immutable attributes in the user's current combination, and combine all the remaining virtual resources. After these combinations are matched with the virtual resources with immutable attributes one by one to form a complete 5 virtual resources, they are regarded as virtual resources without variable attributes, and then calculated based on the conventional judgment main process, and finally the best combination type among all combinations is selected.

[0130] In other words, the brute force full traversal solution is based on the conventional judgment main process, and it is necessary to traverse all possible combinations, obtain the results of each combination type, and compare the results of each combination type until the best combination type is obtained. This brute force full traversal operation has a high CPU usage, the number of users that a single server can carry cannot be expanded, and the system performance is poor.

[0131] In addition to the brute force full traversal algorithm, a table lookup scheme can also be adopted to determine the combination type. Specifically, the table lookup judgment algorithm is based on the brute force full traversal scheme. According to the different numbers of virtual resources with variable attributes, for each number of virtual resources with variable attributes, the combination of virtual resources with complete attributes is pre-calculated to obtain the best type of each combination of virtual resources with immutable attributes and record it in a table. Subsequently, the combination of virtual resources with immutable attributes in the virtual resource combination is used as an index identifier to obtain the result of the combination type by looking up the table.

[0132] In other words, the table lookup judgment scheme requires the pre-execution of the brute force full traversal scheme. In fact, the table lookup judgment scheme is equivalent to an iteratively improved version of the brute force full traversal scheme. Calculation and data storage based on the brute force full traversal scheme will occupy additional memory space and network read and write IO consumption, which is space for time. If the data resides in the business process, it will also increase the resident memory usage of the related business machines. If the data is stored in the database, each judgment requires a network IO, which consumes a lot of overhead. In addition, if the number of specified attribute variable virtual resources changes, it needs to be updated according to the new number combination. Therefore, there is still the problem of difficulty in list maintenance, and the overall performance of the system cannot be significantly improved.

[0133] For reference, Figure 5 The main process of judging an existing virtual resource combination type is schematically shown.

[0134] It should be emphasized here that Figure 5 The judgment process given in and the combination types involved in the process are all well-known contents and are not the objects of improvement of the embodiments of the present application.

[0135] Generally speaking, the combination types are judged in order from best to worst to see if they match a certain combination. If they match, they are the combination type. If they do not match, the subsequent judgment process continues until the best combination is found. Taking a virtual resource group containing 5 virtual resources and the number of virtual resources with variable attributes as an example, the steps of the main judgment process are briefly described as follows:

[0136] 1) First, if the five virtual resources in the user's original virtual resource group C contain virtual resources with changeable attributes, filter out the virtual resources with changeable attributes, and record the remaining virtual resource combination as C1. For example, the user's original virtual resource group C = {9, J, Q, Changeable1, changeable2}, after filtering two virtual resources with changeable attributes, C1 = {9, J, Q} is obtained.

[0137] 2) Filter out the virtual resources in C1 from the virtual resource library (e.g., a total of 52 different virtual resources), and combine the remaining virtual resources in sequence to obtain all possible combinations, denoted as S. For example, filter out 3 virtual resources in C1 from the virtual resource library, leaving 49 virtual resources, and combine them in pairs to obtain all possible combinations of virtual resources with variable attributes.

[0138] 3) Take each combination in S in turn, record it as S1, combine S1 and C1 to form 5 virtual resources with immutable attributes, and then perform the operation on the combination of these 5 virtual resources with immutable attributes. Figure 5The main process of , we can get its combination type, denoted as T1.

[0139] 4) In step (3), the results of two consecutive main process judgments need to be compared. Each comparison saves the best combination among the combinations that have been compared and judged at that time, and the best combination is recorded as T.

[0140] 5) After traversing all combinations, the best combination T obtained is the combination of virtual resources with variable attributes.

[0141] In this field, when a brute force full traversal algorithm or a table lookup judgment algorithm is used, a similar main judgment process as described above will be executed.

[0142] The following will Figure 5 A brief explanation of the types of combinations involved is given below.

[0143] It should be clear that the following contents regarding virtual resource combinations or combination types are all well-known contents and are not the objects of improvement of the embodiments of the present application.

[0144] The virtual resources in the virtual resource combination may form the following combinations, from best to worst:

[0145] 1) The optimal combination may be a Class E combination, such as a combination of multiple virtual resources of continuous size and consistent color;

[0146] 2) Next to the E-type combination may be the A-type combination, for example, a combination of four virtual resources with the same value;

[0147] 3) The next lower than the Class A combination may be the Class B combination, for example, a combination of three virtual resources with the same values ​​and another two virtual resources with the same values;

[0148] 4) The next best combination to Class B is Class C, such as a combination of two pairs of virtual resources with identical values;

[0149] 5) The next lower category than category C combinations may be category D combinations, such as a combination consisting of a pair of virtual resources with the same value;

[0150] 6) The worst combination may be a Class F combination, such as a combination consisting of multiple scattered virtual resources of discontinuous sizes.

[0151] The present application also provides a server, which includes a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, the electronic resource processing method of any of the above embodiments is implemented. Figure 6 A schematic diagram of the hardware structure of an embodiment of a server provided in the present application is shown. The server may include a processor 601 and a memory 602 storing computer program instructions.

[0152] Specifically, the processor 601 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.

[0153] The memory 602 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 602 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 602 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 602 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 602 is a non-volatile solid-state memory.

[0154] The memory may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Therefore, typically, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described in any of the electronic resource processing methods in the above-mentioned embodiments.

[0155] The processor 601 implements any one of the electronic resource processing methods in the above embodiments by reading and executing computer program instructions stored in the memory 602 .

[0156] In one example, the server may further include a communication interface 603 and a bus 610. The processor 601, the memory 602, and the communication interface 603 are connected and communicate with each other via the bus 610. The server in the embodiment of the present application may also be other computing devices or a cloud server.

[0157] The communication interface 603 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.

[0158] Bus 610 includes hardware, software or both, and the parts of online data flow billing equipment are coupled to each other. For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front-end bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 610 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the present application considers any suitable bus or interconnection.

[0159] In addition, in combination with the electronic resource processing method in the above embodiment, the embodiment of the present application can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any electronic resource processing method in the above embodiment is implemented.

[0160] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.

[0161] The functional blocks shown in the structural block diagram described above can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier. "Machine-readable medium" may include any medium capable of storing or transmitting information. The machine-readable medium may include a non-transient computer-readable storage medium, such as an electronic circuit, a semiconductor memory device, a ROM, a flash memory, an erasable ROM (EROM), a floppy disk, a CD-ROM, an optical disk, a hard disk, an optical fiber medium, and the machine-readable medium may also include a radio frequency (RF) link, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.

[0162] Aspects of the present disclosure are described above with reference to the flowchart and / or block diagram of the method, device (system) and computer program product according to the embodiment of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.

[0163] It should be understood that the scope of protection of the present application is not limited to the description herein, and any technician familiar with the technical field can easily think of various equivalent modifications or substitutions within the technical scope disclosed in the present application, and these modifications or substitutions should be included in the scope of protection of the present application.

Claims

1. An electronic resource processing method, applied to a server, characterized in that: The electronic resources include electronic resources with changeable attributes and electronic resources with immutable attributes, and the attributes of the electronic resources are at least represented by numerical values ​​corresponding to the electronic resources; the electronic resource processing method includes: The server determines that the first user's multiple electronic resources do not include electronic resources with variable attributes; The server divides all current electronic resources of the first user according to the values ​​corresponding to the electronic resources, obtains the number of electronic resources of each value, and forms a combination of the number of electronic resources of the first user based on the numbers of electronic resources of various values; The server matches the electronic resource number combination with a plurality of preset value sets, and the plurality of preset value sets correspond to a plurality of preset electronic resource combination types respectively; wherein, when the server matches the electronic resource number combination with a first value set, a single number in the electronic resource number combination is compared with each value in the first value set, and if the current number in the electronic resource number combination is less than or equal to the current value in the first value set, the current value in the first value set is marked; each number in the electronic resource number combination is traversed, and during the traversal process, the marked values ​​in the first value set are not included in the comparison range; when traversing to the last number, if there are one or more unmarked values ​​in the first value set, and at least one unmarked value is greater than or equal to the last number, the match is successful; The server determines the electronic resource combination type corresponding to the successfully matched value set as the combination type to which the current electronic resource of the first user belongs.

2. The method according to claim 1, characterized in that Before the server divides all current electronic resources of the first user according to the values ​​corresponding to the electronic resources, the method further includes: The server determines that the plurality of electronic resources of the first user include at least one electronic resource with a variable attribute; and The server filters the electronic resources with the at least one variable attribute.

3. The method according to claim 1, characterized in that A single numerical value set includes N numerical values, a sum obtained by adding the N numerical values ​​is equal to 5, and 2≤N≤5.

4. The method according to any one of claims 1 to 3, characterized in that The preset multiple value sets include at least one of the following: {1,4}, {2,3}, {1,2,2} and {1,1,1,2}; Among them, {1,4} corresponds to the first combination type, {2,3} corresponds to the second combination type, {1,2,2} corresponds to the third combination type, and {1,1,1,2} corresponds to the fourth combination type.

5. The method according to any one of claims 1 to 3, characterized in that: Also includes: The set of values ​​that successfully matches the current number of electronic resources of the first user is {1,1,1,1,1}, and the difference between the maximum value and the minimum value in the current electronic resources of the first user is less than or equal to 5, then the server determines that the current electronic resources of the first user belong to the fifth combination type; if the difference between the maximum value and the minimum value is greater than 5, then the server determines that the current electronic resources of the first user belong to the sixth combination type.

6. An electronic resource processing device, characterized in that: The electronic resources include electronic resources with changeable attributes and electronic resources with immutable attributes, and the attributes of the electronic resources are at least represented by numerical values ​​corresponding to the electronic resources; The electronic resource processing device comprises: An attribute determination module, used to determine that the first user's multiple electronic resources do not include electronic resources with variable attributes; a division module, configured to divide all current electronic resources of the first user according to the values ​​corresponding to the electronic resources, obtain the number of electronic resources of each value, and form a combination of the number of electronic resources of the first user based on the numbers of electronic resources of various values; A matching module, used for matching the electronic resource number combination with a plurality of preset value sets, wherein the plurality of preset value sets respectively correspond to a plurality of preset electronic resource combination types; wherein when the matching module matches the electronic resource number combination with a first value set, a single number in the electronic resource number combination is compared with each value in the first value set, and if the current number in the electronic resource number combination is less than or equal to the current value in the first value set, the current value in the first value set is marked; each number in the electronic resource number combination is traversed, and during the traversal process, the marked values ​​in the first value set are not included in the comparison range; when traversing to the last number, if there are one or more unmarked values ​​in the first value set, and at least one unmarked value is greater than or equal to the last number, the match is successful; A result determination module is used to determine the electronic resource combination type corresponding to the successfully matched value set as the combination type to which the current electronic resource of the first user belongs.

7. The device according to claim 6, characterized in that The attribute determination module is further used to determine that the plurality of electronic resources of the first user include electronic resources with variable attributes; The device further comprises a filtering module, which is used to filter electronic resources with variable attributes among the plurality of electronic resources of the first user.

8. A server, characterized in that: The server comprises: a processor and a memory storing computer program instructions; when the server executes the computer program instructions, the method according to any one of claims 1 to 5 is implemented.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the method according to any one of claims 1 to 5 is implemented.

10. A computer program product, characterized in that It comprises computer program instructions, which, when executed by a processor, implement the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • OBD device identification method and system based on data request types

    CN105892356A

  • Data processing method, server and device with storage function

    CN110502673A

  • Electronic resource pushing method, system and device and storage medium

    CN112398952A

  • Communication service arrangement method and device, computer equipment and storage medium

    CN113361913A

  • Method, system and product for identifying, reserving, and logically provisioning resources in provisioning data processing systems

    US20050163143A1