User login method and system based on time interval and user terminal
By dynamically adjusting the login request interval of T-Box, the problem of overloading of TSP system in the Internet of Vehicles system is solved based on the number of login requests and the failures, and the processing efficiency of login requests and system stability are improved.
Patent Information
- Application Number
- CN202510657234.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-21
- Publication Date
- 2025-07-04
AI Technical Summary
In the Internet of Vehicles system, a large number of T-Boxes initiate login requests simultaneously lead to overloading of the TSP system, resulting in full server resources, surge in response delays and system avalanches, affecting platform stability and user experience.
Through the user login method based on the time interval, the login request interval is dynamically adjusted, and the second time interval is calculated and adjusted according to the number of initiation times and failures of the login request, so that it is positively correlated with the first time interval, and the frequency of the login request is controlled to avoid overload.
It effectively slows down the frequency of login requests initiated by user terminals with excessive retry times, improves the efficiency of login request processing, solves the problem of TSP system overload, and improves system stability and user experience.
Smart Images

Figure CN120263531A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of user login, and in particular, to a user login method, system and user terminal based on time interval. Background Art
[0002] With the rapid evolution of vehicle networking technology, new energy vehicles are generally equipped with a Telematics Box (T-Box) to build a data interaction channel between the vehicle and the Telematics Service Provider (TSP). The T-Box is connected to the cloud platform in real time through a cellular network or satellite communication, and executes core functions including vehicle status monitoring, remote instruction parsing, emergency event triggering, vehicle condition data uploading, etc., becoming a key component of intelligent connected vehicles. In recent years, with the sharp increase in the number of vehicles, the deployment scale of T-Boxes has also shown an exponential growth trend.
[0003] In a high-concurrency scenario, due to factors such as vehicle start-stop synchronization and network signal fluctuations, a large number of T-Boxes are triggered to initiate login requests simultaneously, which causes the TSP to process large-scale identity authentication, session establishment, and resource allocation operations in a very short time. Traditional polling or fixed-interval retry mechanisms are prone to trigger a "request storm", causing the server's CPU, memory, and bandwidth resources to be instantaneously occupied, resulting in a sharp increase in response latency, service unavailability, and even system-level avalanches. This contradiction is particularly prominent in emergency services with low latency requirements, seriously affecting the stability of the vehicle networking platform and the user experience. Summary of the Invention
[0004] To provide a basic understanding of some aspects of the disclosed embodiments, a simple summary is given below. The summary is not a comprehensive review, nor is it intended to identify key / important constituent elements or delineate the protection scope of these embodiments, but rather serves as a preamble to the subsequent detailed description.
[0005] In view of the above-mentioned disadvantages of the prior art, the present application provides a user login method, system and user terminal based on time interval to solve the problem of TSP system overload caused by a large number of T-Boxes executing login requests.
[0006] The present application provides a user login method based on time intervals, including: obtaining a first time interval corresponding to a first login request; using the first time interval as the initiation time interval between the first login request and a second login request, and initiating the second login request; if the request result corresponding to the second login request is a login failure, calculating according to the first time interval to obtain a second time interval that satisfies a preset interval rule, where the preset interval rule includes that the first time interval is less than the second time interval, and the interval difference between the first time interval and the second time interval is positively correlated with the number of times the login request is initiated; using the second login request as the new first login request, and using the second time interval as the first time interval corresponding to the second login request.
[0007] In an embodiment of the present application, calculating according to the first time interval to obtain a second time interval that satisfies a preset interval rule includes: obtaining a third login request corresponding to the first login request in the order of request initiation, where the third login request is the login request in the previous position of the first login request; using the first time interval corresponding to the third login request as the interval difference, and calculating according to the interval difference the first time interval corresponding to the first login request to obtain the second time interval.
[0008] In an embodiment of the present application, the method for determining the second time interval further includes: if the number of times the login request is initiated is greater than or equal to a preset first number threshold, calculating according to the first time interval to obtain a second time interval that satisfies a preset interval rule; if the number of times the login request is initiated is less than the first number threshold, setting the second time interval according to a preset initial time interval.
[0009] In an embodiment of the present application, after calculating according to the first time interval to obtain a second time interval that satisfies a preset interval rule, the method further includes: obtaining a numerical determination rule, where the numerical determination rule includes parity determination and / or threshold interval determination; if the second time interval satisfies the numerical determination rule, adjusting the second time interval according to a first scaling factor.
[0010] In an embodiment of the present application, the method further includes: if the first time interval corresponding to the first login request is greater than or equal to a preset maximum time interval, then use the maximum time interval as the initiation time interval between the first login request and the second login request, initiate the second login request, and obtain the initiation times of the login requests; if the initiation times of the login requests are greater than or equal to a preset second number threshold, then obtain a random value, and adjust the first time interval corresponding to the second login request according to the random value, use the first time interval corresponding to the second login request as the initiation time interval between the second login request and the fourth login request, and initiate the fourth login request.
[0011] In an embodiment of the present application, using the first time interval as the initiation time interval between the first login request and the second login request and initiating the second login request includes: obtaining a timer and initializing the timer count of the timer; triggering the timer to execute a comparison event according to a preset time period, where the comparison event includes comparing the timer count with the first time interval; if the timer count is greater than or equal to the first time interval, then initiate the second login request; if the timer count is less than the first time interval, then increment the timer count according to the preset time period.
[0012] In an embodiment of the present application, the method further includes: if the number of user terminals is multiple, then obtain the second time intervals respectively corresponding to each of the user terminals, where the user terminals are respectively used to initiate login requests; by dividing the second time intervals with the same interval value into a group, obtain one or more interval groups corresponding to the interval values respectively, and use any one of the interval groups as the target group; if the number of second time intervals in the target group is greater than or equal to a preset number threshold, then perform random perturbation on each of the second time intervals in the target group.
[0013] In an embodiment of the present application, after calculating the second time interval that meets the preset interval rule according to the first time interval, the method further includes: obtaining the user priority corresponding to the user terminal, where the user priority is determined based on the user identity; adjusting the second time interval according to the user priority, where there is a negative correlation between the user priority and the second time interval.
[0014] The present application provides a user login system based on time intervals, including: an acquisition module configured to acquire a first time interval corresponding to a first login request; an initiation module configured to use the first time interval as the initiation time interval between the first login request and a second login request, and initiate the second login request; a calculation module configured to, if the request result corresponding to the second login request is a login failure, calculate according to the first time interval to obtain a second time interval that satisfies a preset interval rule, where the preset interval rule includes that the first time interval is less than the second time interval, and the interval difference between the first time interval and the second time interval is positively correlated with the number of times the login request is initiated; the acquisition module is further configured to use the second login request as a new first login request, and use the second time interval as the first time interval corresponding to the second login request.
[0015] The present application provides a user terminal, including: a processor and a memory; the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory so that the user terminal executes the above method.
[0016] Advantages of the present application: The second login request is initiated through the first time interval corresponding to the first login request, and when the request result corresponding to the second login request is a login failure, the second time interval corresponding to the second login request is calculated according to the first time interval, so that the first time interval is less than the second time interval, and the interval difference between the first time interval and the second time interval is positively correlated with the number of times the login request is initiated. Finally, the second time interval is used as the first time interval corresponding to the second login request to implement the retry of the next login request. In this way, compared with the traditional fixed interval retry mechanism, the interval difference between the first time interval and the second time interval is positively correlated with the number of times the login request is initiated, so that the growth rate of the second time interval is also continuously increasing. The growth is gentle in the early stage to avoid too long login waiting time, and the growth rate accelerates in the later stage, which can slow down the frequency of the user terminal with too many retry times to initiate login requests, thereby solving the problem of TSP system overload caused by a large number of T-Boxes executing login requests and improving the processing efficiency of login requests. Description of the Drawings
[0017] Figure 1 is a schematic structural diagram of a T-Box login framework in an embodiment of the present application; Figure 2 is a schematic flow diagram of a user login method based on time intervals in an embodiment of the present application; Figure 3 is a schematic diagram of a login request and its request initiation order in an embodiment of the present application; Figure 4It is a schematic flowchart of a method for determining a second time interval in an embodiment of the present application; Figure 5 It is a schematic flowchart of another user login method based on a time interval in an embodiment of the present application; Figure 6 It is a schematic flowchart of a method for initiating a second login request in an embodiment of the present application; Figure 7 It is a schematic structural diagram of a user login system based on a time interval in an embodiment of the present application; Figure 8 It is a schematic structural diagram of a user terminal in an embodiment of the present invention. Detailed implementation manners
[0018] The following uses specific specific examples to illustrate the implementation manners of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific implementation manners. Various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that, without conflict, the following embodiments and sub-samples in the embodiments can be combined with each other.
[0019] It should be noted that the diagrams provided in the following embodiments only illustrate the basic concept of the present invention in a schematic manner. Therefore, only the components related to the present invention are shown in the diagrams, rather than being drawn according to the number, shape, and size of the components in actual implementation. The type, quantity, and ratio of each component in actual implementation can be arbitrarily changed, and the component layout type may also be more complex.
[0020] In the following description, a large number of details are discussed to provide a more thorough explanation of the embodiments of the present invention. However, it is obvious to those skilled in the art that the embodiments of the present invention can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present invention difficult to understand.
[0021] The terms "first", "second", etc. in the specification, claims, and above-mentioned drawings of the present application are used to distinguish similar objects and do not necessarily need to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so as to implement the embodiments of the present application described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion.
[0022] Unless otherwise specified, the term "plurality" means two or more.
[0023] In this application, the character " / " indicates an "or" relationship between the preceding and following objects. For example, A / B means: A or B.
[0024] The term "and / or" is an associative relationship describing an object, indicating that three relationships can exist. For example, A and / or B means: A or B, or, A and B, these three relationships.
[0025] This application can be applied to a T-Box login framework that includes a T-Box and external devices (such as a TSP cloud platform, other cloud platforms, terminal devices, etc.). The T-Box needs to log in to the external device to achieve communication with the external device. The external device can be understood as a software product or hardware device that is functionally independent of the T-Box. This application takes Figure 1 as an example to illustrate. A T-Box login framework is provided, including a T-Box 101, an EMQX (Erlang / Enterprise MQTT eXtensible Broker, an enterprise-level MQTT extensible proxy based on the Erlang language) server 102, and a TSP cloud platform 103. Among them, the T-Box 101 communicates with the TSP cloud platform 103 through MQTT, and the EMQX server 102 serves as the middleware server for the communication between the T-Box 101 and the TSP cloud platform 103. When the T-Box 101 and the TSP cloud platform 103 adopt other communication methods, such that the entire T-Box login framework uses other middleware servers or does not require a middleware server, the processing flow regarding the EMQX server 102 in this application is equally applicable to other middleware servers or the TSP cloud platform 103, and the processing flow regarding the TSP cloud platform 103 in this application is equally applicable to other external devices. The T-Box 101, as an in-vehicle telematics terminal, is embedded inside the vehicle and serves as the communication hub between the vehicle and the cloud system or external devices.
[0026] The EMQX server 102, as a high-performance open-source Internet of Things message middleware based on the MQTT (Message Queuing Telemetry Transport) protocol, is responsible for the efficient communication between the device and the cloud.
[0027] The TSP cloud platform, as the core cloud platform for vehicle networking services, provides data management, analysis, and value-added services. Among them, the TSP is usually deployed in ways such as private servers, public clouds, and hybrid clouds.
[0028] In some embodiments, after being powered on, the T-Box will apply to the EMQX server to establish a connection based on the MQTT protocol rules; the T-Box needs to initiate a login request to the TSP cloud platform 103, wherein the T-Box acts as the initiator of the login and logout requests, and the EMQX server is used for data packet transfer of the MQTT network protocol and maintenance of the link heartbeat; the TSP cloud platform acts as the receiver of the login and logout requests; therefore, when a large number of T-Boxes initiate login requests at the same time, if the traditional polling or fixed interval retry mechanism is used for login retries, it is easy to cause a "request storm", which makes the CPU (Central Processing Unit), memory and bandwidth resources of the TSP cloud platform instantly occupied, resulting in a surge in response delays, service unavailability and even system-level avalanche.
[0029] In some embodiments, the T-Box sends a login request containing a vehicle identification number (VIN), a security chip ID, and public key information to the TSP cloud platform; after the TSP cloud platform verifies the legitimacy of the information, it sends the encrypted CA (Certificate Authority) certificate to the T-Box through the PKI (Public Key Infrastructure) system; the T-Box decrypts and compares it with the preset root certificate to complete two-way authentication. At this point, the request result corresponding to the login request is a successful request.
[0030] In some embodiments, the T-Box sends a login request containing a vehicle identification code, a security chip ID, and public key information to the TSP cloud platform; the TSP cloud platform verifies the login request, and if the verification fails, it returns an error code (such as 401 unauthorized, 403 invalid certificate) and the specific reason for failure (such as VIN mismatch, certificate expired); the T-Box receives the error code and the specific reason for failure, and at this point, the request result corresponding to the login request is login failure.
[0031] Combination Figure 2 As shown, the present application provides a user login method based on time intervals, including: Step S201, obtaining a first time interval corresponding to a first login request; Step S202, using the first time interval as the time interval between the first login request and the second login request, and initiating the second login request; Step S203: if the request result corresponding to the second login request is login failure, then calculate according to the first time interval to obtain a second time interval that meets the preset interval rule; Among them, the preset interval rule includes that the first time interval is less than the second time interval, and the interval difference between the first time interval and the second time interval is positively correlated with the number of initiation times of the login request; Step S204: Take the second login request as the new first login request, and take the second time interval as the first time interval corresponding to the second login request.
[0032] In some embodiments, the user login method provided by the present application is applicable to the T-Box. The present application does not limit the sequence of obtaining the first login request and the first time interval. The present application can obtain the first time interval after the first login request fails, or can obtain the first time interval at the same time as obtaining the first login request.
[0033] In some embodiments, when there is a positive correlation between two variables, it means that when one variable increases, the other variable also tends to increase. Conversely, when one variable decreases, the other variable also tends to decrease; when the interval difference between the first time interval and the second time interval is positively correlated with the number of initiation times of the login request, that is, when the number of initiation times of the login request increases, the interval difference between the first time interval and the second time interval also increases. Therefore, the growth rate of the second time interval also continuously increases with the interval difference between the first time interval and the second time interval, thereby dynamically controlling the growth rate of the second time interval.
[0034] In some embodiments, when logging in to the TSP cloud platform, the T-Box may initiate multiple login requests due to login request failures. Take any one of the login requests as the first login request; if the request result of the first login request is successful login, it means that the T-Box and the TSP cloud platform have completed the connection and subsequent business processing can be carried out; if the request result of the first login request is login failure, the T-Box initiates a second login request after the first time interval corresponding to the first login request. Among them, the first time interval corresponding to the first login request can be obtained after the first login request fails, or can be obtained at the same time as obtaining the first login request; if the request result of the second login request is login failure, calculate according to the first time interval to obtain a second time interval that satisfies the preset interval rule, where the preset interval rule is used to increase the growth rate of the second time interval according to the increase in the number of initiation times of the login request; then, take the second login request as the new first login request, and take the second time interval as the first time interval corresponding to the second login request, so that the T-Box can repeatedly send login requests to the TSP cloud platform until the login is successful.
[0035] By adopting the user login method based on time interval provided in this application, a second login request is initiated based on the first time interval corresponding to the first login request. When the request result corresponding to the second login request is a login failure, the second time interval corresponding to the second login request is calculated according to the first time interval, so that the first time interval is less than the second time interval, and the interval difference between the first time interval and the second time interval is positively correlated with the number of times the login request is initiated. Finally, the second time interval is used as the first time interval corresponding to the second login request to implement the retry of the next login request. In this way, compared with the traditional fixed-interval retry mechanism, the interval difference between the first time interval and the second time interval is positively correlated with the number of times the login request is initiated, so that the growth rate of the second time interval is also increasing continuously. The growth is gentle in the early stage to avoid too long login waiting time, and the growth rate accelerates in the later stage, which can slow down the frequency of login requests initiated by user terminals with too many retry times, thereby solving the problem of TSP system overload caused by a large number of T-Boxes executing login requests and improving the processing efficiency of login requests.
[0036] Optionally, calculating according to the first time interval to obtain a second time interval that meets the preset interval rule includes: obtaining a third login request corresponding to the first login request in the order of request initiation, where the third login request is the login request in the previous position of the first login request; using the first time interval corresponding to the third login request as the interval difference, and calculating the first time interval corresponding to the first login request according to the interval difference to obtain the second time interval.
[0037] Combined with Figure 3 As shown, sort the login requests initiated by the user terminal in the order of request initiation. In the obtained login request sequence, if any login request is determined as the first login request, then the login request in the previous position of the first login request is used as the third login request, and the time interval between the third login request and the first login request is used as the first time interval corresponding to the third login request. At the same time, the login request in the next position of the first login request is used as the second login request, and the time interval between the first login request and the second login request is used as the first time interval corresponding to the first login request.
[0038] In some embodiments, the T-Box repeatedly sends login requests to the TSP cloud platform, sorts the login requests initiated by the user terminal according to the order of request initiation, and sequentially obtains Request 01, Request 02, Request 03...; starting from Request 02, each login request is used as the first login request respectively; for example, if Request 02 is used as the first login request, then Request 01 is the third login request, and Request 03 is the second login request. The time interval between Request 01 and Request 02 is used as the first time interval corresponding to Request 01, and the time interval between Request 02 and Request 03 is used as the first time interval corresponding to Request 02; according to the first time interval of Request 01 and the first time interval corresponding to Request 02, the second time interval corresponding to Request 02 is calculated, and the second time interval corresponding to Request 02 is used as the first time interval of Request 03.
[0039] In some embodiments, the second time interval is determined by the following formula: Formula (1) In Formula (1), is the number of times the login request corresponding to the second login request is initiated, is the number of times the login request corresponding to the first login request is initiated, is the number of times the login request corresponding to the third login request is initiated; is the second time interval corresponding to the second login request, is the first time interval between the first login request and the second login request, is the first time interval between the third login request and the first login request; N is the first number threshold.
[0040] Optionally, the method for determining the second time interval further includes: if the number of times the login request is initiated is greater than or equal to the preset first number threshold, calculate according to the first time interval to obtain the second time interval that meets the preset interval rule; if the number of times the login request is initiated is less than the first number threshold, set the second time interval according to the preset initial time interval.
[0041] In this way, the login requests initiated by the user terminal are sorted according to the order of request initiation. By setting the first number threshold and the initial time interval, the time intervals between Request 01 and Request 02 and between Request 02 and Request 03 are set as fixed time intervals. At the same time, starting from Request 02, each login request is used as the first login request, so that the retry request interval at the beginning of the login request is in a suitable range, avoiding the retry request interval being too long or too short in the early stage.
[0042] In some embodiments, the value range of the first number threshold is 3 to 5 times. For example, the first number threshold is set to 3 times; the value range of the initial time interval is 2 to 5 s (seconds). For example, the initial time interval is set to 3 seconds. After the user terminal initiates the first login request and the second login request, the retry request intervals corresponding to both are 3 s. That is, if the first login request fails, the second login request is made after 3 s. If the second login request fails, the third login request is made after 3 s.
[0043] In this way, by setting the first number threshold and the initial time interval, the retry request interval at the beginning of the login request is in a suitable range, avoiding the retry request interval being too long or too short in the early stage.
[0044] Optionally, after calculating the second time interval that meets the preset interval rule according to the first time interval, the method further includes: obtaining a numerical determination rule, where the numerical determination rule includes parity determination and / or threshold interval determination; if the second time interval meets the numerical determination rule, the second time interval is adjusted according to the first scaling factor.
[0045] In this way, the T-Box repeatedly sends login requests to the TSP cloud platform; since the third initiation time interval is obtained by adding the previous two initiation time intervals, the calculation method of the initiation time interval is fixed, making the flexibility of this application poor during implementation. By setting the numerical determination rule, the time intervals corresponding to some login requests are adjusted according to the first scaling factor, so that the calculation method of the entire time interval can be scaled according to requirements, thereby improving the flexibility of the entire solution.
[0046] In some embodiments, the parity determination includes: if the parity of the second time interval is odd, the second time interval is dynamically adjusted according to the first scaling factor; if the parity of the second time interval is even, the second time interval is dynamically adjusted according to the second scaling factor, thereby adjusting the length of the second time interval. The first scaling factor and the second scaling factor can be the same or different. When no scaling is required, the scaling factor is set to 1. When the time interval needs to be reduced, the scaling factor is set to less than 1. When the time interval needs to be enlarged, the scaling factor is set to greater than 1.
[0047] In some embodiments, taking controlling the larger increase amplitude of the second time interval as the experimental requirement, multiple experiments are carried out. Based on the experimental results, it is determined that the first scaling factor between 0.75 and 0.8 can effectively control the problem of the larger increase amplitude of the second time interval. For example, compared with not adjusting the second time interval by the first scaling factor, when the first scaling factor is set to 0.8, the login efficiency can be increased by 15%.
[0048] In some embodiments, the threshold interval determination includes: if the second time interval falls within a preset numerical interval, the second time interval is adjusted according to a first scaling factor. The preset numerical interval can be one or more, and the scaling factors for different preset numerical intervals can be the same or different. When there are multiple preset numerical intervals and some of the scaling factors are different, stepped scaling can be achieved. When there are multiple preset numerical intervals and the scaling factors are the same, regional scaling can be achieved.
[0049] In some embodiments, the adjustment of the second time interval can be made not only with reference to the second time interval, but also with reference to the number of times the login request is initiated. For example, if the number of times the login request is initiated is odd, the second time interval is adjusted. Another example is that if the number of times the login request is initiated is greater than 10 times, the second time interval is adjusted. Still another example is that if the number of times the login request is initiated is even, the second time interval is adjusted.
[0050] In some embodiments, after calculating according to the first time interval to obtain a second time interval that satisfies the preset interval rule, the method further includes: if the second time interval is greater than or equal to a preset maximum time interval and the number of times the login request is initiated is less than a preset second number threshold, the maximum time interval is set as the second time interval; if the second time interval is greater than or equal to the maximum time interval and the number of times the login request is initiated is greater than or equal to the second number threshold, a random value is obtained, and calculations are performed based on the maximum time interval and the random value to set the calculation result as the second time interval.
[0051] In some embodiments, if the second time interval is greater than or equal to a preset maximum time interval, the maximum time interval is set as the second time interval.
[0052] In some embodiments, the value range of the maximum time interval is 8 - 15 minutes. For example, the maximum time interval is set to 10 minutes. In this way, it can be avoided that when the number of login failures is large, the second time interval is too large, resulting in too long a time for resending the login request.
[0053] In some embodiments, if the number of times the login request is initiated is greater than or equal to the second number threshold, a random value is obtained, and the first time interval corresponding to the second login request is adjusted according to the random value.
[0054] In some embodiments, if the random value is a time random value, the time random value is added to the first time interval corresponding to the second login request to adjust the first time interval; if the random value is a ratio random value, the first time interval corresponding to the second login request is scaled according to the ratio random value to adjust the first time interval.
[0055] Combined withFigure 4 As shown in the figure, the present application provides a method for determining a second time interval, including: Step S401, if the request result corresponding to the second login request is a login failure, obtain the number of times the login request is initiated; Step S402, determine whether the number of times the login request is initiated is greater than or equal to a first number threshold. If so, jump to step S403; if not, jump to step S404; Step S403, use the first time interval corresponding to the third login request as the interval difference, calculate the first time interval corresponding to the first login request according to the interval difference to obtain the second time interval, and jump to step S405; Step S404, set the second time interval according to a preset initial time interval, and jump to step S405; Step S405, determine whether the second time interval is odd. If so, jump to step S406; if not, jump to step S407; Step S406, adjust the second time interval according to a first scaling factor, and jump to step S407; Step S407, use the second login request as the new first login request, and use the second time interval as the first time interval corresponding to the second login request.
[0056] Optionally, the method further includes: if the first time interval corresponding to the first login request is greater than or equal to a preset maximum time interval, use the maximum time interval as the initiation time interval between the first login request and the second login request, initiate the second login request, and obtain the number of times the login request is initiated; if the number of times the login request is initiated is greater than or equal to a preset second number threshold, obtain a random value, adjust the first time interval corresponding to the second login request according to the random value, use the first time interval corresponding to the second login request as the initiation time interval between the second login request and the fourth login request, and initiate the fourth login request.
[0057] In combination with Figure 5 As shown in the figure, an embodiment of the present disclosure provides a user login method based on a time interval, including: Step S501, obtain the first time interval corresponding to the first login request; Step S502, determine whether the first time interval corresponding to the first login request is greater than or equal to the maximum time interval. If so, jump to step S503; if not, jump to step S504; Step S503, set the maximum time interval as the first time interval corresponding to the first login request, and jump to step S504; Step S504: After the time point associated with the first login request has passed the first time interval corresponding to the first login request on the user terminal, initiate a second login request. Step S505: Determine whether the number of times the login request is initiated is greater than or equal to the second threshold value. If so, jump to Step S506; if not, jump to Step S507. Step S506: Adjust the first time interval corresponding to the second login request according to the random value, and then jump to Step S507. Step S507: After the time point associated with the second login request has passed the first time interval corresponding to the second login request on the user terminal, trigger the user terminal to execute a new login request.
[0058] Optionally, taking the first time interval as the initiation time interval between the first login request and the second login request and initiating the second login request includes: obtaining a timer and initializing the timer count of the timer; triggering the timer to execute a comparison event according to a preset time period, where the comparison event includes comparing the timer count with the first time interval; if the timer count is greater than or equal to the first time interval, initiate the second login request; if the timer count is less than the first time interval, increment the timer count according to the preset time period.
[0059] Combined Figure 6 As shown, the present application provides a method for initiating a second login request, including: Step S601: In response to the user terminal initiating a login request for the first time, obtain a timer. Step S602: Initialize the timer count (loginCount) and the first time interval (loginFreqinterval). Step S603: Compare the timer count with the first time interval according to a preset time period. Wherein, the preset time period is 1s. Step S604: Determine whether the timer count is greater than or equal to the first time interval. If so, jump to Step S605; if not, jump to Step S608. Step S605: Trigger the user terminal to execute a login request. Step S606: Determine whether the request result is a successful login. If so, jump to Step S601; if not, jump to Step S607. Step S607: Update the first time interval, clear the timer count, and then jump to Step S603.
[0060] Step S608: Increase the timer count by the preset time period, and then jump to Step S603.
[0061] Optionally, the method further includes: if the number of user terminals is multiple, obtaining second time intervals respectively corresponding to the user terminals, where the user terminals are respectively used to initiate login requests; dividing the second time intervals with the same interval value into a group to obtain one or more interval groups corresponding to the interval values respectively, and taking any interval group as the target group; if the number of second time intervals in the target group is greater than or equal to a preset quantity threshold, randomly perturbing each of the second time intervals in the target group.
[0062] In some embodiments, if the number of user terminals is 100, where there are 50 second time intervals with an interval value of 6s, 30 second time intervals with an interval value of 10s, and 20 second time intervals with an interval value of 14s; the preset quantity threshold is 50, then randomly perturbing the second time intervals with an interval value of 6s respectively according to the perturbation rule; through experiments, in the above situation, the peak load of the cloud platform is reduced by 15%.
[0063] In some embodiments, the perturbation rule is characterized by formula (2): Formula (2) In formula (2), is the second time interval after random perturbation, is the second time interval before random perturbation, is a preset adjustment coefficient, and the value range of the preset adjustment coefficient is between 0.1 - 0.3, is a random number formula.
[0064] Optionally, after calculating the second time intervals that meet the preset interval rule according to the first time interval, the method further includes: obtaining the user priority corresponding to the user terminal, where the user priority is determined based on the user identity; adjusting the second time intervals according to the user priority, where there is a negative correlation between the user priority and the second time intervals.
[0065] In some embodiments, set the user identity, and the user priorities corresponding to the user identity from low to high include "ordinary terminal", "member terminal", and "administrator terminal" in sequence; attach the device ID to the login request of the T-Box, and the platform queries the database to obtain the associated user type, so as to adjust the second time intervals according to the different user priorities of the user types. For example, the second time interval corresponding to the "administrator terminal" is reduced by 40%, while the second time interval corresponding to the "member terminal" is reduced by 10%.
[0066] Combined Figure 7 As shown, the present application provides a user login system based on time intervals, including an acquisition module 701, an execution module 702, and a calculation module 703.
[0067] The obtaining module 701 is configured to obtain a first time interval corresponding to a first login request.
[0068] The obtaining module 701 is further configured to use the second login request as a new first login request, and use the second time interval as the first time interval corresponding to the second login request.
[0069] The execution module 702 is configured to use the first time interval as the initiation time interval between the first login request and the second login request, and initiate the second login request.
[0070] The calculation module 703 is configured to, if the request result corresponding to the second login request is a login failure, calculate according to the first time interval to obtain a second time interval that meets a preset interval rule, where the preset interval rule includes that the first time interval is less than the second time interval, and the interval difference between the first time interval and the second time interval is positively correlated with the number of initiation times of the login request.
[0071] By using the user login system based on time interval provided by this application, the second login request is initiated through the first time interval corresponding to the first login request, and when the request result corresponding to the second login request is a login failure, the second time interval corresponding to the second login request is calculated according to the first time interval, so that the first time interval is less than the second time interval, and the interval difference between the first time interval and the second time interval is positively correlated with the number of initiation times of the login request. Finally, the second time interval is used as the first time interval corresponding to the second login request to implement the retry of the next login request. In this way, compared with the traditional fixed interval retry mechanism, the interval difference between the first time interval and the second time interval is positively correlated with the number of initiation times of the login request, so that the growth rate of the second time interval is also continuously increasing, with a gentle growth in the early stage to avoid too long login waiting time, and an accelerated growth rate in the later stage, which can slow down the frequency of the user terminal with too many retry times to initiate login requests, thereby solving the problem of TSP system overload caused by a large number of T-Boxes executing login requests and improving the processing efficiency of login requests.
[0072] This application also provides a user terminal, including: a processor and a memory; the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory so that the user terminal executes the above method.
[0073] Figure 8 The structure diagram of the computer system of the user terminal suitable for implementing the embodiments of this application is shown. It should be noted that Figure 8 The shown computer system 800 of the user terminal is only an example and should not bring any limitation to the functions and usage scope of the embodiments of this application.
[0074] As shown Figure 8 in FIG. 800, a computer system 800 includes a Central Processing Unit (CPU) 801, which can perform various appropriate actions and processes according to a program stored in a Read-Only Memory (ROM) 802 or a program loaded from a storage section 808 into a Random Access Memory (RAM) 803, such as executing the method in the above embodiments. In the RAM 803, various programs and data required for system operations are also stored. The CPU 801, ROM 802, and RAM 803 are connected to each other via a bus 804. An Input / Output (I / O) interface 805 is also connected to the bus 804.
[0075] The following components are connected to the I / O interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including, for example, a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), etc. and a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed so that a computer program read from it can be installed into the storage section 808 as needed.
[0076] The user terminal disclosed in this embodiment includes a processor, a memory, a transceiver, and a communication interface. The memory and the communication interface are connected to the processor and the transceiver and complete communication with each other. The memory is used to store computer programs, the communication interface is used for communication, and the processor and the transceiver are used to run the computer programs so that the user terminal executes each step of the above method.
[0077] The above description and the accompanying drawings fully illustrate the embodiments of the present disclosure, enabling those skilled in the art to practice them. Other embodiments may include structural, logical, electrical, process, and other changes. The embodiments only represent possible variations. Unless explicitly required, the individual components and functions are optional, and the order of operations may vary. Some parts and sub-samples of some embodiments may be included in or replace parts and sub-samples of other embodiments. Moreover, the terms used in this application are only for describing the embodiments and do not limit the claims. As used in the description of the embodiments and the claims, unless the context clearly indicates otherwise, the singular forms "a", "an", and "the" are intended to also include the plural forms. Similarly, as used in this application, the term "and / or" refers to any and all possible combinations including one or more of the associated listed items. Additionally, when used in this application, the term "comprise" and its variants "comprises" and / or "comprising" etc. mean the presence of the stated sub-samples, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other sub-samples, wholes, steps, operations, elements, components, and / or groupings of these. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, or device comprising the element. Herein, each embodiment may focus on the differences from other embodiments, and the same or similar parts among the embodiments may be referred to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method parts disclosed in the embodiments, the relevant parts may refer to the description of the method parts.
[0078] Those skilled in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner may depend on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods for each specific application to achieve the described functions, but such implementation should not be considered to exceed the scope of this application. Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the above-described systems, devices, and units can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.
[0079] In the embodiments disclosed in this document, the disclosed methods, products (including but not limited to devices, equipment, etc.) can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of units can be merely a logical function division. In actual implementation, there can be other division methods. For example, multiple units or components can be combined or integrated into another system, or some sub-samples can be ignored or not executed. Additionally, the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of devices or units can be in electrical, mechanical, or other forms. The units described as separate components can be or can not be physically separated. The components shown as units can be or can not be physical units, that is, they can be located in one place or can be distributed to multiple network units. Some or all of the units can be selected according to actual needs to implement this embodiment. Additionally, in this application, each functional unit can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit.
[0080] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of the systems, methods, and computer program products according to this application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment, or a part of code, and the module, program segment, or part of code contains one or more executable instructions for implementing the specified logical function. In some alternative implementations, the functions marked in the boxes can occur in a different order than that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and sometimes they can also be executed in the reverse order, which can depend on the functions involved. In the descriptions corresponding to the flowcharts and block diagrams in the accompanying drawings, the operations or steps corresponding to different boxes can also occur in a different order than that disclosed in the description. Sometimes, there is no specific order between different operations or steps. For example, two consecutive operations or steps can actually be executed substantially in parallel, and sometimes they can also be executed in the reverse order, which can depend on the functions involved. Each box in the block diagram and / or flowchart, as well as the combination of boxes in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.
Claims
1. A user login method based on time intervals, characterized in that, Including: Obtain a first time interval corresponding to a first login request; Use the first time interval as the initiation time interval between the first login request and a second login request, and initiate the second login request; If the request result corresponding to the second login request is a login failure, calculate based on the first time interval to obtain a second time interval that satisfies a preset interval rule, where the preset interval rule includes that the first time interval is less than the second time interval, and the interval difference between the first time interval and the second time interval is positively correlated with the number of times the login request is initiated; Use the second login request as the new first login request, and use the second time interval as the first time interval corresponding to the second login request.
2. The method according to claim 1, characterized in that, Calculating based on the first time interval to obtain a second time interval that satisfies a preset interval rule includes: Obtain a third login request corresponding to the first login request in the order of request initiation, where the third login request is the login request one position before the first login request; Use the first time interval corresponding to the third login request as the interval difference, and calculate the first time interval corresponding to the first login request based on the interval difference to obtain a second time interval.
3. The method according to claim 1, characterized in that The method for determining the second time interval further includes: If the number of times the login request is initiated is less than the first number threshold, set the second time interval according to a preset initial time interval.
4. The method according to claim 1, characterized in that After calculating based on the first time interval to obtain a second time interval that satisfies a preset interval rule, the method further includes: Obtain a numerical determination rule, where the numerical determination rule includes parity determination and / or threshold interval determination; If the second time interval satisfies the numerical determination rule, adjust the second time interval according to a scaling factor.
5. The method according to claim 1, wherein The method further includes: If the first time interval corresponding to the first login request is greater than or equal to a preset maximum time interval, use the maximum time interval as the initiation time interval between the first login request and the second login request, initiate the second login request, and obtain the number of times the login request is initiated; If the number of times the login request is initiated is greater than or equal to a preset second number threshold, obtain a random value, and adjust the first time interval corresponding to the second login request according to the random value. Use the first time interval corresponding to the second login request as the initiation time interval between the second login request and a fourth login request, and initiate the fourth login request.
6. The method according to any one of claims 1 to 5, characterized in that, Using the first time interval as the initiation time interval between the first login request and the second login request, and initiating the second login request includes: Obtain a timer, and initialize the timer count of the timer; Trigger the timer to execute a comparison event according to a preset time period, where the comparison event includes comparing the timer count with the first time interval; If the timer count is greater than or equal to the first time interval, initiate the second login request; If the timer count is less than the first time interval, increment the timer count according to a preset time period.
7. The method according to any one of claims 1 to 5, characterized in that The method further includes: If there are multiple user terminals, obtaining second time intervals respectively corresponding to the user terminals, where the user terminals are respectively used to initiate login requests; By dividing the second time intervals with the same interval value into a group, obtaining one or more interval groups corresponding to the interval values respectively, and taking any interval group as the target group; If the number of second time intervals in the target group is greater than or equal to a preset quantity threshold, randomly perturbing each of the second time intervals in the target group.
8. The method according to any one of claims 1 to 5, characterized in that After calculating the second time interval that meets the preset interval rule according to the first time interval, the method further includes: Obtaining the user priority corresponding to the user terminal, where the user priority is determined based on the user identity; Adjusting the second time interval according to the user priority, where there is a negative correlation between the user priority and the second time interval.
9. A user login system based on time intervals, characterized in that, Including: An obtaining module, configured to obtain a first time interval corresponding to a first login request; An initiating module, configured to use the first time interval as the initiating time interval between the first login request and a second login request, and initiate the second login request; A calculating module, configured to, if the request result corresponding to the second login request is a login failure, calculate a second time interval that meets the preset interval rule according to the first time interval, where the preset interval rule includes that the first time interval is less than the second time interval, and the interval difference between the first time interval and the second time interval is positively correlated with the number of times the login request is initiated; The obtaining module is further configured to use the second login request as the new first login request, and use the second time interval as the first time interval corresponding to the second login request.
10. A user terminal, characterized in that, Including: A processor and a memory; The memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the user terminal executes the method according to any one of claims 1 to 8.