Method for enhancing service stability of electronic license system in high-concurrency environment

By building a service operation control system in the electronic certificate system, monitoring and pushing high-frequency data, combining access current limit and malicious access determination, the problem of insufficient system stability in high-concurrency environments is solved, and the system performance and security are significantly improved.

CN119031032APending Publication Date: 2024-11-26TRAFFIC MANAGEMENT RES INST OF THE MIN OF PUBLIC SECURITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411186856.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-28
Publication Date
2024-11-26

AI Technical Summary

Technical Problem

The electronic certificate system is not stable enough in a high concurrency environment, resulting in excessive consumption of server resources, affecting service performance and stability. In particular, in the cache query, massive certificate information query, real-time authenticity verification and other aspects during issuance. .

Method used

Build a service operation management system in a distributed network environment, including service management modules and resource monitoring modules. By monitoring application services and resource usage in real time, actively push high-frequency data to the local memory of the application service, reduce database access frequency, and access through access Current limiting and malicious access determination mechanisms ensure system stability.

Benefits of technology

It effectively improves the stability and performance of the electronic certificate system in a high concurrency environment, reduces the system load, ensures the real-time and security of services, and avoids the impact of resource overload and malicious attacks on the system caused by high-frequency access.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119031032A_ABST
    Figure CN119031032A_ABST
Patent Text Reader

Abstract

The invention provides a method for enhancing the service stability of an electronic license system in a high-concurrency environment, which can actively detect factors influencing the stability in the high-concurrency environment and effectively improve the stable operation capability of the electronic license system. A service operation management and control system is constructed in a distributed network and comprises a service management module and a resource monitoring module, registration and online and offline of an application service and a resource monitoring service are monitored at the same time through the service management module, and high-frequency data of the application service are monitored through the resource monitoring module; the high-frequency data corresponding to the application service is actively pushed to the local memory of the application service, the high-frequency interface of the application service is monitored, the rate response is checked through a thread queue, and the system stability during high concurrency of system access is ensured by combining a manual active high-frequency data pushing method, a malicious access judging and processing method and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing control, and in particular to a method for enhancing the service stability of an electronic certificate system in a high-concurrency environment. Background Art

[0002] In recent years, with the in-depth promotion of "Internet + Government Services", relying on the national integrated government service platform, electronic certificates are increasingly widely used. Compared with traditional paper certificates, electronic certificates have obvious advantages. They are easy to carry, can carry dynamic information, and support real-time data updates. Existing electronic certificate service systems, such as Figure 1 As shown. Department business systems generally refer to systems deployed on the intranet to handle business, which are usually operated by staff and are also the source of electronic certificate source data; department business systems will update the information of electronic certificates based on the actual application of electronic certificates. For example, electronic certificates with violation points or revocation will cause the update of electronic certificates; after the data is updated, it will be sent to the electronic certificate service system. The electronic certificate service system provides services such as electronic certificate data generation, issuance and download. The electronic certificate service system generates electronic certificate data based on the user ID, and then forwards it to the government service system, which pushes it to the terminal application according to the classification of electronic certificates. Terminal applications include applications carried by certificate holders, such as: electronic certificate APP, WeChat applets for electronic certificates, etc., as well as various types of government service APPs and other applications that query electronic certificate information.

[0003] However, the number of users of electronic certificates is in the hundreds of millions, which is a huge number. An electronic certificate may be updated multiple times every day for different reasons. For example, an electronic certificate may be updated multiple times on the same day due to accident records, violation points deductions, etc. Electronic certificates must display the latest data in real time, which means that the electronic certificate service system has to process a large amount of electronic certificate data in parallel every day. The electronic certificate system needs to handle a large number of concurrent requests at the same time, which is a typical high-concurrency environment. It is necessary to ensure that the system can effectively handle concurrent requests and maintain stable performance. The electronic certificate system faces stability challenges in many aspects, such as cache query during the issuance process, query and push of massive certificate information, real-time authenticity verification requests from different government systems, and access by malicious crawlers. These unstable factors consume server resources, affect the efficiency of service calls and system concurrency performance, and further affect the stability of the service. Summary of the invention

[0004] In order to solve the problem of insufficient operating stability of electronic certificate systems in high-concurrency environments in the prior art, the present invention provides a method for enhancing the service stability of electronic certificate systems in high-concurrency environments, which can actively detect factors affecting stability in high-concurrency environments and effectively improve the ability of electronic certificate systems to operate stably.

[0005] The technical solution of the present invention is as follows: a method for enhancing the service stability of an electronic certificate system in a high-concurrency environment, characterized in that it comprises the following steps: S1: Build a service operation control system based on a distributed network environment; The service operation control system includes a service management module and a resource monitoring module; The service management module provides service registration and online and offline monitoring services; The resource monitoring module provides real-time summary and calculation services of resource usage; S2: Each independent service in the electronic certificate system is recorded as: application service; Building application servers in a distributed network environment, wherein one or more application services are set in each application server; application services of the same type are set in one or more application servers; After each of the application services goes online, it sends a registration request to the service management module. After the service management module responds with a registration success message, it indicates that the application service registration is successful; S3: After the application service is successfully registered, a resource monitoring service list is obtained from the service management module, and a corresponding resource monitoring service instance is found from the resource monitoring service list according to its own type; All the application services of the same type use the same resource monitoring service instance; the same resource monitoring service instance provides service monitoring functions for different types of application services; S4: The resource monitoring service provided by the resource monitoring module is set on different servers in different distributed network environments. After each resource monitoring service goes online, it sends a registration request to the service management module. After successful registration, it obtains an application service list from the service management module and establishes a communication connection with its own application service. S5: The application service reports its own data usage information within a period of M1 milliseconds to the resource monitoring service in batches according to a preset data reporting period of M1 milliseconds; The data usage information includes: data key, usage times corresponding to the data key and reporting time; The data key includes: application name, type name, data name; The application name is a name corresponding to the application service; The service type name of the electronic certificate with the type name of application service; The data name is the name of the data number or value corresponding to the application service; S6: After the resource monitoring service receives the data usage information sent by the application service, it determines the high-frequency data corresponding to the application service based on the data usage information; The specific judgment method of the high-frequency data includes the following steps a1: Construct a counting task for the data key, set the observation period to M1 milliseconds; Set the high-frequency threshold to M2 times; a2: Query the usage frequency of the received data key within M1 milliseconds, and accumulate to get the value Num; a3: Compare Num and M2; If Num < M2, loop and execute steps a1~a3; Otherwise, execute step a4; a4: The resource monitoring service marks the data corresponding to the data key as high-frequency data; S7: The resource monitoring module actively pushes the corresponding high-frequency data for each application service; After receiving the high-frequency data pushed by the resource calculation module, the application service first caches the data in the local memory and associates the reading method, without having to retrieve it from the database.

[0006] Its further feature is that: The service registration management method adopted by the service management module includes the following steps: f1: Service registration. When the application service starts, it registers its basic information to the service management module through an HTTP request or other protocols; After the service instance starts, it sends the service information to the service management module by calling the registration interface of the service management module; f2: Heartbeat sending. The service instance registered to the service management module will regularly send a heartbeat signal to the service management module to indicate that it is still active and available; f3: Heartbeat reception and processing. The service management module receives the heartbeat signal of the service instance and updates the health status of the service instance; The service management module has a heartbeat reception interface for receiving the heartbeat request of the service instance; After receiving the heartbeat, the service management module will update the last heartbeat time of the service instance and update its health status as needed; If the service instance does not send a heartbeat for a continuous period of time, the service management module will mark it as unhealthy and remove it from the service list, or trigger the corresponding fault handling mechanism; f4: Heartbeat monitoring and fault handling. The service management module will regularly check the heartbeat status of the service instance and perform fault handling on the service instance that has not sent a heartbeat for a long time; f5: Heartbeat recovery and re-registration. If the service instance is temporarily unable to send heartbeats for some reason, it will resend heartbeats to the service management module and resume registration when the problem is solved. It also includes: manually pushing high-frequency data, specifically including the following steps: b1: Determine the high-frequency data that needs to be specified; b2: storing the specified high-frequency data push rules in the resource monitoring module; Push rules include: specified high-frequency data and applicable application services; b3: the resource monitoring module obtains the application service list from the service management module, and actively pushes the specified high-frequency cache resources to the corresponding application service; The application service also needs to upload the log data of the interface call to the resource monitoring service; The log data includes: interface key and interface access time; The interface key includes: application name and interface name; The application name is a name corresponding to the application service; The interface name is the interface name of the application service; The interface access time is the time when the application service interface is called; The resource monitoring service also provides a service for determining high-frequency interfaces and taking access flow limiting measures; specifically, the following steps are included: e1: Build a count list for each of the interface keys, set the observation period to N1 milliseconds, and set the high-frequency threshold to N2 times; e2: Initialize the count list to be empty; set the timer T = CurrentTime(), where CurrentTime() is the current time; e3: The resource monitoring module receives the data log data; e4: putting the received log data with the same interface key into the counting list; and all the log data with the same interface key received within T+N1 milliseconds are put into the same counting list; e5: Count the number Num1 of log data corresponding to the interface key in the counting list within T+ N1 milliseconds; and compare Num1 with N2; If Num1>N2, the interface corresponding to the interface key is determined to be a high-frequency interface, and step e6 is executed; Otherwise, loop through steps e3 to e5; e6: the resource monitoring service determines that the caller corresponding to the high-frequency interface accesses too frequently, and marks the interface name as a current-limited interface; e7: the resource monitoring service actively pushes the corresponding current limiting interface for each application service; e8: After receiving the current limiting interface pushed by the resource monitoring service, the application service puts the received request of the current limiting interface into a delay queue for processing, processes the requests entering the system at a preset constant rate, and no longer processes them in real time; e9: the resource monitoring service monitors the access to the current limiting interface in real time, and once the access volume to the current limiting interface decreases, it actively pushes and informs the electronic certificate service to release the current limiting processing logic; It also includes: a method for determining and processing malicious access to resources, which specifically includes the following steps: c1: Setting malicious access monitoring rules, including: the name of the application service to which the rules apply, the malicious access judgment rules and the processing method for the malicious access object; The malicious access judgment rule is: if the resource is accessed by the access object more than P2 times within P1 milliseconds, the corresponding access object is judged as a malicious access object; c2: storing the malicious access monitoring rules in the service management module; the service management module synchronizes the malicious access monitoring rules to the resource monitoring module; c3: According to the name of the application service of the applicable rule, the resource monitoring module judges its resources according to the malicious access judgment rule, and if there are resources that meet the conditions, it is judged as malicious access; c4: the resource monitoring module pushes the malicious access information to the corresponding application service; c5: the application service intercepts subsequent service requests of the IP according to the malicious access information; It also includes: blacklist access restriction function, which specifically includes the following steps: d1: Enter the blacklist user list and access restriction rules into the service management module; The blacklist user list includes: user ID and IP; Each item in the blacklist user list has corresponding access restriction content in the access restriction rule; d2: The resource monitoring module pushes the blacklist user list and processing rules to all application services; d3: After receiving the blacklist user list, once the application service finds a user in the table in the service request it receives, it processes it according to the corresponding access restriction rule.

[0007] The present application provides a method for enhancing the service stability of an electronic certificate system in a high-concurrency environment. By constructing a service operation control system in a distributed network, the system includes a service management module and a resource monitoring module, which together constitute a solid defense line for the distributed system in a high-concurrency environment. The service management module simultaneously monitors the registration and online and offline of application services and resource monitoring services to ensure stable service operation; the resource monitoring module monitors the high-frequency data of application services, and actively pushes the corresponding high-frequency data to the local memory of application services for application services, thereby reducing the frequency of application services accessing caches and databases; the high-frequency interface of application services is monitored, and the thread queue responds at an approved rate to reduce the impact of high-frequency access on system stability, thereby playing a role in peak reduction and valley filling. At the same time, combined with the method of manually actively pushing high-frequency data, malicious access judgment and processing methods ensure the stability of the system when the system accesses are highly concurrent. In this method, by actively detecting the unstable factors of application services and making corresponding processing, the system is provided with comprehensive flow control, security detection and defense capabilities, thereby ensuring the stable operation and high security of the system in a high-concurrency environment. BRIEF DESCRIPTION OF THE DRAWINGS

[0008] Figure 1 It is a schematic diagram of the structure of the electronic certificate service system in the prior art; Figure 2 This is a schematic diagram of the system structure of the service management and control system in this application; Figure 3 This is the data flow diagram of the service management module in this application; Figure 4 Actively push high-frequency data processes for humans; Figure 5 It is a flow chart for high-frequency data determination; Figure 6 This is a high-frequency interface determination flow chart. DETAILED DESCRIPTION

[0009] like Figure 2~Figure 6 As shown, the present application includes a method for enhancing the service stability of an electronic certificate system in a high-concurrency environment, characterized in that it includes the following steps: S1: Figure 2 As shown, a service operation control system is built based on a distributed network environment; The service operation control system includes a service management module and a resource monitoring module; The service management module provides service registration and online and offline monitoring services; The resource monitoring module provides real-time summary calculation services of resource usage.

[0010] S2: Each independent service in the electronic certificate system is recorded as: application service; Build application servers in a distributed network environment, set up one or more application services in each application server; the same type of application services are set up in one or more application servers; After each application service goes online, it sends a registration request to the service management module. After the service management module responds with a registration success message, it indicates that the application service has been successfully registered.

[0011] S3: After the application service is successfully registered, obtain the resource monitoring service list from the service management module, and find the corresponding resource monitoring service instance from the resource monitoring service list according to its type; All application services of the same type use the same resource monitoring service instance; the same resource monitoring service instance provides service monitoring functions for different types of application services; S4: The resource monitoring service provided by the resource monitoring module is set on different servers in different distributed network environments. After each resource monitoring service goes online, it sends a registration request to the service management module. After successful registration, it obtains the application service list from the service management module and establishes a communication connection with its own application service. In specific applications, the service operation control system is deployed in the distributed network center, which mainly includes registration management services and resource monitoring services, providing service registration and discovery, load balancing, fault diagnosis and governance and other functions. The application service is registered with the service management module as a third-party application. When working, it is necessary to regularly report the service status and online and offline actions to the service management module, and receive push data from the service management module in real time. The resource monitoring module provides resource monitoring and real-time calculation functions for data usage. It is registered with the service management module and needs to regularly report the service status and online and offline actions to the service management module when working. In order to meet the use in a high-concurrency environment, the application service, resource monitoring module and service management module designed in this application all support multi-instance cluster deployment.

[0012] The service registration management method adopted by the service management module monitors the health status of application services in real time, including the following steps.

[0013] f1: Service registration. When the service instance (microservice) of the application service is started, its basic information (such as service name, IP address, port, etc.) will be registered with the service management module through HTTP request or other protocols. After the service instance is started, the service information is sent to the service management module by calling the registration interface of the service management module. The registration information usually includes the service name, IP, port, weight, etc.

[0014] f2: Heartbeat sending. The service instance registered with the service management module will periodically send heartbeat signals to the service management module to indicate that it is still active and available. Heartbeat sending is usually implemented through a scheduled task, such as using Spring's @Scheduled annotation or Java's ScheduledExecutorService. The heartbeat information is encapsulated into a task (such as HeartBeatTask) and then handed over to the scheduled thread pool for execution. The heartbeat interval can be fixed or a variable frequency strategy can be adopted, that is, the interval of the next heartbeat is dynamically adjusted according to the result of the previous heartbeat. When the heartbeat is sent, the service instance will send its own status information (such as health status, performance indicators, etc.) to the service management module.

[0015] f3: Heartbeat reception and processing, the service management module receives the heartbeat signal of the service instance and updates the health status of the service instance. The service management module has a heartbeat reception interface for receiving the heartbeat request of the service instance. After receiving the heartbeat, the service management module will update the last heartbeat time of the service instance and update its health status as needed. If the service instance does not send a heartbeat for a continuous period of time, the service management module will mark it as unhealthy and remove it from the service list, or trigger the corresponding fault handling mechanism.

[0016] f4: Heartbeat monitoring and fault handling. The service management module will regularly check the heartbeat status of the service instance and handle the faults of the service instance that has not sent heartbeats for a long time. The service management module can check the heartbeat status of the service instance through a scheduled task (such as Nacos's ClientBeatCheckTask). If the service instance heartbeat times out, the service management module will delete it from the service list and notify other service instances or system administrators through event notifications or message push. Fault handling mechanisms can include restarting the service instance, redeploying the service, or switching traffic to the backup instance.

[0017] f5: Heartbeat recovery and re-registration. If the service instance is temporarily unable to send heartbeats for some reason (such as network problems, service restart, etc.), when the problem is solved, it will resend heartbeats to the service management module and resume registration. After the service instance is restored, it will restart the heartbeat sending task and try to re-register with the service monitoring module. After receiving the new heartbeat, the service management module will update the status of the service instance and add it back to the service list.

[0018] The heartbeat monitoring function of the service management module has a certain degree of flexibility to support the needs of different scenarios. Allow service instances to customize heartbeat intervals and timeouts. Support differentiation of heartbeat monitoring policies for non-temporary instances and temporary instances. Allow the service monitoring module to dynamically adjust heartbeat monitoring parameters through configuration or API. Through the above steps, the service management module can effectively implement the service heartbeat monitoring function to ensure the availability and stability of service instances.

[0019] During the use of the electronic certificate system, high-frequency data will be used in multiple links, such as the translation of certificate status and certificate type during the issuance and update process, and the download and verification of electronic certificates. The mainstream approach in the existing technology is to query from the database and load into the distributed cache. Each query to the database or cache consumes a large amount of read and write IO resources and network resources. High-frequency access to these resources can easily cause a decrease in the system's concurrency capability and RTT (request return time) jitter, which can easily affect the stability of the system.

[0020] This method uses the following high-frequency data active push method to push high-frequency data recognition to the server local memory to improve data reading efficiency. Figure 3 As shown, during the operation of the application service, the resource monitoring module obtains the list of resource monitoring modules from the service management module, and calls the resource monitoring module to report data usage information in real time. During the operation, the resource monitoring module obtains the list of application services from the service management module, and calls the application service to push high-frequency data to the application server in real time. The resource monitoring module actively pushes high-frequency data to the application service through real-time aggregation and calculation, thereby realizing active management of cached data. The low-frequency data used by the application service during operation is still obtained by querying the database in the existing way. In this method, the acquisition methods of low-frequency data and high-frequency data used in the application service are designed separately to meet the needs of the multi-use and high-concurrency environment of the electronic certificate system.

[0021] S5: Application services provide services for electronic certificates according to system allocation, and the data used in the service is retrieved from the database; At the same time, the application service reports its own data usage information within the M1 millisecond period to the resource monitoring service in batches according to the preset data reporting cycle M1 millisecond; Data usage information includes: data key, usage count corresponding to the data key, and reporting time; The data key includes: application name AppName, type name Type, data name Val; The application name is the name of the application service, such as: electronic certificate issuance service, electronic certificate download service, electronic certificate encryption service; The high-frequency data type name of the application service type, such as: driver's license status, vehicle license status; The data name is the data number or value name corresponding to the application service, such as: data number 10000000001, value name nyzl.

[0022] In actual application, the three are concatenated to obtain a data key in the format of AppName#Type#Val. The reporting frequency of the application service counts the usage frequency of the data corresponding to the same data key within the M1 millisecond cycle; after the M1 millisecond window cycle ends, the usage data frequency corresponding to the local data key is uploaded.

[0023] S6: After the resource monitoring service receives the data usage information sent by the application service, it determines the high-frequency data corresponding to the application service based on the data usage information; as Figure 5 shown, the specific judgment method of high-frequency data includes the following steps.

[0024] a1: Construct a counting task for the data key, set the observation period to M1 milliseconds; set the high-frequency threshold to M2 times; In this embodiment, M1 is set to 1000 and M2 is set to 100; a2: Query the usage frequency of the data key received within M1 milliseconds, and accumulate to get the value Num; a3: Compare Num and M2; If Num < M2, loop through steps a1~a3; Otherwise, execute step a4; a4: The resource monitoring service marks the data as high-frequency data.

[0025] S7: The resource monitoring module actively pushes the corresponding high-frequency data for each application service; After the application service receives the high-frequency data pushed by the resource calculation module, it first caches the data in the local memory and associates the reading method, and there is no need to retrieve it from the database again. In actual application, the resource monitoring module monitors the high-frequency data in real time. Once the high-frequency data changes, it is actively pushed to the corresponding application service.

[0026] In actual application, it is also possible to configure the high-frequency data and processing rules that may be involved before or during the operation of the application service. The process of the manual editing method of the caching rule specifically includes the following steps.

[0027] b1: Manually determine the high-frequency data that needs to be specified; b2: Store the push rule of the specified high-frequency data on the resource monitoring module; The push rule includes: the specified high-frequency data and the applicable application service; b3: The resource monitoring module obtains the application service list from the service management module and actively pushes the specified high-frequency data to the corresponding application service. After the application service goes online, it receives the high-frequency data pushed by the resource monitoring module in real time and caches it in the local memory.

[0028] This method of manually specifying and pushing can preheat resources in advance and prevent subsequent high-frequency access from competing for system resources.

[0029] In order to ensure that the electronic certificate system can maintain stable operation and avoid resource exhaustion when a large number of requests are pouring in, while ensuring service quality and response speed, and realizing reasonable allocation and fairness of resources, this method adopts the following access flow limiting method and processing, which specifically includes the following steps.

[0030] The application service also needs to upload the log data of the interface call to the resource monitoring service; Log data includes: interface key and interface access time; The interface key includes: application name and interface name; The application name is the name of the application service; for example: electronic certificate issuance service, electronic certificate download service, electronic certificate encryption service; The interface name is the interface name of the application service; for example: electronic certificate issuance interface, electronic certificate download interface, electronic certificate encryption interface.

[0031] The interface access time is the time when the application service interface is called.

[0032] After receiving the log data sent by the application service, the resource monitoring module determines the access load of the application service interface based on the log data, and then determines the high-frequency interface and takes the access flow limiting service; Figure 6 As shown, the specific steps include: e1: Build a count list for each interface key, set the observation period to N1 milliseconds, and set the high-frequency threshold to N2 times; In this embodiment, N1 is set to 1000 and N2 is set to 500; e2: Initialize the count list to be empty; set the timer T = CurrentTime(), where CurrentTime() is the current time; e3: Resource monitoring module receives data log data; e4: Put the received log data with the same interface key into the counting list; and put the log data with the same interface key received within T+N1 milliseconds into the same counting list; e5: Count the number of log data Num1 corresponding to the interface key in the counting list within T+ N1 milliseconds; and compare Num1 with N2; If Num1>N2, the interface key is determined to be a high-frequency interface and step e6 is executed; Otherwise, loop through steps e3 to e5; e6: The resource monitoring service determines that the caller corresponding to the high-frequency interface accesses too frequently, and marks the interface name as a current-limited interface; e7: The resource monitoring service actively pushes the corresponding current limiting interface for each application service; e8: After receiving the current limiting interface pushed by the resource monitoring service, the application service puts the received current limiting interface request into the delay queue for processing, and processes the requests entering the system at a preset constant rate instead of real-time processing, so as to actively discover high-frequency interfaces and reduce the system load; e9: The resource monitoring service monitors the access to the current-limiting interface in real time. Once the access volume to the current-limiting interface decreases, it will proactively push a notification to the electronic certificate service to lift the current-limiting processing logic.

[0033] The detection frequency and determination method in this method include but are not limited to the above methods. The following sliding window detection method can also be used. On the log sequence of interface calls, a sliding window is constructed. The window size is M milliseconds, and the sliding step is N milliseconds. The interface call frequency is detected on the log sequence by sliding. The interface call frequency is more flexible and efficient. M and N are dynamically adjustable. In an optional embodiment, M is 1000 and N is 200.

[0034] The current limiting method in this method sets a delayed request queue to process requests entering the system at a constant rate, effectively avoiding the impact of sudden traffic on the system. This method can smooth traffic fluctuations, ensure that system resources are evenly utilized within a controllable range, prevent service denial or performance degradation caused by resource overload, and thus ensure the stable operation of the system in a high-concurrency environment.

[0035] High-frequency interfaces are accessed simultaneously due to business needs in actual business, which in turn causes excessive system load. At the same time, in actual applications, there will also be some non-compliant malicious access, such as illegal crawlers and other tools. In order to identify malicious access interfaces, this method also includes: resource malicious access determination method and processing, specifically including the following steps: c1: Set malicious access monitoring rules, including: the name of the application service to which the rules apply, the malicious access judgment rules, and the method of handling malicious access objects; The malicious access judgment rule is: if a resource is accessed by an access object more than P2 times within P1 milliseconds, the corresponding access object is judged as a malicious access object; in this embodiment, P1 is set to 1000 and P2 is set to 2; in actual applications, manual operations, such as clicking on a page, cannot be repeated more than once within 1000 milliseconds. If the frequency is detected to be too high, it can be judged as an abnormality.

[0036] c2: store the malicious access monitoring rules in the service management module; the service management module synchronizes the malicious access monitoring rules to the resource monitoring module; c3: According to the name of the application service that is subject to the applicable rules, the resource monitoring module judges its resources according to the malicious access judgment rules. If there are resources that meet the conditions, it is judged as malicious access; c4: The resource monitoring module pushes malicious access information to the corresponding application service; c5: The application service intercepts subsequent service requests from the IP based on the malicious access information.

[0037] The resource malicious access detection mechanism set in this method helps the system respond quickly and take corresponding measures to block malicious traffic to prevent it from causing further damage to the system. By reducing the occupation of system resources by malicious access, the access experience and service quality of legitimate users are guaranteed.

[0038] In order to ensure the security and stability of the system, prevent known bad users, IP addresses or behavior patterns from accessing system resources, effectively reduce the risk of malicious attacks, abuse of services and data leakage, and protect the integrity of user information and system resources. The method also includes: blacklist access restriction function, which specifically includes the following steps.

[0039] d1: Enter the blacklist user list and access restriction rules into the service management module; The blacklist user list includes: user ID and IP; Each item in the blacklist user list has corresponding access restriction content in the access restriction rules; d2: The resource monitoring module pushes the blacklist user list and processing rules to all application services; d3: After the application service receives the blacklist user list, once it finds a user in the table in the service request it receives, it will process it according to the corresponding access restriction rules.

[0040] The blacklist access restriction function in this method automatically rejects any access request from the blacklist. This immediate restriction measure can not only effectively prevent the further spread of malicious access, but also build a solid line of defense for system security. By continuously updating and maintaining the blacklist, the system can continuously improve its own defense capabilities and ensure that it can still maintain a high degree of stability and security in a high-concurrency environment.

[0041] The technical solution in this application aims to improve the service stability of the electronic certificate system in a high-concurrency environment. The core of the method is to build a service operation control system in a distributed network. The system integrates a service management module, which helps to avoid service interruptions and ensure business continuity by continuously monitoring the health status of the service. Optimize resource allocation. By monitoring the use of services, you can better understand resource requirements and service loads. Resource monitoring module, which can actively identify and push high-frequency data required by each application service. Through the active push mechanism, application services reduce the number of direct access to the database, reduce system load, alleviate communication bottlenecks caused by high-frequency data, and enhance the real-time nature of data updates. Through the high-frequency data active push mechanism, high-frequency access data is successfully identified and cached. This strategy greatly optimizes the utilization of the local cache, so that more than half of the total application access volume is directly read through the local cache, significantly reducing the dependence on remote cache services such as Redis, greatly speeding up data access, and significantly improving the overall performance and responsiveness of the system. In order to effectively suppress traffic fluctuations, this method introduces an access flow limiting strategy, which uses a delayed request queue to process requests at a constant rate, alleviates the impact of sudden traffic on the system, ensures the balanced allocation of system resources, prevents service interruptions or performance degradation caused by resource overload, and ensures the stable operation of the system in high-concurrency scenarios. In addition, to enhance system security, this method also integrates a resource malicious access detection mechanism, enabling the system to identify and respond to potential malicious traffic, and reduce its potential damage to the system through timely blocking measures. It also integrates a blacklist access restriction function, which automatically intercepts access requests from the blacklist, effectively curbs the spread of malicious access, and adds a line of defense for system security. By regularly updating and maintaining the blacklist, the system can continuously improve its defense capabilities and ensure that it remains highly stable and secure in a high-concurrency environment.

[0042] In summary, the method proposed in this application provides comprehensive flow control, security detection and defense capabilities for the electronic certificate system in a high-concurrency environment through a series of mutually complementary and synergistic mechanisms, which together constitute a solid line of defense for the distributed system in a high-concurrency environment and ensure the stable operation and high security of the system.

Claims

1. A method for enhancing the service stability of an electronic certificate system in a high-concurrency environment, characterized in that: It includes the following steps: S1: Based on the distributed network environment, construct a service operation control system; The service operation control system includes a service management module and a resource monitoring module; The service management module provides service registration and online / offline monitoring services; The resource monitoring module provides real-time summary calculation services for resource usage; S2: Denote each independent service in the electronic certificate system as: application service; Build application servers in the distributed network environment, and set one or more of the application services in each application server; The application services of the same type are set in one or more application servers; After each application service goes online, it sends a registration request to the service management module respectively. After the service management module responds with a registration success message, it indicates that the application service registration is successful; S3: After the application service registration is successful, obtain the resource monitoring service list from the service management module, and find the corresponding resource monitoring service instance according to its own type from the resource monitoring service list; All application services of the same type use the same resource monitoring service instance; The same resource monitoring service instance provides service monitoring functions for application services of different types; S4: The resource monitoring services provided by the resource monitoring module are set on different servers in different distributed network environments. After each resource monitoring service goes online, it sends a registration request to the service management module respectively. After successful registration, it obtains the application service list from the service management module and establishes a communication connection with its own application service; S5: The application service reports its own data usage information in batches to the resource monitoring service according to the preset data reporting period of M1 milliseconds during the M1 milliseconds; The data usage information includes: data key, the usage times corresponding to the data key, and the reporting time; The data key includes: application name, type name, data name; The application name is the name corresponding to the application service; The type name is the service type name of the electronic certificate of the application service; The data name is the data number or value name corresponding to the application service; S6: After the resource monitoring service receives the data usage information sent by the application service, determine the high-frequency data corresponding to the application service based on the data usage information; The specific judgment method for the high-frequency data includes the following steps a1: Construct a counting task for the data key, set the observation period to M1 milliseconds; Set the high-frequency threshold to M2 times; a2: Query the usage frequency of the received data key within M1 milliseconds, and accumulate to get the value Num; a3: Compare Num and M2; If Num < M2, loop and execute steps a1~a3; Otherwise, execute step a4; a4: The resource monitoring service marks the data corresponding to the data key as high-frequency data; S7: The resource monitoring module actively pushes the corresponding high-frequency data for each application service; After receiving the high-frequency data pushed by the resource calculation module, the application service first caches the data into the local memory and associates the reading method without searching the database again.

2. A method for enhancing the service stability of an electronic certificate system in a high-concurrency environment according to claim 1, characterized in that: The service registration management method adopted by the service management module comprises the following steps: f1: Service registration: When the application service is started, its basic information is registered to the service management module through HTTP request or other protocols; After the service instance is started, the service information is sent to the service management module by calling the registration interface of the service management module; f2: Heartbeat sending. The service instance registered with the service management module will periodically send a heartbeat signal to the service management module to indicate that it is still active and available. f3: Heartbeat reception and processing, the service management module receives the heartbeat signal of the service instance and updates the health status of the service instance; the service management module has a heartbeat reception interface for receiving the heartbeat request of the service instance; After receiving the heartbeat, the service management module will update the last heartbeat time of the service instance and update its health status as needed; if the service instance does not send a heartbeat for a continuous period of time, the service management module will mark it as unhealthy and remove it from the service list, or trigger the corresponding fault handling mechanism; f4: Heartbeat monitoring and fault handling. The service management module will regularly check the heartbeat status of the service instance and handle the faults of the service instance that has not sent heartbeats for a long time. f5: Heartbeat recovery and re-registration. If the service instance is temporarily unable to send heartbeats for some reason, it will resend heartbeats to the service management module and resume registration when the problem is resolved.

3. According to claim 1, a method for enhancing the service stability of an electronic certificate system in a high-concurrency environment is characterized by: It also includes: manually pushing high-frequency data, specifically including the following steps: b1: Determine the high-frequency data that needs to be specified; b2: storing the specified high-frequency data push rules in the resource monitoring module; Push rules include: specified high-frequency data and applicable application services; b3: The resource monitoring module obtains the application service list from the service management module, and actively pushes the specified high-frequency cache resources to the corresponding application services.

4. According to claim 1, a method for enhancing the service stability of an electronic certificate system in a high-concurrency environment is characterized by: The application service also needs to upload the log data of the interface call to the resource monitoring service; The log data includes: interface key and interface access time; The interface key includes: application name and interface name; The application name is a name corresponding to the application service; The interface name is the interface name of the application service; The interface access time is the time when the application service interface is called.

5. A method for enhancing the service stability of an electronic certificate system in a high-concurrency environment according to claim 4, characterized in that: The resource monitoring service also provides a service for determining high-frequency interfaces and taking access flow limiting measures; specifically, the following steps are included: e1: Build a count list for each of the interface keys, set the observation period to N1 milliseconds, and set the high-frequency threshold to N2 times; e2: Initialize the count list to be empty; set the timer T = CurrentTime(), where CurrentTime() is the current time; e3: The resource monitoring module receives the data log data; e4: the received log data with the same interface key is put into the counting list; and the log data with the same interface key received within T+N1 milliseconds are all put into the same counting list; e5: Count the number Num1 of log data corresponding to the interface key in the counting list within T+ N1 milliseconds; and compare Num1 with N2; If Num1>N2, the interface corresponding to the interface key is determined to be a high-frequency interface, and step e6 is executed; Otherwise, loop through steps e3 to e5; e6: the resource monitoring service determines that the caller corresponding to the high-frequency interface accesses too frequently, and marks the interface name as a current-limited interface; e7: the resource monitoring service actively pushes the corresponding current limiting interface for each application service; e8: After receiving the current limiting interface pushed by the resource monitoring service, the application service puts the received request of the current limiting interface into a delay queue for processing, processes the requests entering the system at a preset constant rate, and no longer processes them in real time; e9: The resource monitoring service monitors the access to the current limiting interface in real time. Once the access volume to the current limiting interface decreases, the resource monitoring service proactively pushes a notification to the electronic certificate service to release the current limiting processing logic.

6. According to claim 1, a method for enhancing the service stability of an electronic certificate system in a high-concurrency environment is characterized by: It also includes: a method for determining and processing malicious access to resources, which specifically includes the following steps: c1: Setting malicious access monitoring rules, including: the name of the application service to which the rules apply, the malicious access judgment rules and the processing method for the malicious access object; The malicious access judgment rule is: if the resource is accessed by the access object more than P2 times within P1 milliseconds, the corresponding access object is judged as a malicious access object; c2: storing the malicious access monitoring rules in the service management module; the service management module synchronizes the malicious access monitoring rules to the resource monitoring module; c3: According to the name of the application service of the applicable rule, the resource monitoring module judges its resources according to the malicious access judgment rule, and if there are resources that meet the conditions, it is judged as malicious access; c4: the resource monitoring module pushes the malicious access information to the corresponding application service; c5: The application service intercepts subsequent service requests of the IP according to the malicious access information.

7. According to claim 1, a method for enhancing the service stability of an electronic certificate system in a high-concurrency environment is characterized by: It also includes: blacklist access restriction function, which specifically includes the following steps: d1: Enter the blacklist user list and access restriction rules into the service management module; The blacklist user list includes: user ID and IP; Each item in the blacklist user list has corresponding access restriction content in the access restriction rule; d2: The resource monitoring module pushes the blacklist user list and processing rules to all application services; d3: After receiving the blacklist user list, once the application service finds a user in the table in the service request it receives, it processes it according to the corresponding access restriction rule.