Step number ranking processing method and device, equipment, medium and product

By acquiring users' step count and time information, calculating scores, and combining organizational hierarchy, the problem of insufficient accuracy in step count ranking in existing technologies is solved, enabling accurate and fast step count ranking display in multi-level enterprise structures.

CN121880663APending Publication Date: 2026-04-17RICHFIT INFORMATION TECH +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
RICHFIT INFORMATION TECH
Filing Date
2024-10-15
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Existing technologies cannot accurately perform multi-level step ranking based on users' step count and time information in enterprises, resulting in insufficient ranking accuracy.

Method used

By acquiring users' step count and time information, calculating scores, and combining this with the user's organizational level, the system determines and displays the user's ranking within the organizational level. Information is stored using Redis caching and a database to ensure the accuracy and reliability of the ranking.

Benefits of technology

This technology improves the accuracy and response speed of step ranking by comprehensively considering step count and time information within a multi-level enterprise structure, ensuring the reliability and diverse display of ranking information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121880663A_ABST
    Figure CN121880663A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a step number ranking processing method and device, equipment, a medium and a product. The method comprises the following steps: acquiring step number information and time information of a user; wherein the time information represents the time spent on reaching the step number represented by the step number information; according to the step number information and the time information, score information of the user is determined; and determining and displaying ranking information of the users in the organization hierarchy according to the score information of the users and the organization hierarchy of the users. The method is used for achieving the effect of improving the accuracy of the step number ranking of the user under the enterprise.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, device, medium and product for ranking steps. Background Technology

[0002] As users' health becomes more important, their step count can be tracked, which can then motivate them to exercise more.

[0003] Therefore, there is an urgent need for a solution that can process users' walking data for businesses. Summary of the Invention

[0004] This application provides a step count ranking processing method, apparatus, device, medium, and product to improve the accuracy of step count ranking for users within an enterprise.

[0005] In a first aspect, embodiments of this application provide a method for ranking steps, comprising:

[0006] Obtain the user's step count and time information; where the time information represents the time taken to reach the number of steps represented by the step count information;

[0007] The user's score is determined based on the number of steps and the time taken.

[0008] Based on the user's score information and organizational level, determine and display the user's ranking information within the organizational level.

[0009] In one possible implementation, determining the user's score information based on step count information and time information includes:

[0010] The number of steps represented by the step count information is written into the first n positions of the preset empty space data, and the time represented by the time information is written into the last mn positions of the preset empty space data to obtain the score information; where m is the total number of digits in the preset empty space data, m is a positive integer greater than 1; n is a positive integer less than m and greater than or equal to 1.

[0011] In one possible implementation, the step count information is written into the first n positions of a preset empty space data, and the time information is written into the last mn positions of the preset empty space data to obtain score information, including:

[0012] Multiply the number of steps represented by the step count information by a first preset value to obtain a first initial score; wherein the number of digits in the first initial score is the sum of the number of digits in the first preset value and the number of digits in the step count minus 1;

[0013] The time difference is defined as the difference between the start time and the end time of the time information; the second initial score is obtained by subtracting the time difference from the second preset value; the number of digits in the second initial score is the same as the number of digits in the second preset value; the first preset value is greater than the second preset value.

[0014] Add the first initial score to the second initial score to obtain the score information.

[0015] In one possible implementation, the difference between the first preset value and the second preset value is 1.

[0016] In one possible implementation, the user's score information is determined based on step count information and time information; the user's ranking information within the organizational hierarchy is determined based on the user's score information and the user's organizational level, including:

[0017] The user's score information is determined in the cache based on the number of steps and time information; and the user's ranking information in the organizational hierarchy is determined in the cache based on the user's score information and the user's organizational hierarchy.

[0018] Step count and time information are written into the database.

[0019] In one possible implementation, displaying a user's ranking information within the organizational hierarchy includes:

[0020] In response to the user's first trigger action, the user's ranking information among all users directly corresponding to the organizational hierarchy is displayed on the interface;

[0021] Alternatively, in response to a second user-triggered action, the interface can display the user's ranking information among all users in both the organizational hierarchy and other organizational levels below it.

[0022] In one possible implementation, the method further includes:

[0023] The user's walking speed is determined based on the number of steps represented by the step count information and the time represented by the time information;

[0024] If the walking speed is determined to be greater than the preset speed, the user is identified as an abnormal user.

[0025] In one possible implementation, the method further includes:

[0026] In response to the server recovering from the anomaly, step count and time information are read from the database;

[0027] The user's score information is updated in the cache based on the step count and time information; and the user's ranking information in the organizational hierarchy is updated in the cache based on the updated score information and the user's organizational hierarchy.

[0028] In one possible implementation, the number of bits in the hierarchy identifier varies depending on the organizational level.

[0029] In one possible implementation, the method further includes:

[0030] Based on the step count information of each user belonging to the same organizational level, a first ranking list and a second ranking list are generated. The first ranking list is a ranking list of the number of users whose step count information under different organizational levels is greater than a preset number. The second ranking list is a ranking list of the average number of steps of users under different organizational levels.

[0031] Secondly, embodiments of this application provide a step ranking processing apparatus, comprising:

[0032] The acquisition module is used to acquire the user's step count and time information; where the time information represents the time taken to reach the number of steps represented by the step count information.

[0033] The processing module is used to determine the user's score based on the step count and time information;

[0034] The processing module is also used to determine and display the user's ranking information in the organizational hierarchy based on the user's score information and the user's organizational level.

[0035] In one possible implementation, the user's score information is determined based on the step count information and time information, and the processing module is used for:

[0036] The number of steps represented by the step count information is written into the first n positions of the preset empty space data, and the time represented by the time information is written into the last mn positions of the preset empty space data to obtain the score information; where m is the total number of digits in the preset empty space data, m is a positive integer greater than 1; n is a positive integer less than m and greater than or equal to 1.

[0037] In one possible implementation, the step count information is written into the first n positions of a preset empty space data, and the time information is written into the last mn positions of the preset empty space data to obtain the score information. The processing module is used for:

[0038] Multiply the number of steps represented by the step count information by a first preset value to obtain a first initial score; wherein the number of digits in the first initial score is the sum of the number of digits in the first preset value and the number of digits in the step count minus 1;

[0039] The time difference is defined as the difference between the start time and the end time of the time information; the second initial score is obtained by subtracting the time difference from the second preset value; the number of digits in the second initial score is the same as the number of digits in the second preset value; the first preset value is greater than the second preset value.

[0040] Add the first initial score to the second initial score to obtain the score information.

[0041] In one possible implementation, the difference between the first preset value and the second preset value is 1.

[0042] In one possible implementation, the user's score information is determined based on step count information and time information; the user's ranking information within the organizational hierarchy is determined based on the user's score information and the user's organizational level. The processing module is used to:

[0043] The user's score information is determined in the cache based on the number of steps and time information; and the user's ranking information in the organizational hierarchy is determined in the cache based on the user's score information and the user's organizational hierarchy.

[0044] Step count and time information are written into the database.

[0045] In one possible implementation, the processing module displays the user's ranking information within the organizational hierarchy, and is used to:

[0046] In response to the user's first trigger action, the user's ranking information among all users directly corresponding to the organizational hierarchy is displayed on the interface;

[0047] Alternatively, in response to a second user-triggered action, the interface can display the user's ranking information among all users in both the organizational hierarchy and other organizational levels below it.

[0048] In one possible implementation, the processing module is further configured to:

[0049] The user's walking speed is determined based on the number of steps represented by the step count information and the time represented by the time information;

[0050] If the walking speed is determined to be greater than the preset speed, the user is identified as an abnormal user.

[0051] In one possible implementation, the processing module is further configured to:

[0052] In response to the server recovering from the anomaly, step count and time information are read from the database;

[0053] The user's score information is updated in the cache based on the step count and time information; and the user's ranking information in the organizational hierarchy is updated in the cache based on the updated score information and the user's organizational hierarchy.

[0054] In one possible implementation, the number of bits in the hierarchy identifier varies depending on the organizational level.

[0055] In one possible implementation, the processing module is further configured to:

[0056] Based on the step count information of each user belonging to the same organizational level, a first ranking list and a second ranking list are generated. The first ranking list is a ranking list of the number of users whose step count information under different organizational levels is greater than a preset number. The second ranking list is a ranking list of the average number of steps of users under different organizational levels.

[0057] Thirdly, embodiments of this application provide an electronic device, including: a memory and a processor;

[0058] The memory stores instructions that the computer executes;

[0059] The processor executes computer execution instructions stored in memory, causing the processor to perform the first aspect and / or various possible implementations of the first aspect as described above.

[0060] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the first aspect and / or various possible implementations of the first aspect.

[0061] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the first aspect and / or various possible implementations of the first aspect.

[0062] The step ranking processing method, apparatus, device, medium, and product provided in this application first acquire the user's step count and the time spent reaching that number of steps, as the user's step count information and time information; then, the user's score information is calculated based on the step count information and time information; finally, the user is sorted according to their organizational hierarchy based on their score information to determine their ranking information within that organizational hierarchy, and the ranking information is displayed to the user. By using score information to simultaneously reflect both the user's step count and the time spent reaching that number of steps, two types of information can be represented through a single score, improving the accuracy of step ranking processing. Furthermore, determining the user's ranking information based on their score information within their organizational hierarchy enables step ranking across multiple organizational levels in enterprise application scenarios. This ultimately improves the accuracy of step ranking for users within an enterprise. Attached Figure Description

[0063] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0064] Figure 1 A flowchart illustrating the step ranking method provided in this application. Figure 1 ;

[0065] Figure 2 A flowchart illustrating the step ranking method provided in this application. Figure 2 ;

[0066] Figure 3 A schematic diagram of the structure of the step ranking processing device provided in this application;

[0067] Figure 4 A schematic diagram of the structure of the electronic device provided in this application.

[0068] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0069] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0070] As society develops, there is a growing focus on individual user health. Adequate daily exercise is beneficial to a user's health, and this can be reflected in step count. To incentivize users to exercise more, their step counts can be collected and ranked.

[0071] In some embodiments, step ranking can be achieved through a mini-program within the communication software. For example, the user terminal is equipped with a sensor that records the user's steps while the user is walking, and sums these steps to obtain the user's total steps for the day. Within the mini-program, users can query their total steps for the day and their ranking among all their friends.

[0072] In the above embodiments, the step count ranking is performed through a mini-program in the communication software, which only allows ranking based on the user's step count, resulting in poor accuracy. Furthermore, for users within an enterprise, which may include multiple organizational levels, the above embodiments cannot rank steps based on different organizational levels.

[0073] The step ranking method provided in this application obtains a user's step count information and time information. The step count information represents the number of steps the user has taken, and the time information represents the time it took the user to reach that number of steps. Based on the user's step count and time information, a score is determined. Based on the user's score and organizational level, the ranking of the user's organizational level is determined. This method enables step ranking for users with multiple organizational levels within an enterprise, and it can combine time information and step count information as a single dimension for step ranking, improving the accuracy of step ranking.

[0074] The technical solution of this application and how it solves the above-mentioned technical problems will be described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will be described below with reference to the accompanying drawings.

[0075] Figure 1 A flowchart illustrating the step ranking method provided in this application. Figure 1 ,like Figure 1 As shown, the method includes:

[0076] Step 101. Obtain the user's step count and time information. The time information represents the time taken to reach the number of steps represented by the step count information.

[0077] For example, the step ranking processing method provided in this application can be built on a mini-program of communication software. The methods for obtaining users' step count and time information can include various forms.

[0078] In one example, when a user logs into a mini-program on a device, the mini-program can obtain the number of steps recorded on the user's device, as well as the current time information of the device.

[0079] In another example, when a user logs into the mini-program on the terminal, the mini-program calls the fitness mini-program of the communication software on the terminal through an interface call, and obtains the step count information recorded by the fitness mini-program of the communication software, as well as the current time information of the terminal.

[0080] It should be noted that when a user logs into the mini-program on their device, the mini-program obtains the user's step count for that day. In one possible implementation, the mini-program can also be configured to synchronize step counts from multiple days.

[0081] The user's step count information indicates the number of steps the user has taken at the time of login; the time information indicates the time it took the user to reach that number of steps.

[0082] For example, a walking activity starts at 00:00:00 on August 1, 2024. User 1 logs into the mini-program at 18:00:00:00 on August 1, 2024, at which time the user's step count is 18434. It can be understood that the obtained step count information for User 1 is 18434, and the time information is 18 hours.

[0083] Step 102. Determine the user's score information based on the step count and time information.

[0084] For example, after obtaining a user's step count and time information, the user's score can be calculated. The user's score can be used to determine the user's ranking within a specific organizational level.

[0085] In a practical example, the step count indicates the number of steps a user has taken, while the time information indicates the time it took the user to reach that number of steps. Based on the step count and the time taken, a score is calculated for the user's login session. For instance, when calculating the score, the step count can be given higher priority, and the time taken can be given lower priority. Furthermore, the longer the time spent, the lower the score should be.

[0086] Based on the examples above, we can obtain score information: the higher a user's number of steps, the higher the score; when multiple users have the same number of steps, the shorter the time taken, the higher the score.

[0087] Step 103. Based on the user's score information and organizational level, determine and display the user's ranking information within the organizational level.

[0088] For example, after obtaining a user's score information, the user's ranking within their organizational hierarchy is determined based on that hierarchy. Specifically, the scores of all users within the user's organizational hierarchy are sorted from highest to lowest. This allows the determination of the current user's ranking within their organizational hierarchy, which is then displayed to the user on the terminal's screen.

[0089] To illustrate with a practical example, consider a company where the primary organization is the company as a whole, and multiple departments serve as secondary organizations. For instance, Department A has User 1, User 2, and User 3, while Department B has User 4 and User 5; each user has corresponding score information. It can be understood that in Department A's ranking list, the ranking information for User 1, User 2, and User 3 is determined based on their respective score information.

[0090] Similarly, in Department B's ranking list, the rankings of User 4 and User 5 are determined based on their scores. In both Department A and Department B's ranking lists, the user with the higher score ranks higher.

[0091] Optionally, step count ranking can also be performed across the entire enterprise. Based on the scores of User 1, User 2, User 3, User 4, and User 5, their rankings are determined. In the overall enterprise ranking, the user with the higher score ranks higher.

[0092] The step ranking processing method provided in this application obtains a user's step count and time information, determines the user's score based on these two dimensions, and then determines the user's ranking within that organizational level based on the score and the user's organizational hierarchy, displaying the ranking information. This method improves the accuracy of step ranking processing within an enterprise by determining a score based on both the user's step count and the time taken to reach that number of steps, and then using that score to determine the user's ranking within their organizational hierarchy.

[0093] When calculating a user's score, it is necessary to merge information from two dimensions into a single score. Based on the previous embodiments, this embodiment specifically describes how to calculate the user's score by combining the user's step count and time information.

[0094] As an example, the number of steps represented by the step count information is written into the first n positions of the preset empty space data, and the time represented by the time information is written into the last mn positions of the preset empty space data to obtain the score information.

[0095] Where m is the total number of digits in the preset empty space data, and m is a positive integer greater than 1; n is a positive integer less than m and greater than or equal to 1.

[0096] For example, score information can be presented in multiple ways by writing different information in different positions within a preset empty data set. For instance, if there are m empty data positions, the first n positions can be filled with step count information, representing the user's number of steps taken, while the last mn positions can be filled with time information, representing the time taken by the user to reach that number of steps. This allows the score information to simultaneously reflect both the number of steps taken and the time taken to reach that number of steps.

[0097] Furthermore, the step ranking can be achieved using the sorted set (ZSet) data structure in the Remote Dictionary Server (Redis). The maximum score for a Redis ZSet is 18,014,398,509,481,982, a 17-digit number. The default number of empty spaces in the score information cannot exceed the maximum score of the ZSet; therefore, the default number of digits (m) in the empty spaces should be less than or equal to 16.

[0098] Figure 2 A flowchart illustrating the step ranking method provided in this application. Figure 2 ,like Figure 2 As shown, the user's score information can be calculated through the following steps:

[0099] Step 201. Multiply the number of steps represented by the step count information by a first preset value to obtain a first initial score; wherein the number of digits in the first initial score is the sum of the number of digits in the first preset value and the number of digits in the step count minus 1.

[0100] Step 202. Determine the difference between the start time and the end time of the time information as the time difference; and subtract the time difference from the second preset value to obtain the second initial score; wherein the number of digits in the second initial score is the same as the number of digits in the second preset value; the first preset value is greater than the second preset value.

[0101] Furthermore, the difference between the first preset value and the second preset value is 1.

[0102] For example, the first preset value can be set to 10 to the power of 8, and the second preset value can be set to 99,999,999. In a practical application example, if user 1's step count is 18434, then multiplying the step count 18434 by the first preset value yields the first initial score of 1,843,400,000,000. The first preset value has 9 digits, the step count has 5 digits, and the first initial score has 9 + 5 - 1 = 13 digits, corresponding to the calculated first initial score.

[0103] Since the time information represents the time it takes for a user to reach the number of steps indicated by that step count information, the time information is a time period, determined by the start and end times. For example, the start time of User 1's walking activity is 00:00:00 on August 1, 2024, and the end time is 10:43:47 on August 19, 2024. The time difference calculated from the start and end times is 18 days, 10 hours, 43 minutes, and 47 seconds. Optionally, converting the time difference to seconds yields a time difference of 1,593,827 seconds. It can be understood that User 1 took 1,593,827 seconds to walk 18,434 steps in this walking activity. Subtracting the time difference converted to seconds from the second preset value yields the second initial score: 99,999,999 - 1,593,827 = 98,406,172. The second preset value has 8 digits, as does the second initial score, which corresponds to the number of digits in the calculated second initial score.

[0104] Step 203. Add the first initial score to the second initial score to obtain the score information.

[0105] After obtaining the first initial score and the second initial score, the first initial score and the second initial score are summed to obtain the score information.

[0106] Following the previous example, summing User 1's first and second initial scores yields User 1's score: 1,843,400,000,000 + 98,406,172 = 1,843,498,406,172. After calculating User 1's score, the scores of other users in User 1's organizational hierarchy are calculated using the method provided in the previous example. Sorting the scores of all users in User 1's organizational hierarchy yields User 1's ranking within that hierarchy.

[0107] For example, within the organizational hierarchy of User 1, there are also User 2 and User 3. User 2 logged into the mini-program to count steps at 6:32:12 AM on August 19, 2024, and User 2's step count was 18434; User 3 logged into the mini-program to count steps at 6:32:12 AM on August 19, 2024, and User 3's step count was 4322. According to steps 201 to 203, the score information for User 2 can be calculated as 1,843,498,421,267, and the score information for User 3 can be calculated as 432,298,421,267.

[0108] By sorting users 1, 2, and 3 according to their scores, their ranking within their respective organizational levels can be obtained. For example, user 2 might be ranked first, user 1 second, and user 3 third.

[0109] In the above embodiments, multiplying the user's step count by a first preset value to obtain a first initial score allows the step count information, represented by the step count, to be written into the first n positions of the preset empty data. Subtracting the time difference from the second preset value yields a second initial score. Adding the first and second initial scores allows the time information, represented by the time, to be written into the last mn positions of the preset empty data, thus obtaining the score information. The score information can represent multiple pieces of information, including the user's number of steps taken and the time taken to reach that number of steps. Based on the score information, which can represent multiple pieces of information, the user's ranking information can be accurately determined, thereby improving the accuracy of the user's step count ranking.

[0110] The calculated user scores can be used to determine the user's ranking within the current organizational hierarchy. This score and ranking information needs to be stored. This embodiment, based on the previous embodiments, specifically describes how to store the score and ranking information.

[0111] As an example, the user's score information is determined in the cache based on the number of steps and time information; and the user's ranking information in the organizational hierarchy is determined in the cache based on the user's score information and the user's organizational hierarchy.

[0112] Step count and time information can be stored using a Redis cache. For example, when user 1 logs into the mini-program, user 1's step count and time information are updated. The updated score information for user 1 is then determined from the Redis cache based on this updated information.

[0113] Optionally, the cache in the Redis service can also store basic user information and the user's organizational hierarchy. The user's organizational hierarchy can be uniquely identified by a hierarchy identifier.

[0114] For a company, there can be multiple organizational levels. The first-level organization can be the entire company, and multiple second-level organizations can be set up under the first-level organization. Multiple second-level organizations can correspond to multiple departments. Optionally, multiple third-level organizations can be set up under the second-level organizations, and multiple fourth-level organizations can be set up under the third-level organizations.

[0115] It should be noted that the number of digits in the level identifier varies depending on the organizational level.

[0116] For example, a first-level organization can be assigned a hierarchy identifier of 001, and the first second-level organization under a first-level organization can be assigned a hierarchy identifier of 001001. It should be noted that a first-level organization can have multiple second-level organizations, and the second second-level organization under a first-level organization can be assigned a hierarchy identifier of 001002.

[0117] Hierarchical identifiers are used to determine which organizational level a user belongs to. Referring to the previous example, the company as a whole includes departments A and B. Users 1, 2, and 3 all belong to department A; therefore, the hierarchical identifier for users 1, 2, and 3 is 001001. User 4 belongs to department B; therefore, the hierarchical identifier for user 4 is 001002.

[0118] After determining the updated score information for User 1 in the cache, User 1's ranking information in Department A is then determined based on User 1's hierarchical identifier. For example, the ranking information can also be presented in the form of a ranking list. The data structure of the ranking list includes a ranking list identifier, user information, and user score information. An exemplary ranking list for Department A is shown in Table 1.

[0119] Table 1. Exemplary Ranking of Department A

[0120] key value score UserTodayRanking_001001 2_User2 1,843,498,421,267 UserTodayRanking_001001 1_User1 1,843,498,406,172 UserTodayRanking_001001 3_User3 432,298,421,267

[0121] In Table 1, the key represents the ranking list identifier, the value represents user information, and the score represents the user's score information. The key is used to determine the type of the current ranking list, and the value is used to uniquely identify a user. For example, the key in Table 1 is UserTodayRanking_001001, which can be understood as the ranking list of individual steps taken by users in Department A today. The value in Table 1 is an example representation of user information; the value can also be set to other forms such as "unique identifier in the database_name". In the ranking list of individual steps taken by users in Department A today, the higher the user's score, the higher their ranking.

[0122] The ranking list can be used for both second-level and first-level organizations. Combining the score information of users 1, 2, and 3 in department A from the previous example, we then introduce the score information of user 4 in department B. For instance, user 4 logged into the mini-program and started counting steps at 6:32:12 AM on August 19, 2024, and their step count was 6522. The cached score for user 4 is calculated to be 652,298,421,267.

[0123] An exemplary overall enterprise ranking list can be shown in Table 2.

[0124] Table 2 Exemplary Overall Enterprise Ranking List

[0125] key value score UserTodayRanking_001 2_User2 1,843,498,421,267 UserTodayRanking_001 1_User1 1,843,498,406,172 UserTodayRanking_001 4_User4 652,298,421,267 UserTodayRanking_001 3_User3 432,298,421,267

[0126] In Table 2, the key is UserTodayRanking_001, which can be understood as the overall ranking of individual steps taken by individuals in the company today.

[0127] It should be noted that the ranking information in the cache for determining a user's organizational level can include the ranking information for the user's first-level organization and the ranking information for the user's second-level organization. If the user's organizational level includes a third-level organization, then the ranking information for determining the user's organizational level will also include the ranking information for the user's third-level organization. If the user's organizational level includes a fourth-level organization, then the ranking information for determining the user's organizational level will also include the ranking information for the user's fourth-level organization.

[0128] The order in which the ranking information of each level of organization is determined is not limited, and the ranking information of each level of organization can also be determined at the same time.

[0129] After determining the user's ranking information within their organizational hierarchy from the cache, this ranking information is stored in the Redis service cache. Once the score information in the cache is saved, the step count and time information are written to the database.

[0130] For example, information can be stored in a database using detail tables. An example database detail table is shown in Table 3.

[0131] Table 3 is an example database detail table.

[0132]

[0133] In Table 3, id represents the identifier of this data, step_number represents the user's step count, step_date represents the date the user logged into the mini program to synchronize data, update_time represents the time the user logged into the mini program to synchronize data, and user_id represents the user information.

[0134] In the above embodiment, after a user logs into the mini-program, their step count and time information are updated synchronously once. Based on the updated step count and time information, the updated score information is determined in the Redis service cache. The user's organizational level ranking information is then updated based on the updated score information and stored in the Redis service cache. Finally, the updated step count and time information are stored in the database. This allows the user's ranking information to be stored in the cache, enabling users to directly retrieve the cached ranking information when querying the leaderboard, reducing the number of database reads, reducing performance overhead, and thus improving response speed.

[0135] As can be seen from the foregoing embodiments, the ranking information of the user's organizational level is stored in the cache of the Redis service. When the user queries the ranking list, the ranking information in the cache can be directly obtained and displayed to the user.

[0136] For example, in a practical application, Department A may have users 1, 2, and 3 who are directly subordinate to it, as well as users 4 and 5 who belong to Department A's sub-department A, and user 6 who belongs to Department B's sub-department B.

[0137] In one example, in response to a user's first trigger action, the user's ranking information among the users directly corresponding to the organizational hierarchy is displayed on the interface.

[0138] User 1 logs into the mini-program via a terminal device and queries the step count ranking information of department A. The mini-program reads the ranking information of users 1, 2, and 3 who directly belong to department A from the cache stored in the Redis service, and displays the ranking information of users 1, 2, and 3 to the user on the mini-program interface.

[0139] In another example, in response to a second user-triggered action, the user's ranking information among all users in the organizational hierarchy and other organizational levels below it is displayed on the interface.

[0140] User 1 logs into the mini-program via a terminal device and queries the step ranking information for Department A and all other organizational levels under Department A. The mini-program reads the ranking information of Users 1, 2, and 3 who directly belong to Department A, as well as the ranking information of Users 4 and 5 who belong to Department A (Section A) and Users 6 who belong to Department B (Section B) under Department A, stored in the Redis service cache. The mini-program then displays the ranking information of Users 1, 2, 3, 4, 5, and 6 to the user.

[0141] In the above embodiments, ranking information of the user's organizational level can be displayed in different ways depending on the user's different query operations. The diverse display methods of ranking information allow users to query ranking information in multiple ways.

[0142] The reading and storage of various information cached in the Redis service depends on the normal operation of the server. However, in some cases, the server may malfunction, leading to the abnormal loss of data in the cache. Based on any of the aforementioned embodiments, this embodiment specifically describes how to perform step ranking processing when ranking information in the cache is lost.

[0143] When the server malfunctions, it may trigger a restart. Upon restart, the user's step count, time, score, and ranking information stored in the cache will be lost. As described in the preceding embodiments, the user's step count and time information are also stored in the database. Therefore, the user's step count and time information can be read from the database, the score information can be recalculated from the cache, and the user's ranking within their organizational hierarchy can be determined based on the recalculated score.

[0144] As an example, the user's score and ranking information in the cache can be recalculated using the following steps:

[0145] Step 301. In response to the server recovering from the anomaly, the step count and time information are read from the database.

[0146] When the server restarts and returns to normal operation from an abnormal state, it reads the user's step count and time information from the database. For example, if the ranking information for the organizational level the user is looking for is not currently in the cache, it retrieves the step count and time information for all users belonging to that organizational level from the database. When retrieving the step count and time information for all users belonging to that organizational level, it can be done in batches according to a preset number. The preset number can be set to 500.

[0147] Step 302. Update the user's score information in the cache based on the step count and time information; and update the user's ranking information in the organizational hierarchy in the cache based on the updated score information and the user's organizational hierarchy.

[0148] For example, if a company has 3000 users, and User 1 queries the company's overall daily step count ranking, the system needs to retrieve the step count and time information of all users whose tier identifiers begin with 001 from the database. The system calculates scores for 500 users in batches of 500, performing this calculation six times to obtain the scores for all users across the company. Based on these calculated scores, the system then caches the data and determines the overall ranking of all users, resulting in the company's overall daily step count ranking, which is then displayed to User 1.

[0149] The above embodiments provide remedial measures for situations where ranking information in the cache is lost due to server failure. On one hand, in addition to storing score and ranking information in the cache, user step count and time information are also stored in the database. This ensures that when data in the cache is lost, the user's step count and time information can be retrieved from the database to re-determine the user's score and organizational ranking, improving the reliability of the ranking information. On the other hand, when retrieving user step count and time information from the database, considering the computing power of the server and database, score information and ranking information are calculated in batches according to a preset quantity, avoiding excessive computational load on the server and database.

[0150] Due to the large number of users within an enterprise, abnormal situations may occur. For example, these abnormal situations might include abnormal user step counts or abnormal user organizational hierarchies. Building upon the aforementioned embodiments, this embodiment specifically addresses how to handle these abnormal situations.

[0151] In one example, anomalies in a user's step count can be handled through the following steps:

[0152] Step 401. Determine the user's walking speed based on the number of steps represented by the step count information and the time represented by the time information.

[0153] For example, a user's step count information reflects the number of steps they have taken, while the user's time information reflects the time it took them to reach that number of steps. Dividing the number of steps by the time taken to reach that number of steps gives the user's walking speed.

[0154] Optionally, the user's time information can be in minutes, and the user's walking speed reflects the number of steps the user takes per minute.

[0155] Step 402. If the walking speed is determined to be greater than the preset speed, then the user is determined to be an abnormal user.

[0156] The calculated walking speed of the user is compared with a preset speed. If the walking speed is greater than the preset speed, the user is identified as an abnormal user. The specific value of the preset speed is not limited. For example, the preset speed can be calculated based on a world record of 355 steps per minute; or it can be set to 120 steps per minute based on a normal brisk walking pace.

[0157] Optionally, users exhibiting abnormal behavior can be flagged as having anomalies. For users flagged as having anomalies, their score and ranking information can be cleared. If the number of flags indicating abnormal behavior reaches a threshold, the event administrator can be notified to take appropriate action against the user. Such actions include, but are not limited to, disqualifying the user from the event and canceling event rewards.

[0158] In the example above, the user's walking speed is determined based on the user's step count and time information. The relationship between the walking speed and the preset speed is used to determine whether the user is an abnormal user. This can ensure the authenticity and reliability of the user's step count information, thereby improving the authenticity and fairness of the step count ranking list.

[0159] In another example, organizational hierarchy anomalies for users can be handled through the following steps:

[0160] Step 501. The administrator can determine the current organizational level of a user based on the user's hierarchical identifier.

[0161] A user's hierarchy identifier indicates the organizational level to which that user currently belongs. For example, if user 1's hierarchy identifier is 001002, it means that the user currently belongs to department B within the entire enterprise.

[0162] Step 502. If the administrator determines that the user does not belong to the organizational level represented by its hierarchical identifier, modify the user's hierarchical identifier.

[0163] Based on the user hierarchy identifier example above, if the administrator finds that the user does not actually belong to department B under the enterprise as a whole, the user's hierarchy identifier is changed to 001999, and the organizational level corresponding to this hierarchy identifier is other organizations under the enterprise as a whole.

[0164] Optionally, since the number of people in the original organizational level of a user changes after the user's level identifier is modified, it is necessary to correct the ranking information of each user in the original organizational level.

[0165] In the example above, for users who were not originally part of this organizational hierarchy, their hierarchy identifier is modified to ensure that the user actually belongs to the organizational hierarchy represented by their hierarchy identifier. This guarantees the accuracy of the ranking information of the organizational hierarchy represented by the hierarchy identifier.

[0166] To incentivize user participation, in addition to individual step count rankings, team rankings can also be set up. Team rankings can include, but are not limited to: team average days meeting the target, team average steps, team participation rate, and overall team ranking.

[0167] For example, a first ranking list and a second ranking list are generated based on the step count information of each user belonging to the same organizational level.

[0168] The first ranking list is a ranking list of the number of users whose step count, represented by step count information, is greater than the preset step count under different organizational levels; the second ranking list is a ranking list of the average step count of users under different organizational levels.

[0169] The primary ranking list represents the team participation rate ranking. At different organizational levels, the number of users whose steps exceed a preset number represents the user participation rate at each organizational level. For example, in the team participation rate ranking list for a second-level organization, one can view the ranking of team participation rates for departments A, B, and C within the overall enterprise. Specifically, it involves determining whether the number of steps taken by users in each department exceeds the preset number, counting users with more than the preset number of steps, and ranking them based on this number to obtain the primary ranking list.

[0170] The second ranking list represents the average steps taken per team. It calculates the average steps taken by all users within the same organizational level, across different organizational hierarchies. For example, in the second-level organizational team average steps ranking list, you can view the ranking of the average steps taken by teams in departments A, B, and C within the overall enterprise. Specifically, the average steps taken by all users in each department are calculated, and the rankings are based on the average steps taken by each department to obtain the second ranking list.

[0171] It should be noted that the team ranking list is updated by retrieving data from the database at preset time intervals. Furthermore, after retrieving data from the database, the team ranking list indicators are calculated directly within the database, and the ranking information of each organization in the team ranking list is determined based on these indicators. This ranking information of each organization is then stored in the database. The specific value of the preset time interval is not limited; for example, it can be set to 2 hours or 24 hours.

[0172] In the example above, various team ranking lists can be constructed based on the user's step count and organizational level. This allows for a higher ranking of users according to their organizational level within the team ranking lists, encouraging more active user participation and increasing user engagement.

[0173] Optionally, to further incentivize user participation, users can also like or comment on their step count rankings.

[0174] For example, add a "like" information field to each user's data entry in the database. This field records the unique identifier of the user who has liked the post. This unique identifier can be the value in the user's data. For a single user, there may be multiple users who have liked the post; therefore, the unique identifiers of these users are separated by a separator in the "like" information field. This example does not limit the specific form of the separator; for example, it can be a comma "," or an underscore "_".

[0175] For a practical example, consider User 1. Two users have liked User 1's post. The values ​​for these two users are 473622233453932543 and 765422233453937648, respectively. Therefore, User 1's like information field should be "473622233453932543,765422233453937648,". This means that when a user likes a post, a unique identifier and a separator are appended to the like information field of the user who liked it. When a user queries the ranking list, the number of separators in the like information field indicates how many users have liked the post.

[0176] Optionally, when a user cancels a like, the user's unique identifier and separator in the like information field of the user who was liked will be replaced with an empty string.

[0177] It's important to note that the "like" information field can be stored in a Redis cache, synchronized with the user's score and ranking information. After being cached, the "like" information field can be stored in the database along with the user's step count and time information. Furthermore, when user 1 queries the ranking list, for other users on the list, they only need to check if the "like" information field of those users contains a unique identifier corresponding to user 1 to determine if user 1 has liked their post.

[0178] In the above embodiments, a "like" information field is added to the user's data, allowing users to "like" other users' posts and recording which users have performed the "like" action. This increases the fun of the activity, thereby further improving user participation and activity.

[0179] The step ranking method provided in this application first obtains the user's step count and the time spent reaching that number of steps, serving as the user's step count information and time information. Based on the step count information and time information, the user's score information is calculated. Then, the user is sorted according to their organizational hierarchy based on their score information to determine their ranking information within that organizational hierarchy, and this ranking information is displayed to the user. By using the score information to simultaneously reflect both the user's step count and the time spent reaching that number of steps, two pieces of information can be represented in a single score, improving the accuracy of step ranking processing. Furthermore, determining the user's ranking information based on their organizational hierarchy based on their score information allows for step ranking across multiple organizational levels in enterprise application scenarios. This ultimately improves the accuracy of step ranking for users within an enterprise.

[0180] Figure 3 A schematic diagram of the structure of the step ranking processing device provided in this application is shown below. Figure 3 As shown, the step ranking processing device 60 provided in this embodiment includes:

[0181] The acquisition module 601 is used to acquire the user's step count information and time information; wherein, the time information represents the time taken to reach the number of steps represented by the step count information;

[0182] The processing module 602 is used to determine the user's score information based on the step count information and time information;

[0183] The processing module 602 is also used to determine and display the user's ranking information in the organizational hierarchy based on the user's score information and the user's organizational level.

[0184] In one possible implementation, the user's score information is determined based on the step count information and time information, and the processing module 602 is used for:

[0185] The number of steps represented by the step count information is written into the first n positions of the preset empty space data, and the time represented by the time information is written into the last mn positions of the preset empty space data to obtain the score information; where m is the total number of digits in the preset empty space data, m is a positive integer greater than 1; n is a positive integer less than m and greater than or equal to 1.

[0186] In one possible implementation, the step count information is written into the first n positions of a preset empty space data, and the time information is written into the last mn positions of the preset empty space data to obtain the score information. The processing module 602 is used for:

[0187] Multiply the number of steps represented by the step count information by a first preset value to obtain a first initial score; wherein the number of digits in the first initial score is the sum of the number of digits in the first preset value and the number of digits in the step count minus 1;

[0188] The time difference is defined as the difference between the start time and the end time of the time information; the second initial score is obtained by subtracting the time difference from the second preset value; the number of digits in the second initial score is the same as the number of digits in the second preset value; the first preset value is greater than the second preset value.

[0189] Add the first initial score to the second initial score to obtain the score information.

[0190] In one possible implementation, the difference between the first preset value and the second preset value is 1.

[0191] In one possible implementation, the user's score information is determined based on the step count information and time information; the user's ranking information within the organizational hierarchy is determined based on the user's score information and the user's organizational level. The processing module 602 is used for:

[0192] The user's score information is determined in the cache based on the number of steps and time information; and the user's ranking information in the organizational hierarchy is determined in the cache based on the user's score information and the user's organizational hierarchy.

[0193] Step count and time information are written into the database.

[0194] In one possible implementation, the processing module 602 displays the user's ranking information within the organizational hierarchy, and is used to:

[0195] In response to the user's first trigger action, the user's ranking information among all users directly corresponding to the organizational hierarchy is displayed on the interface;

[0196] Alternatively, in response to a second user-triggered action, the interface can display the user's ranking information among all users in both the organizational hierarchy and other organizational levels below it.

[0197] In one possible implementation, the processing module 602 is further configured to:

[0198] The user's walking speed is determined based on the number of steps represented by the step count information and the time represented by the time information;

[0199] If the walking speed is determined to be greater than the preset speed, the user is identified as an abnormal user.

[0200] In one possible implementation, the processing module 602 is further configured to:

[0201] In response to the server recovering from the anomaly, step count and time information are read from the database;

[0202] The user's score information is updated in the cache based on the step count and time information; and the user's ranking information in the organizational hierarchy is updated in the cache based on the updated score information and the user's organizational hierarchy.

[0203] In one possible implementation, the number of bits in the hierarchy identifier varies depending on the organizational level.

[0204] In one possible implementation, the processing module 602 is further configured to:

[0205] Based on the step count information of each user belonging to the same organizational level, a first ranking list and a second ranking list are generated. The first ranking list is a ranking list of the number of users whose step count information under different organizational levels is greater than a preset number. The second ranking list is a ranking list of the average number of steps of users under different organizational levels.

[0206] The step ranking processing device provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and will not be described in detail here.

[0207] Figure 4 A schematic diagram of the structure of the electronic device provided in this application. Figure 4 As shown, the electronic device 70 provided in this embodiment includes at least one processor 701 and a memory 702. Optionally, the device 70 further includes a communication component 703. The processor 701, memory 702, and communication component 703 are connected via a bus 704.

[0208] In a specific implementation, at least one processor 701 executes computer execution instructions stored in memory 702, causing at least one processor 701 to perform the above-described method.

[0209] The specific implementation process of processor 701 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.

[0210] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the application can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules within the processor.

[0211] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.

[0212] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.

[0213] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.

[0214] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above-described method.

[0215] The aforementioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.

[0216] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.

[0217] The division of modules is merely a logical functional division; in actual implementation, there may be other division methods. For example, multiple modules may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connections shown or discussed may be through interfaces, and can be electrical, mechanical, or other forms.

[0218] The modules described as separate components may or may not be physically separate. Similarly, the components shown as modules may or may not be physical modules; they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment, depending on actual needs.

[0219] In addition, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module.

[0220] If a function is implemented as a software module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0221] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0222] Finally, it should be noted that other embodiments of this application will readily conceive of by those skilled in the art upon consideration of the specification and practice of the application disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and alterations may be made without departing from its scope. The scope of this application is limited only by the appended claims.

Claims

1. A method for ranking steps, characterized in that, include: Obtain the user's step count and time information; wherein, the time information represents the time taken to reach the number of steps represented by the step count information; The user's score information is determined based on the step count information and the time information; Based on the user's score information and the user's organizational level, determine and display the user's ranking information within the organizational level.

2. The method according to claim 1, characterized in that, Determining the user's score information based on the step count information and the time information includes: The number of steps represented by the step count information is written into the first n positions of the preset empty space data, and the time represented by the time information is written into the last mn positions of the preset empty space data to obtain the score information; where m is the total number of digits in the preset empty space data, m is a positive integer greater than 1; n is a positive integer less than m and greater than or equal to 1.

3. The method according to claim 2, characterized in that, The number of steps represented by the step count information is written into the first n positions of the preset empty space data, and the time represented by the time information is written into the last mn positions of the preset empty space data to obtain the score information, including: Multiply the number of steps represented by the step count information by a first preset value to obtain a first initial score; wherein the number of digits in the first initial score is the sum of the number of digits in the first preset value and the number of digits in the step count minus 1; The difference between the start time and the end time of the time information is determined as the time difference; and the time difference is subtracted from the second preset value to obtain the second initial score; wherein the number of digits in the second initial score is the same as the number of digits in the second preset value; and the first preset value is greater than the second preset value. The first initial score is added to the second initial score to obtain the score information.

4. The method according to claim 3, characterized in that, The difference between the first preset value and the second preset value is 1.

5. The method according to claim 1, characterized in that, Based on the step count information and the time information, determine the user's score information; based on the user's score information and the user's organizational level, determine the user's ranking information within the organizational level, including: The user's score information is determined in the cache based on the step count information and the time information; and the user's ranking information in the organizational level is determined in the cache based on the user's score information and the user's organizational level. Write the step count information and the time information into the database.

6. The method according to claim 1, characterized in that, Displaying the user's ranking information within the organizational hierarchy, including: In response to the user's first trigger operation, the user's ranking information among all users directly corresponding to the organizational level is displayed on the interface; Alternatively, in response to a second triggering action by the user, the user's ranking information among users in the organizational hierarchy and other organizational hierarchies below the organizational hierarchy can be displayed on the interface.

7. The method according to claim 1, characterized in that, The method further includes: The user's walking speed is determined based on the number of steps represented by the step count information and the time represented by the time information; If the walking speed is determined to be greater than the preset speed, then the user is determined to be an abnormal user.

8. The method according to any one of claims 1-7, characterized in that, The method further includes: In response to the server recovering from the anomaly, the step count information and the time information are read from the database; The user's score information is updated in the cache based on the step count information and the time information; and the user's ranking information in the organizational level is updated in the cache based on the updated score information and the user's organizational level.

9. The method according to any one of claims 1-7, characterized in that, The number of digits in the level identifier varies depending on the organizational level.

10. The method according to any one of claims 1-7, characterized in that, The method further includes: Based on the step count information of each user belonging to the same organizational level, a first ranking list and a second ranking list are generated; wherein, the first ranking list is a ranking list of the number of users whose step count information under different organizational levels is greater than a preset number; the second ranking list is a ranking list of the average step count of users under different organizational levels.

11. A step-count ranking processing device, characterized in that, include: The acquisition module is used to acquire the user's step count information and time information; wherein, the time information represents the time taken to reach the number of steps represented by the step count information; The processing module is used to determine the user's score information based on the step count information and the time information; The processing module is further configured to determine and display the user's ranking information in the organizational hierarchy based on the user's score information and the user's organizational hierarchy.

12. An electronic device, characterized in that, include: Memory, processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the method as described in any one of claims 1-10.

13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-10.

14. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method described in any one of claims 1-10.