User's offline method and device, processor and electronic device

By periodically reading and updating the traffic mapping table in the target main control board card in a distributed network device, the user is offline based on the number of traffic times, which solves the problem of low flexibility caused by forced timeout time, and achieves more accurate and efficient user offline operations.

CN115834562BActive Publication Date: 2025-07-18HILLSTONE NETWORKS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211456957.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-21
Publication Date
2025-07-18
Estimated Expiration
2042-11-21

AI Technical Summary

Technical Problem

On distributed network devices, controlling the user's down-line operation by setting a forced timeout time will lead to low flexibility, and it is impossible to accurately handle user's timeout without traffic, which will affect the user's normal use or cause frequent disconnection.

Method used

The target main control board card reads the traffic mapping table of each service board according to the preset period, updates the user's traffic status value, determines the users to be offline based on the number of traffic, and performs offline operations, and uses periodic traffic statistics to reduce communication conflicts and improves flexibility.

Benefits of technology

It realizes more flexible user offline control, reduces communication messages between boards and cards, improves the accuracy and flexibility of user offline operations, and avoids complex timer monitoring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115834562B_ABST
    Figure CN115834562B_ABST
Patent Text Reader

Abstract

The present application discloses a method and device for logging off a user, a processor, and an electronic device, which relate to the field of Internet technologies. The method includes: a target main control board reads a first traffic mapping table of each service board according to a preset period to obtain a traffic status value of each user; the target main control board updates a second traffic mapping table according to the traffic status value of each user to obtain an updated second traffic mapping table, where the second traffic mapping table consists of a user ID, a traffic status value corresponding to the user ID, and a zero-traffic count corresponding to the user ID; the target main control board determines a first target user to be logged off according to the zero-traffic count in the updated second traffic mapping table, and performs a log-off operation on the first target user. Through the present application, the problem in the related art that the flexibility of the user log-off operation is low due to setting a forced timeout time to control the user log-off operation on distributed devices is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of Internet technologies, and in particular, to a method and apparatus for logging off a user, a processor, and an electronic device. Background Art

[0002] User traffic timeout is a flexible timeout method. After a user is authenticated, an authenticated user instance is generated on a network device, and the network device performs related services based on the user. When a user has no access traffic for a long time, the user is kicked out. User traffic automatic timeout, also known as idle timeout, can flexibly avoid wasting resources by users who are not online for a long time and improve security at the same time.

[0003] A distributed network device is a multi-module device designed to overcome hardware bottlenecks. The CPU and bandwidth of traditional network devices have certain bottlenecks and often cannot meet the actual needs of large-traffic services. The distributed network device combines hardware modules, resulting in a multiple-fold improvement in performance.

[0004] Some common distributed network devices usually include multiple service boards for processing network traffic. By evenly distributing the network traffic load to multiple service boards, the traffic processing capacity is improved. In the face of large-traffic service scenarios, multi-board distributed network devices have strong performance advantages.

[0005] Since multiple service boards of a distributed network device process traffic services respectively, it is difficult to handle user traffic timeout. The absence of the user's traffic on a certain board does not mean that there is no such user traffic on other boards. When the number of users is huge, it is difficult to kick out a single user's traffic due to timeout. In the prior art, a forced timeout is set on the distributed device instead of traffic timeout, and the user is forced to log off after a fixed online time. The forced timeout is not flexible enough. Although it can avoid the long-term residue of users, it affects the normal use of users at the same time. If the forced timeout is set too long, it cannot achieve the effect of precise control of traffic timeout, and if it is set too short, users will be disconnected frequently.

[0006] Regarding the problem that in the prior art, the forced timeout is set on the distributed device to control the user's logoff operation, resulting in low flexibility of the user's logoff operation, no effective solution has been proposed yet. Summary of the Invention

[0007] The main objective of the present application is to provide a method and apparatus for logging off a user, a processor, and an electronic device, so as to solve the problem that in the prior art, the forced timeout is set on the distributed device to control the user's logoff operation, resulting in low flexibility of the user's logoff operation.

[0008] To achieve the above object, according to one aspect of the present application, a method for logging off a user is provided. The logging-off method is applied to a distributed device, and the distributed device at least includes a target main control board and a plurality of service boards, and includes: the target main control board reads the first traffic mapping table of each service board according to a preset period to obtain the traffic status value of each user, wherein the first traffic mapping table is composed of a user ID and the traffic status value corresponding to the user ID, and the traffic status value includes a first status value and a second status value, the first status value indicates that the user has no traffic in the current statistical period, and the second status value indicates that the user has traffic in the current statistical period; the target main control board updates the second traffic mapping table according to the traffic status value of each user to obtain an updated second traffic mapping table, wherein the second traffic mapping table is composed of a user ID, the traffic status value corresponding to the user ID, and the number of times of no traffic corresponding to the user ID; the target main control board determines a first target user to be logged off according to the number of times of no traffic in the updated second traffic mapping table, and performs a logging-off operation on the first target user.

[0009] Further, before the target main control board reads the first traffic mapping table of each service board according to a preset period to obtain the traffic status value of each user, the method further includes: the target main control board authenticates the identity of each user, and after the identity authentication is passed, distributes a user ID to each user; the target main control board distributes the user ID of each user to a plurality of service boards to process the target services of each user through the service boards.

[0010] Further, after distributing the user ID of each user to a plurality of service boards to process the target services of each user through the service boards, the method further includes: each service board statistically calculates the traffic status of each user according to the preset period; if there is a second target user with a traffic status of no traffic in the current statistical period, the traffic status value of the second target user in the first traffic mapping table is set to the first status value; if there is a third target user with a traffic status of having traffic in the current statistical period, the traffic status value of the third target user in the first traffic mapping table is set to the second status value.

[0011] Further, the target main control board updates the second traffic mapping table according to the traffic status value of each user, and the updated second traffic mapping table obtained includes: if there is a fourth target user whose traffic status values in the first traffic mapping tables corresponding to each service board are all the first status value, the traffic status value of the fourth target user in the second traffic mapping table is set to the first status value, and the no-traffic times of the fourth target user in the second traffic mapping table are accumulated; if there is a fifth target user whose traffic status value in the first traffic mapping table corresponding to any service board is the second status value, the traffic status value of the fifth target user in the second traffic mapping table is set to the second status value, and the no-traffic times of the fifth target user in the second traffic mapping table are initialized.

[0012] Further, determining the first target user to be taken offline according to the no-traffic times in the updated second traffic mapping table includes: reading the no-traffic times of each user from the updated second traffic mapping table; determining whether the no-traffic times are greater than or equal to a preset threshold; if there is a target no-traffic time greater than the preset threshold, determining the user corresponding to the target no-traffic time as the first target user.

[0013] Further, performing an offline operation on the first target user includes: the target main control board performs an offline operation on the first target user and issues a target instruction to the multiple service boards, where the multiple service boards delete the data information of the first target user according to the target instruction.

[0014] Further, after the target main control board updates the second traffic mapping table according to the traffic status value of each user to obtain the updated second traffic mapping table, the method further includes: the target main control board synchronizes the no-traffic times in the updated second traffic mapping table to the standby main control board; when the target main control board fails, the standby main control board works instead of the target main control board.

[0015] Further, after the target main control board updates the second traffic mapping table according to the traffic status value of each user to obtain the updated second traffic mapping table, the method further includes: the target main control board synchronizes the no-traffic times in the updated second traffic mapping table to the main control board in the standby distributed device; when the distributed device where the target main control board is located fails, the standby distributed device works instead of the distributed device where the target main control board is located.

[0016] To achieve the above object, according to another aspect of the present application, a user offline device is provided. The device includes: a reading unit for the target main control board to read the first traffic mapping table of each service board according to a preset period to obtain the traffic status value of each user, wherein the first traffic mapping table is composed of a user ID and the traffic status value corresponding to the user ID, the traffic status value includes a first status value and a second status value, the first status value indicates that the user has no traffic in the current statistical period, and the second status value indicates that the user has traffic in the current statistical period; an updating unit for the target main control board to update the second traffic mapping table according to the traffic status value of each user to obtain an updated second traffic mapping table, wherein the second traffic mapping table is composed of a user ID, the traffic status value corresponding to the user ID, and the number of times of no traffic corresponding to the user ID; an execution unit for the target main control board to determine a first target user to be offline according to the number of times of no traffic in the updated second traffic mapping table and perform an offline operation on the first target user.

[0017] Further, the device further includes: an authentication unit for the target main control board to authenticate the identity of each user before reading the first traffic mapping table of each service board according to a preset period to obtain the traffic status value of each user, and after the identity authentication is passed, distribute a user ID to each user; a distribution unit for the target main control board to distribute the user ID of each user to multiple service boards to process the target service of each user through the service boards.

[0018] Further, the device further includes: a statistics unit for each service board to statistically analyze the traffic status of each user according to the preset period after distributing the user ID of each user to multiple service boards to process the target service of each user; a first setting unit for setting the traffic status value of the second target user in the first traffic mapping table to the first status value if there is a second target user with a traffic status of no traffic in the current statistical period; a second setting unit for setting the traffic status value of the third target user in the first traffic mapping table to the second status value if there is a third target user with a traffic status of having traffic in the current statistical period.

[0019] Further, the updating unit includes: a first setting module, configured to, if there is a fourth target user whose traffic status values in the first traffic mapping tables corresponding to each service board card are all the first status value, set the traffic status value of the fourth target user in the second traffic mapping table to the first status value, and accumulate the number of times of no traffic of the fourth target user in the second traffic mapping table; a second setting module, configured to, if there is a fifth target user whose traffic status value in the first traffic mapping table corresponding to any one service board card is the second status value, set the traffic status value of the fifth target user in the second traffic mapping table to the second status value, and initialize the number of times of no traffic of the fifth target user in the second traffic mapping table.

[0020] Further, the execution unit includes: a reading module, configured to read the number of times of no traffic of each user from the updated second traffic mapping table; a judging module, configured to judge whether the number of times of no traffic is greater than or equal to a preset threshold; a determining module, configured to, if there is a target number of times of no traffic greater than the preset threshold, determine the user corresponding to the target number of times of no traffic as the first target user.

[0021] Further, the execution unit includes: an execution module, configured to the target main control board perform a logout operation on the first target user, and send a target instruction to the multiple service board cards, where the multiple service board cards perform a deletion process on the data information of the first target user according to the target instruction.

[0022] Further, the device further includes: a first synchronization unit, configured to, after the target main control board updates the second traffic mapping table according to the traffic status values of each user to obtain an updated second traffic mapping table, the target main control board synchronize the number of times of no traffic in the updated second traffic mapping table to a standby main control board; a first processing unit, configured to, when the target main control board fails, use the standby main control board to work instead of the target main control board.

[0023] Further, the device further includes: a second synchronization unit, configured to, after the target main control board updates the second traffic mapping table according to the traffic status values of each user to obtain an updated second traffic mapping table, the target main control board synchronize the number of times of no traffic in the updated second traffic mapping table to the main control board in a standby distributed device; a second processing unit, configured to, when the distributed device where the target main control board is located fails, use the standby distributed device to work instead of the distributed device where the target main control board is located.

[0024] To achieve the above object, according to one aspect of the present application, there is provided a processor for running a program, wherein when the program runs, it executes the user logout method described in any one of the above.

[0025] To achieve the above object, according to one aspect of the present application, there is provided an electronic device including one or more processors and a memory for storing the user logout method described in any one of the above implemented by the one or more processors.

[0026] In the present application, the following steps are adopted: The target main control board reads the first traffic mapping table of each service board according to a preset period to obtain the traffic status value of each user. The first traffic mapping table consists of a user ID and the traffic status value corresponding to the user ID. The traffic status value includes a first status value and a second status value. The first status value indicates that the user has no traffic in the current statistical period, and the second status value indicates that the user has traffic in the current statistical period. The target main control board updates the second traffic mapping table according to the traffic status value of each user to obtain the updated second traffic mapping table. The second traffic mapping table consists of a user ID, the traffic status value corresponding to the user ID, and the number of times of no traffic corresponding to the user ID. The target main control board determines the first target user to be logged out according to the number of times of no traffic in the updated second traffic mapping table and performs a logout operation on the first target user, solving the problem in the related art that the flexibility of the user logout operation is relatively low by setting a forced timeout time on a distributed device. In this solution, traffic statistics are based on a preset period, and the function implementation is more flexible. The preset period can be adjusted. The smaller the preset period, the more accurate the timeout kickout. At the end of each preset period, the target main control board polls the first traffic mapping table of each service board to avoid communication conflicts. The communication messages between the boards are reduced. The target main control board can quickly determine the first target user to be logged out according to the number of times of no traffic without using a complex timer for monitoring, thereby achieving the effect of improving the flexibility of the user logout operation. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The schematic embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation to the present application. In the drawings:

[0028] Figure 1 is a flowchart of the user logout method provided by an embodiment of the present application;

[0029] Figure 2 is a schematic diagram of a distributed device provided by an embodiment of the present application;

[0030] Figure 3Schematic diagram of the main control board reading data according to an embodiment of the present application;

[0031] Figure 4 Schematic diagram of a user going offline according to an embodiment of the present application;

[0032] Figure 5 Schematic diagram of the main control board and the standby main control board according to an embodiment of the present application;

[0033] Figure 6 Schematic diagram of the main control board and the standby main control board synchronizing data according to an embodiment of the present application;

[0034] Figure 7 Schematic diagram of the distributed device and the standby distributed device according to an embodiment of the present application;

[0035] Figure 8 Schematic diagram of the distributed device and the standby distributed device synchronizing data according to an embodiment of the present application;

[0036] Figure 9 Flowchart of an optional method for a user to go offline according to an embodiment of the present application;

[0037] Figure 10 Schematic diagram of a device for a user to go offline according to an embodiment of the present application;

[0038] Figure 11 Schematic diagram of an electronic device according to an embodiment of the present application. Detailed implementation manners

[0039] It should be noted that, without conflict, the embodiments in the present application and the features in the embodiments may be combined with each other. The present application will be described in detail below with reference to the drawings and in conjunction with the embodiments.

[0040] In order to enable those skilled in the art to better understand the solution of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

[0041] It should be noted that the terms "first", "second", etc. in the description, claims, and the above-mentioned drawings of this application are used to distinguish similar objects, and do not necessarily need to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances for the embodiments of this application described herein. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.

[0042] The present invention will be described below in conjunction with preferred implementation steps. Figure 1 It is a flowchart of a method for a user to go offline according to an embodiment of this application. The offline method is applied to a distributed device, and the distributed device includes at least a target main control board and multiple service boards, such as Figure 1 As shown, the method includes the following steps:

[0043] Step S101, the target main control board reads the first traffic mapping table of each service board according to a preset period to obtain the traffic status value of each user. Among them, the first traffic mapping table is composed of a user ID and the traffic status value corresponding to the user ID. The traffic status value includes a first status value and a second status value. The first status value indicates that the user has no traffic in the current statistical period, and the second status value indicates that the user has traffic in the current statistical period.

[0044] Step S102, the target main control board updates the second traffic mapping table according to the traffic status value of each user to obtain an updated second traffic mapping table. Among them, the second traffic mapping table is composed of a user ID, the traffic status value corresponding to the user ID, and the number of times of no traffic corresponding to the user ID.

[0045] Step S103, the target main control board determines the first target user to be offline according to the number of times of no traffic in the updated second traffic mapping table, and performs an offline operation on the first target user.

[0046] Specifically, a distributed device usually includes multiple service boards for network traffic processing. By load-balancing the network traffic and distributing it to multiple service boards, the traffic processing ability is improved. In the face of a large-traffic business scenario, a multi-board distributed device has strong performance advantages.

[0047] A distributed device usually includes at least one main control module and multiple service modules. In Figure 2In the distributed device shown, the main body of the master control module is composed of a master control board, and the main body of each service module is composed of a service board. The master control board undertakes functions such as device configuration and control, and the service boards share the traffic processing service through load balancing.

[0048] In order to achieve traffic timeout for online users at the minimum resource cost, each service board maintains a first traffic mapping table respectively, in the following form:

[0049] Table 1

[0050] User-ID 1 2 3 4 5 6 7 8 ... Flag 1 0 1 1 0 0 1 1 ...

[0051] Among them, User-ID is the unique ID of a certain user and is also the key of the first traffic mapping table. All users have corresponding mapping items in the first traffic mapping table. If a user goes online, a pair of mapping items is added to the first traffic mapping table. If a user goes offline, a pair of mappings is deleted from the first traffic mapping table.

[0052] Among them, Flag is the traffic status value of the traffic of this user on this service card and is also the value of the mapping table. On the service board, if the flag corresponding to a certain user is 1 (i.e., the above first status value), it means that there is traffic of this user on this service board during the statistical period, and 0 (i.e., the above second status value) means there is no corresponding traffic.

[0053] In an optional embodiment, in order to reduce the storage size of Table 1, bitmap is usually used for storage, that is, User-ID is omitted, and a certain bit of the data represents User-ID. For example, if the 512th bit is 1, it means that the user with User-ID of 512 has a Flag of 1. In this way, only one byte is needed to represent 8 user data, and only a dozen K of storage is needed for 100,000 users.

[0054] A second traffic mapping table is maintained on the target master control board, in the following form:

[0055] Table 2

[0056] User-ID 1 2 3 4 5 6 7 8 ... Flag 1 0 1 1 0 0 1 1 ... Count 1 0 3 4 0 0 2 2 ...

[0057] Among them, User-ID has the same meaning as that in Table 1 and is also the key of the second traffic mapping table. Flag is the traffic status value of the traffic of this user in the entire distributed device and is the value of the second traffic mapping table. If the flag corresponding to a certain user on the target master control board is 1, it means whether there is traffic of this user in the entire device during the statistical period, which is the result of summarizing the flags of all service boards. Count is the result of the number of times of no traffic according to each statistical period and is also the value of the second traffic mapping table.

[0058] After the user goes online, initially, the flag values of each service board card in Table 1 are 0, the flag value of the master control board card in Table 2 is 0, and the Count value is 0. The service board card statistically analyzes the traffic status of each user at a preset period to obtain the above-mentioned first traffic mapping table (Table 1).

[0059] The target master control board card polls the first traffic mapping tables of all service board cards at a preset period, and sequentially requests the first traffic mapping tables of all service board cards in the previous statistical period. The service board card replies with its own first traffic mapping table. Taking three service board cards as an example, the schematic diagram of the target master control board card polling all service board cards is as Figure 3 shown. The target master control board card obtains the traffic status value of each user by reading the first traffic mapping table of each service board card. Then, the target master control board card updates the second traffic mapping table according to the traffic status value of each user. Finally, the target master control board card determines the first target user to be logged off based on the number of times of no traffic in the updated second traffic mapping table, and performs a log-off operation on the first target user.

[0060] It should be noted that the preset period can be set according to actual needs. In the embodiment of the present invention, the reference preset period range is 1 to 60 s.

[0061] In summary, in this solution, traffic statistics are performed based on a preset period, and the function implementation is more flexible. The preset period can be adjusted. The smaller the preset period, the more accurate the timeout kick-out. At the end of each preset period, the target master control board card polls the first traffic mapping tables of each service board card to avoid communication conflicts. The communication messages between the board cards are reduced. The target master control board card can quickly determine the first target user to be logged off according to the number of times of no traffic, without using a complex timer for monitoring, which improves the flexibility and accuracy of the user log-off operation.

[0062] In the user log-off method provided in the embodiment of the present application, before the target master control board card reads the first traffic mapping table of each service board card at a preset period to obtain the traffic status value of each user, the method further includes: the target master control board card authenticates the identity of each user, and after the identity authentication is passed, distributes a user ID to each user; the target master control board card distributes the user ID of each user to multiple service board cards to process the target services of each user through the service board cards.

[0063] Specifically, before processing the target service of each user through the service board, the target main control board authenticates each user. After the user authentication is passed, the target main control board assigns a unique user ID to the user and sends the relevant data of the user to the service board. The service board associates the service traffic with the authenticated user to perform traffic real-name auditing or Internet access behavior control, where the traffic real-name auditing and Internet access behavior control are the above-mentioned target services.

[0064] Optionally, in the user logout method provided in the embodiment of the present application, after distributing the user ID of each user to multiple service boards to process the target service of each user through the service boards, the method further includes: each service board statistically counts the traffic status of each user according to a preset period; if there is a second target user with a traffic status of no traffic in the current statistical period, the traffic status value of the second target user in the first traffic mapping table is set to the first status value; if there is a third target user with a traffic status of having traffic in the current statistical period, the traffic status value of the third target user in the first traffic mapping table is set to the second status value.

[0065] Specifically, each service board statistically counts the traffic status of each user according to a preset period. If there is a second target user with a traffic status of no traffic in the current statistical period, the traffic status value of the second target user in the first traffic mapping table is correspondingly set to the first status value (for example, set to 0); if there is a third target user with a traffic status of having traffic in the current statistical period, the traffic status value of the third target user in the first traffic mapping table is correspondingly set to the second status value (for example, set to 1). Through the above steps, traffic statistics are performed based on a preset period, and the function implementation is more flexible. The period can be adjusted. The larger the period, the smaller the communication pressure, and the smaller the period, the more accurate the timeout kick-out.

[0066] Optionally, in the user logout method provided in the embodiment of the present application, the target main control board updates the second traffic mapping table according to the traffic status value of each user, and the updated second traffic mapping table obtained includes: if there is a fourth target user whose traffic status values in the first traffic mapping tables corresponding to each service board are all the first status value, the traffic status value of the fourth target user in the second traffic mapping table is set to the first status value, and the number of times of no traffic of the fourth target user in the second traffic mapping table is accumulated; if there is a fifth target user whose traffic status value in the first traffic mapping table corresponding to any one service board is the second status value, the traffic status value of the fifth target user in the second traffic mapping table is set to the second status value, and the number of times of no traffic of the fifth target user in the second traffic mapping table is initialized.

[0067] Specifically, the target main control board polls all service boards and sequentially requests the first traffic mapping table of all service boards in the previous statistical period.

[0068] The target main control board aggregates the flags of the first traffic mapping tables provided by the service boards into its own second traffic mapping table. The aggregation process of the main control card includes:

[0069] (1) Update the Flag value. The flag of the second traffic mapping table of the target main control board is equal to the logical OR of the flags of all service boards. That is, if any one of the service boards has a flag value of 1, then the flag of the second traffic mapping table of the target main control board is 1.

[0070] (2) Update the Count value according to the current Count value and the Flag value. If the Flag is 1, the Count value is reset to 0 (i.e., the above initialization). If the Flag value is 0, the Count value is incremented by 1 (i.e., the above accumulation operation).

[0071] To maximize the compression of the message size for the service board to transfer its own traffic mapping table, the following optimized storage of the traffic mapping table data in the message is performed:

[0072] 1. When the number of users with a flag value of 1 in the mapping table is large, send the entire traffic mapping table in bitmap form.

[0073] 2. When the number of users with a flag value of 1 in the mapping table is small, only send the user IDs with a flag value of 1.

[0074] By adding a field in the message to identify the storage form of the traffic mapping table in the message, when the storage method is 1, the service card can perform normal aggregation. When the storage method is 2, the main control card automatically fills the flag values of the users included in the message with 1 and fills the flags of the users not included in the message with 0, and then performs aggregation.

[0075] Optionally, in the user offline method provided in the embodiments of the present application, determining the first target user to be offline based on the number of times without traffic in the updated second traffic mapping table includes: reading the number of times without traffic of each user from the updated second traffic mapping table; determining whether the number of times without traffic is greater than or equal to a preset threshold; if there is a target number of times without traffic greater than the preset threshold, determining the user corresponding to the target number of times without traffic as the first target user.

[0076] Performing an offline operation on the first target user includes: the target main control board performing an offline operation on the first target user and sending a target instruction to multiple service boards. Among them, the multiple service boards perform a deletion process on the data information of the first target user according to the target instruction.

[0077] Specifically, set the no-traffic timeout period T. The target main control board monitors the Count value of each user in its second traffic mapping table. If the count value of a certain user exceeds [T / t]+1 (i.e., the above-mentioned preset threshold), then this user is the above-mentioned first target user. The target main control board performs a logout operation on the first target user and issues a target instruction to each service card. Multiple service boards delete the data information of the first target user according to the target instruction. The schematic diagram of performing the logout operation on the first target user is as shown in Figure 4 shown. It should be noted that the no-traffic timeout period T is greater than the preset period t and can be set according to actual needs. For example, if t is set to 60s, the corresponding T can be set to 5 minutes.

[0078] Optionally, in the user logout method provided in the embodiments of the present application, after the target main control board updates the second traffic mapping table according to the traffic status value of each user to obtain the updated second traffic mapping table, the method further includes: the target main control board synchronizes the no-traffic times in the updated second traffic mapping table to the standby main control board; when the target main control board fails, the standby main control board replaces the target main control board to work.

[0079] As an optional solution, to enhance the stability of the device, two main control boards are redundantly deployed. The two main control boards are master and standby for each other. When the current main control board cannot work, the standby main control board will automatically take over all the work of the current main control card to ensure that the traffic of the network device is not interrupted and the service is not affected. Its structure is as shown in Figure 5 shown. To ensure that when the current main control board fails, the standby main control board can take over the data of the target main control board in the first time, and thus does not affect the normal no-traffic timeout of the user, it is necessary to synchronize the relevant data of the user no-traffic timeout to the standby main control board when the standby main control board is in the standby state.

[0080] After the target main control board updates the second traffic mapping table according to the traffic status value of each user to obtain the updated second traffic mapping table, it is only necessary to synchronize the second traffic mapping table to the standby main control board. The synchronization process is as shown in Figure 6 shown. Figure 6 When synchronizing the mapping table, usually only the Count value of the second traffic mapping table needs to be synchronized, and there is no need to synchronize the Flag value.

[0081] When the current main control board fails, the standby main control board is quickly enabled. Since its second traffic mapping table is the same as that of the current main control board, after the standby main control board is enabled, it can replace the current main control board and complete the above process of logging out the user, and the no-traffic timeout of the user will not be affected.

[0082] Optionally, in the user offline method provided in the embodiments of the present application, after the target main control board updates the second traffic mapping table according to the traffic status value of each user to obtain the updated second traffic mapping table, the method further includes: the target main control board synchronizes the number of zero-traffic times in the updated second traffic mapping table to the main control board in the standby distributed device; when the distributed device where the target main control board is located fails, the standby distributed device is used to replace the distributed device where the target main control board is located to work.

[0083] As an alternative solution, when a single distributed device fails as a whole, the dual main control modules may fail simultaneously. To further improve the device stability or further improve the device traffic processing performance, a highly available cluster can be constructed.

[0084] Based on the solution of the present invention, at the end of each statistical cycle, in a highly available cluster environment, only one traffic mapping table needs to be transmitted between the current main control boards of the distributed devices.

[0085] A basic highly available cluster deployment form is as Figure 7 shown. The cluster is composed of two distributed devices, which are mutually the primary and the standby. The primary device undertakes the service traffic, and the standby device is redundantly deployed to replace the primary device when it fails to work properly. This type of deployment method is usually called the HA (Highly Available) cluster in the AP (Active&Passive) deployment mode. The schematic diagram of the highly available cluster composed of two distributed network devices is as Figure 7 shown.

[0086] When the main control board of the primary device fails, the standby board of the primary device will take over its work. When the primary device fails as a whole (usually detected by monitoring traffic and interfaces), the standby distributed device as a whole will take over the work of the primary distributed device.

[0087] To implement the user zero-traffic timeout in the above deployment environment, it is necessary to consider synchronizing the mapping table between the primary and the standby. When the primary distributed device is in the working state, at the end of each statistical cycle, the second traffic mapping table is synchronized to the standby distributed device. After the target main control board updates the second traffic mapping table according to the traffic status value of each user to obtain the updated second traffic mapping table, the second traffic mapping table is synchronized to the standby main control board of the primary device. After the synchronization is completed, the second traffic mapping table is synchronized to the main control board of the standby distributed device. The process is as Figure 8 shown.

[0088] Figure 8When synchronizing the intermediate synchronization mapping table, usually only the Count value of Table 2 needs to be synchronized, and there is no need to synchronize the Flag value. In the above synchronization operation, except for the main control board card of the standby distributed device to receive synchronization, other board cards do not need to perform any synchronization. When the primary and standby are switched, the current main control board card of the standby distributed device has the same second traffic mapping table as the current main control card of the primary distributed device. After the standby distributed device enters the enabled state, it can execute all the work of the primary distributed device.

[0089] In an optional embodiment, the flowchart as Figure 9 shown can be used to implement the offline operation of users. Specifically, the service board card statistically analyzes the traffic status of each user at a preset period to obtain the above-mentioned first traffic mapping table. The target main control board card polls the first traffic mapping tables of all service board cards at a preset period, sequentially requests the first traffic mapping tables of all service board cards in the previous statistical period, and the service board cards reply with their own first traffic mapping tables to the target main control board card. The target main control board card obtains the traffic status values of each user by reading the first traffic mapping tables of each service board card. Then, the second traffic mapping table of the target main control board card is updated through the traffic status values of each user. Finally, the target main control board card determines the first target user to be offline based on the number of times without traffic in the updated second traffic mapping table, and performs the offline operation on the first target user. At the same time, the main control board card performs the synchronization operation. If it is detected that the distributed device has ended its operation, then it ends. If it is detected that the end of the operation of the distributed device has not ended, then the service board card statistically analyzes the traffic status of each user in the next period.

[0090] The user offline method provided by the embodiments of this application can be applied to the following typical application scenarios:

[0091] 1. For a distributed device, the distributed device consists of a main control module and multiple service modules. The service modules perform traffic processing and record the user traffic access situation. The main control module polls the service modules, aggregates data, and then monitors the user timeout situation.

[0092] 2. For a distributed device, the distributed device consists of two main control modules and multiple service modules. The service modules perform traffic processing and record the user traffic access situation. One of the two main control modules is in the enabled state, and the other main control module is standby. The current main control module polls the service modules, aggregates data, and then monitors the user timeout situation. At the same time, relevant data is synchronized to the standby main control module so that when the current main control module fails, the standby main control module can quickly take over the work.

[0093] 3. For a distributed device deployed in a highly available cluster, the distributed device is in the form described in the above 1 or 2, and synchronizes data between devices in a specific manner to ensure high availability.

[0094] The user offline method provided by the embodiment of the present application has the following technical effects: traffic statistics are performed based on a period, and the function implementation is more flexible. The period can be adjusted. The larger the period, the smaller the communication pressure. The smaller the period, the more accurate the timeout kick-out. At the end of each period, the master control board polls the traffic mapping tables of each service board in sequence to avoid communication conflicts. The communication messages between the boards are reduced. Each service board and the master control board only communicate once per period to synchronize the traffic mapping tables. The master control board can quickly determine the timeout users according to the count value without using a complex timer for monitoring. It supports synchronization between dual master modules, and only the master control board needs to synchronize the traffic mapping table. It supports synchronization between high-availability clusters, and only the current master control boards of the primary and standby devices need to synchronize the traffic mapping table.

[0095] In the user offline method provided by the embodiment of the present application, the target master control board reads the first traffic mapping table of each service board according to a preset period to obtain the traffic status value of each user. The first traffic mapping table consists of the user ID and the traffic status value corresponding to the user ID. The traffic status value includes a first status value and a second status value. The first status value indicates that the user has no traffic in the current statistical period, and the second status value indicates that the user has traffic in the current statistical period. The target master control board updates the second traffic mapping table according to the traffic status value of each user to obtain the updated second traffic mapping table. The second traffic mapping table consists of the user ID, the traffic status value corresponding to the user ID, and the number of times the user has no traffic. The target master control board determines the first target user to be offline according to the number of times the user has no traffic in the updated second traffic mapping table and performs an offline operation on the first target user, which solves the problem in the related technology that the flexibility of the user offline operation is low by setting a forced timeout time to control the user offline operation on a distributed device. In this solution, traffic statistics are performed based on a preset period, and the function implementation is more flexible. The preset period can be adjusted. The smaller the preset period, the more accurate the timeout kick-out. At the end of each preset period, the target master control board polls the first traffic mapping table of each service board to avoid communication conflicts. The communication messages between the boards are reduced. The target master control board can quickly determine the first target user to be offline according to the number of times the user has no traffic without using a complex timer for monitoring, thereby achieving the effect of improving the flexibility of the user offline operation.

[0096] It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions. And although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than here.

[0097] The embodiment of the present application also provides a user offline device. It should be noted that the user offline device in the embodiment of the present application can be used to execute the user offline method provided by the embodiment of the present application. The user offline device provided by the embodiment of the present application is introduced below.

[0098] Figure 10 is a schematic diagram of the user offline device according to the embodiment of the present application. As Figure 10 shown, the device includes: a reading unit 1001, an updating unit 1002, and an executing unit 1003.

[0099] The reading unit 1001 is configured to enable the target main control board to read the first traffic mapping table of each service board at a preset period, so as to obtain the traffic status value of each user. The first traffic mapping table is composed of a user ID and the traffic status value corresponding to the user ID. The traffic status value includes a first status value and a second status value. The first status value indicates that the user has no traffic in the current statistical period, and the second status value indicates that the user has traffic in the current statistical period;

[0100] The updating unit 1002 is configured to enable the target main control board to perform an updating process on the second traffic mapping table according to the traffic status value of each user, so as to obtain the updated second traffic mapping table. The second traffic mapping table is composed of a user ID, the traffic status value corresponding to the user ID, and the number of times of no traffic corresponding to the user ID;

[0101] The executing unit 1003 is configured to enable the target main control board to determine a first target user to be offline according to the number of times of no traffic in the updated second traffic mapping table, and perform an offline operation on the first target user.

[0102] The offline device for users provided by the embodiments of the present application includes a reading unit 1001, which is used for the target main control board to read the first traffic mapping table of each service board according to a preset period to obtain the traffic status value of each user. The first traffic mapping table consists of a user ID and the traffic status value corresponding to the user ID. The traffic status value includes a first status value and a second status value. The first status value indicates that the user has no traffic in the current statistical period, and the second status value indicates that the user has traffic in the current statistical period. An updating unit 1002 is used for the target main control board to update the second traffic mapping table according to the traffic status value of each user to obtain the updated second traffic mapping table. The second traffic mapping table consists of a user ID, the traffic status value corresponding to the user ID, and the number of times of no traffic corresponding to the user ID. An execution unit 1003 is used for the target main control board to determine the first target user to be offline according to the number of times of no traffic in the updated second traffic mapping table and perform an offline operation on the first target user, which solves the problem in the related art that the flexibility of the user offline operation is relatively low by setting a forced timeout time to control the user offline operation on a distributed device. In this solution, traffic statistics are performed based on a preset period, and the function implementation is more flexible. The preset period can be adjusted. The smaller the preset period, the more accurate the timeout kick-out. At the end of each preset period, the target main control board polls the first traffic mapping table of each service board to avoid communication conflicts and reduce the communication messages between the boards. The target main control board can quickly determine the first target user to be offline according to the number of times of no traffic without using a complex timer for monitoring, thereby achieving the effect of improving the flexibility of the user offline operation.

[0103] Optionally, in the offline device for users provided by the embodiments of the present application, the device further includes an authentication unit, which is used for the target main control board to authenticate the identity of each user before reading the first traffic mapping table of each service board according to a preset period to obtain the traffic status value of each user, and distribute a user ID to each user after the identity authentication is passed. A distribution unit is used for the target main control board to distribute the user ID of each user to multiple service boards to process the target services of each user through the service boards.

[0104] Optionally, in the user offline device provided in the embodiments of the present application, the device further includes: a statistics unit, configured to, after distributing the user ID of each user to multiple service boards to process the target service of each user through the service boards, each service board statistically calculates the traffic status of each user according to a preset period; a first setting unit, configured to, if there is a second target user with a traffic status of no traffic in the current statistical period, set the traffic status value of the second target user in the first traffic mapping table to a first status value; a second setting unit, configured to, if there is a third target user with a traffic status of having traffic in the current statistical period, set the traffic status value of the third target user in the first traffic mapping table to a second status value.

[0105] Optionally, in the user offline device provided in the embodiments of the present application, the update unit 1002 includes: a first setting module, configured to, if the traffic status value of a fourth target user in the first traffic mapping table corresponding to each service board is the first status value, set the traffic status value of the fourth target user in the second traffic mapping table to the first status value, and perform an accumulation process on the number of times of no traffic of the fourth target user in the second traffic mapping table; a second setting module, configured to, if the traffic status value of a fifth target user in the first traffic mapping table corresponding to any service board is the second status value, set the traffic status value of the fifth target user in the second traffic mapping table to the second status value, and initialize the number of times of no traffic of the fifth target user in the second traffic mapping table.

[0106] Optionally, in the user offline device provided in the embodiments of the present application, the execution unit 1003 includes: a reading module, configured to read the number of times of no traffic of each user from the updated second traffic mapping table; a judgment module, configured to judge whether the number of times of no traffic is greater than or equal to a preset threshold; a determination module, configured to, if there is a target number of times of no traffic greater than the preset threshold, determine the user corresponding to the target number of times of no traffic as the first target user.

[0107] Optionally, in the user offline device provided in the embodiments of the present application, the execution unit 1003 includes: an execution module, configured to the target main control board perform an offline operation on the first target user and send a target instruction to multiple service boards, where the multiple service boards delete the data information of the first target user according to the target instruction.

[0108] Optionally, in the user offline device provided in the embodiments of the present application, the device further includes: a first synchronization unit, configured to synchronize the number of zero-traffic times in the updated second traffic mapping table to the standby main control board after the target main control board updates the second traffic mapping table according to the traffic status value of each user to obtain the updated second traffic mapping table; a first processing unit, configured to, when the target main control board fails, use the standby main control board to replace the target main control board to work.

[0109] Optionally, in the user offline device provided in the embodiments of the present application, the device further includes: a second synchronization unit, configured to synchronize the number of zero-traffic times in the updated second traffic mapping table to the main control board in the standby distributed device after the target main control board updates the second traffic mapping table according to the traffic status value of each user to obtain the updated second traffic mapping table; a second processing unit, configured to, when the distributed device where the target main control board is located fails, use the standby distributed device to replace the distributed device where the target main control board is located to work.

[0110] The user offline device includes a processor and a memory. The above-mentioned reading unit 1001, updating unit 1002, execution unit 1003, etc. are all stored in the memory as program units, and the processor executes the above program units stored in the memory to implement corresponding functions.

[0111] The processor contains a kernel, and the kernel retrieves the corresponding program unit from the memory. One or more kernels can be set, and the offline control of the user is achieved by adjusting the kernel parameters.

[0112] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of, for example, read-only memory (ROM) or flash memory (flash RAM), and the memory includes at least one storage chip.

[0113] An embodiment of the present invention provides a processor, and the processor is used to run a program. When the program runs, it executes the user offline method.

[0114] Such as Figure 11As shown in the figure, an embodiment of the present invention provides an electronic device, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, the following steps are implemented: The target main control board reads the first traffic mapping table of each service board according to a preset period to obtain the traffic status value of each user. The first traffic mapping table is composed of a user ID and the traffic status value corresponding to the user ID. The traffic status value includes a first status value and a second status value. The first status value indicates that the user has no traffic in the current statistical period, and the second status value indicates that the user has traffic in the current statistical period; The target main control board updates the second traffic mapping table according to the traffic status value of each user to obtain the updated second traffic mapping table. The second traffic mapping table is composed of a user ID, the traffic status value corresponding to the user ID, and the number of times of no traffic corresponding to the user ID; The target main control board determines the first target user to be taken offline according to the number of times of no traffic in the updated second traffic mapping table, and performs an offline operation on the first target user.

[0115] Optionally, before the target main control board reads the first traffic mapping table of each service board according to a preset period to obtain the traffic status value of each user, the method further includes: The target main control board authenticates the identity of each user, and after the identity authentication is passed, distributes a user ID to each user; The target main control board distributes the user ID of each user to multiple service boards to process the target service of each user through the service boards.

[0116] Optionally, after distributing the user ID of each user to multiple service boards to process the target service of each user, the method further includes: Each service board statistically analyzes the traffic status of each user according to a preset period; If there is a second target user with a traffic status of no traffic in the current statistical period, the traffic status value of the second target user in the first traffic mapping table is set to the first status value; If there is a third target user with a traffic status of having traffic in the current statistical period, the traffic status value of the third target user in the first traffic mapping table is set to the second status value.

[0117] Optionally, the target main control board updates the second traffic mapping table according to the traffic status value of each user, and the updated second traffic mapping table obtained includes: if there is a fourth target user whose traffic status values in the first traffic mapping tables corresponding to each service board are all the first status value, the traffic status value of the fourth target user in the second traffic mapping table is set to the first status value, and the no-traffic times of the fourth target user in the second traffic mapping table are accumulated; if there is a fifth target user whose traffic status value in the first traffic mapping table corresponding to any service board is the second status value, the traffic status value of the fifth target user in the second traffic mapping table is set to the second status value, and the no-traffic times of the fifth target user in the second traffic mapping table are initialized.

[0118] Optionally, determining the first target user to be taken offline according to the no-traffic times in the updated second traffic mapping table includes: reading the no-traffic times of each user from the updated second traffic mapping table; determining whether the no-traffic times are greater than or equal to a preset threshold; if there is a target no-traffic time greater than the preset threshold, determining the user corresponding to the target no-traffic time as the first target user.

[0119] Optionally, performing an offline operation on the first target user includes: the target main control board performs an offline operation on the first target user and sends a target instruction to multiple service boards, where the multiple service boards delete the data information of the first target user according to the target instruction.

[0120] Optionally, after the target main control board updates the second traffic mapping table according to the traffic status value of each user and obtains the updated second traffic mapping table, the method further includes: the target main control board synchronizes the no-traffic times in the updated second traffic mapping table to the standby main control board; when the target main control board fails, the standby main control board is used to replace the target main control board to work.

[0121] Optionally, after the target main control board updates the second traffic mapping table according to the traffic status value of each user and obtains the updated second traffic mapping table, the method further includes: the target main control board synchronizes the no-traffic times in the updated second traffic mapping table to the main control board in the standby distributed device; when the distributed device where the target main control board is located fails, the standby distributed device is used to replace the distributed device where the target main control board is located to work.

[0122] The devices in this article can be servers, PCs, PADs, mobile phones, etc.

[0123] The present application also provides a computer program product, which, when executed on a data processing device, is adapted to execute a program initialized with the following method steps: The target main control board reads the first traffic mapping table of each service board according to a preset period to obtain the traffic status value of each user. The first traffic mapping table consists of the user ID and the traffic status value corresponding to the user ID. The traffic status value includes a first status value and a second status value. The first status value indicates that the user has no traffic in the current statistical period, and the second status value indicates that the user has traffic in the current statistical period. The target main control board updates the second traffic mapping table according to the traffic status value of each user to obtain the updated second traffic mapping table. The second traffic mapping table consists of the user ID, the traffic status value corresponding to the user ID, and the number of times of no traffic corresponding to the user ID. The target main control board determines the first target user to be taken offline according to the number of times of no traffic in the updated second traffic mapping table and performs an offline operation on the first target user.

[0124] Optionally, before the target main control board reads the first traffic mapping table of each service board according to a preset period to obtain the traffic status value of each user, the method further includes: The target main control board authenticates the identity of each user, and after the identity authentication is passed, distributes a user ID to each user. The target main control board distributes the user ID of each user to multiple service boards to process the target service of each user through the service boards.

[0125] Optionally, after distributing the user ID of each user to multiple service boards to process the target service of each user through the service boards, the method further includes: Each service board statistically analyzes the traffic status of each user according to a preset period. If there is a second target user with a traffic status of no traffic in the current statistical period, the traffic status value of the second target user in the first traffic mapping table is set to the first status value. If there is a third target user with a traffic status of having traffic in the current statistical period, the traffic status value of the third target user in the first traffic mapping table is set to the second status value.

[0126] Optionally, the target main control board updates the second traffic mapping table according to the traffic status value of each user to obtain the updated second traffic mapping table, including: If there is a fourth target user whose traffic status values in the first traffic mapping tables corresponding to each service board are all the first status value, the traffic status value of the fourth target user in the second traffic mapping table is set to the first status value, and the number of times of no traffic of the fourth target user in the second traffic mapping table is accumulated. If there is a fifth target user whose traffic status value in the first traffic mapping table corresponding to any service board is the second status value, the traffic status value of the fifth target user in the second traffic mapping table is set to the second status value, and the number of times of no traffic of the fifth target user in the second traffic mapping table is initialized.

[0127] Optionally, determining the first target user to be taken offline according to the number of times of no traffic in the updated second traffic mapping table includes: reading the number of times of no traffic of each user from the updated second traffic mapping table; determining whether the number of times of no traffic is greater than or equal to a preset threshold; if there is a target number of times of no traffic greater than the preset threshold, determining the user corresponding to the target number of times of no traffic as the first target user.

[0128] Optionally, performing an offline operation on the first target user includes: the target main control board performing an offline operation on the first target user and sending a target instruction to multiple service boards, where the multiple service boards perform a deletion process on the data information of the first target user according to the target instruction.

[0129] Optionally, after the target main control board updates the second traffic mapping table according to the traffic status value of each user to obtain the updated second traffic mapping table, the method further includes: the target main control board synchronizing the number of times of no traffic in the updated second traffic mapping table to the standby main control board; when the target main control board fails, the standby main control board is used to replace the target main control board to work.

[0130] Optionally, after the target main control board updates the second traffic mapping table according to the traffic status value of each user to obtain the updated second traffic mapping table, the method further includes: the target main control board synchronizing the number of times of no traffic in the updated second traffic mapping table to the main control board in the standby distributed device; when the distributed device where the target main control board is located fails, the standby distributed device is used to replace the distributed device where the target main control board is located to work.

[0131] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0132] This application is described with reference to the flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram can be implemented by computer program instructions, as well as the combination of flows and / or blocks in the flowchart and / or block diagram. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate means for implementing the specified functions in one or more flows Figure 1 one or more flows and / or blocks Figure 1 or means for implementing the specified functions in one or more blocks.

[0133] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including instruction means that implement the specified functions in one or more flows Figure 1 one or more flows and / or blocks Figure 1 or means for implementing the specified functions in one or more blocks.

[0134] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for implementing the specified functions in one or more flows Figure 1 one or more flows and / or blocks Figure 1 or means for implementing the specified functions in one or more blocks.

[0135] In a typical configuration, a computing device includes one or more processors (CPUs), an input / output interface, a network interface, and a memory.

[0136] The memory may include non-permanent memory in the form of computer-readable media, random access memory (RAM), and / or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM). The memory is an example of computer-readable media.

[0137] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0138] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0139] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0140] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. A method for a user to go offline, characterized in that, The offline method is applied to a distributed device, where the distributed device at least includes a target main control board and multiple service boards, and includes: The target main control board reads the first traffic mapping table of each service board according to a preset period to obtain the traffic status value of each user. Wherein, the first traffic mapping table is composed of a user ID and the traffic status value corresponding to the user ID, and the traffic status value includes a first status value and a second status value. The first status value indicates that the user has no traffic in the current statistical period, and the second status value indicates that the user has traffic in the current statistical period; The target main control board updates the second traffic mapping table according to the traffic status value of each user to obtain an updated second traffic mapping table. Wherein, the second traffic mapping table is composed of a user ID, the traffic status value corresponding to the user ID, and the number of times of no traffic corresponding to the user ID; The target main control board determines the first target user to be offline according to the number of times of no traffic in the updated second traffic mapping table, and performs an offline operation on the first target user; Wherein, the target main control board updates the second traffic mapping table according to the traffic status value of each user to obtain an updated second traffic mapping table, including: If there is a fourth target user whose traffic status value in the first traffic mapping table corresponding to each service board is the first status value, set the traffic status value of the fourth target user in the second traffic mapping table to the first status value, and accumulate the number of times of no traffic of the fourth target user in the second traffic mapping table; If there is a fifth target user whose traffic status value in the first traffic mapping table corresponding to any service board is the second status value, set the traffic status value of the fifth target user in the second traffic mapping table to the second status value, and initialize the number of times of no traffic of the fifth target user in the second traffic mapping table.

2. The method according to claim 1, wherein Before the target main control board reads the first traffic mapping table of each service board according to a preset period to obtain the traffic status value of each user, the method further includes: The target main control board authenticates the identity of each user, and after the identity authentication is passed, distributes a user ID to each user; The target main control board distributes the user ID of each user to multiple service boards to process the target service of each user through the service boards.

3. The method according to claim 2, wherein After distributing the user ID of each user to multiple service boards to process the target service of each user through the service boards, the method further includes: Each service board statistically analyzes the traffic status of each user according to the preset period; If there is a second target user with a traffic status of no traffic in the current statistical period, set the traffic status value of the second target user in the first traffic mapping table to the first status value; If there is a third target user with a traffic status of having traffic in the current statistical period, set the traffic status value of the third target user in the first traffic mapping table to the second status value.

4. The method according to claim 1, wherein Determining the first target user to be taken offline based on the number of times of no traffic in the updated second traffic mapping table includes: Reading the number of times of no traffic for each user from the updated second traffic mapping table; Judging whether the number of times of no traffic is greater than or equal to a preset threshold; If there is a target number of times of no traffic greater than the preset threshold, determining the user corresponding to the target number of times of no traffic as the first target user.

5. The method according to claim 4, wherein Performing an offline operation on the first target user includes: The target main control board performs an offline operation on the first target user and issues a target instruction to the multiple service boards, where the multiple service boards perform a deletion process on the data information of the first target user according to the target instruction.

6. The method according to claim 1, wherein After the target main control board updates the second traffic mapping table according to the traffic status value of each user to obtain the updated second traffic mapping table, the method further includes: The target main control board synchronizes the number of times of no traffic in the updated second traffic mapping table to the standby main control board; When the target main control board fails, the standby main control board is used to work instead of the target main control board.

7. The method according to claim 1, characterized in that After the target main control board updates the second traffic mapping table according to the traffic status value of each user to obtain the updated second traffic mapping table, the method further includes: The target main control board synchronizes the number of times of no traffic in the updated second traffic mapping table to the main control board in the standby distributed device; When the distributed device where the target main control board is located fails, the standby distributed device is used to work instead of the distributed device where the target main control board is located.

8. An offline device for a user, characterized in that, Including: A reading unit, configured to enable the target main control board to read the first traffic mapping table of each service board according to a preset period to obtain the traffic status value of each user, where the first traffic mapping table is composed of a user ID and the traffic status value corresponding to the user ID, the traffic status value includes a first status value and a second status value, the first status value indicates that the user has no traffic in the current statistical period, and the second status value indicates that the user has traffic in the current statistical period; An updating unit, configured to enable the target main control board to update the second traffic mapping table according to the traffic status value of each user to obtain the updated second traffic mapping table, where the second traffic mapping table is composed of a user ID, the traffic status value corresponding to the user ID, and the number of times of no traffic corresponding to the user ID; An execution unit, configured to enable the target main control board to determine the first target user to be taken offline according to the number of times of no traffic in the updated second traffic mapping table and perform an offline operation on the first target user; Wherein, the updating unit is further configured to, if there is a fourth target user whose traffic status values in the first traffic mapping tables corresponding to each service board are all the first status value, set the traffic status value of the fourth target user in the second traffic mapping table to the first status value, and perform an accumulation process on the number of times of no traffic of the fourth target user in the second traffic mapping table; if there is a fifth target user whose traffic status value in the first traffic mapping table corresponding to any service board is the second status value, set the traffic status value of the fifth target user in the second traffic mapping table to the second status value, and initialize the number of times of no traffic of the fifth target user in the second traffic mapping table.

9. A processor, characterized in that, The processor is configured to run a program, wherein when the program runs, it executes the offline method of the user according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Online user offline processing method and device

    CN105939374A

  • Load balancing system and method for server cluster

    CN113742066A