Method, device, medium and electronic equipment for analyzing server business
By establishing a self-learning mechanism in the video surveillance system, statistically analyzing user behavior and system pressure by time period, and optimizing resource allocation strategies, we solved the data storage and business pressure problems of big data servers, and improved the server's operating efficiency and user experience.
Patent Information
- Application Number
- CN202011551263.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-24
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2040-12-24
AI Technical Summary
In video surveillance systems, the amount of data has increased dramatically due to the increase in the number of cameras, and the data storage and business pressure on the background big data server has continued to increase. Existing technologies cannot effectively allocate resources, resulting in the server being unable to provide high-quality services under high load.
By collecting user behavior data and system environment information, establishing a server self-learning mechanism, analyzing data types, operation types, and access pressure by time period, generating structured data tables, optimizing resource allocation strategies, adjusting data warehousing and retrieval strategies, and prioritizing high-priority data.
It achieves the rational allocation of server resources in a big data environment, improves data warehousing efficiency and retrieval speed, reduces user waiting time, optimizes the execution time of scheduled tasks, and ensures the stable operation of the system.
Smart Images

Figure CN114676127B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer application technology, and in particular to a method, device, medium, and electronic device for analyzing server services. Background Art
[0002] With the rapid development of the economy and society, video surveillance has become an essential element of urban security. However, the increasing number of cameras in surveillance systems has led to a dramatic increase in data volumes and increasingly complex business requirements. This situation places increasing pressure on data storage and business operations on backend big data servers. However, the hardware and software resources of big data servers are limited. Within this limited resource, how to statistically analyze user behavior and determine the fundamental factors for resource allocation that are beneficial to system operation has become a critical technical challenge in the industry. Summary of the Invention
[0003] The embodiments of the present application provide a server business analysis method, device, medium and electronic device, which can provide a data basis for system resource allocation based on the results of user behavior information analysis, thereby achieving the purpose of rationally allocating system resources.
[0004] In a first aspect, an embodiment of the present application provides a method for analyzing server services, the method comprising:
[0005] Obtaining user behavior data and writing the user behavior data into a behavior data table of a relational database;
[0006] Performing a count of occurrences of the behavior data table by data type in different time periods during the analysis period to obtain a priority of each data type, and writing the statistical results into a first structured data table according to data type, number of occurrences of the data type, and priority;
[0007] and,
[0008] During the analysis period, the behavior data table is counted by operation type in different time periods to obtain the priority of each operation type, and the statistical results are written into the second structured data table according to the operation type, data type, time period and priority;
[0009] and,
[0010] During the analysis period, the behavior data table is counted according to the data access pressure in different time periods to obtain the priority of each data access pressure, and the statistical results are written into a third structured data table according to the data type, the number of access pressure statistics, and the priority;
[0011] The server services within the analysis period are analyzed according to the first structured data table, the second structured data table, and the third structured data table.
[0012] Furthermore, the method further comprises:
[0013] The behavior data table is statistically analyzed for feedback duration according to the operation type, and whether there is a risk is determined based on the obtained statistical result, and the risk determination result is written into the risk relationship field of the behavior data table.
[0014] Furthermore, analyzing the server services within the analysis period according to the first structured data table, the second structured data table, and the third structured data table includes:
[0015] Assigning values to the priorities written in the first structured data table, the second structured data table, and the third structured data table using a preset rule;
[0016] Take the data type as the statistical object and get the sum of the values assigned to each statistical object;
[0017] A data writing strategy for each statistical object is determined according to the sum of the values assigned to each statistical object.
[0018] Furthermore, according to the sum of the values assigned to each statistical object, a data writing strategy for each statistical object is determined, including:
[0019] Reading at least two predetermined score ranges;
[0020] At least two data types whose assigned sums fall within at least two score ranges are written using at least two corresponding consumption durations or batch consumption data volumes.
[0021] Furthermore, analyzing the server services within the analysis period according to the first structured data table, the second structured data table, and the third structured data table includes:
[0022] Assigning values to the priorities written in the first structured data table, the second structured data table, and the third structured data table using a preset rule;
[0023] Take the data type as the statistical object and get the sum of the values assigned to each statistical object;
[0024] Based on the sum of the values assigned to each statistical object and the updated results of the risk relationship fields in the behavior data table, the target object whose operation type is retrieval and meets the preset conditions is determined;
[0025] The target object is stored in a pre-divided memory space.
[0026] Furthermore, the method further comprises:
[0027] Obtains the execution information of scheduled tasks in the environment and writes it to the task information data table in the relational database.
[0028] Furthermore, the method further comprises:
[0029] Obtain the indicator collection results of system resources;
[0030] According to the indicator collection result, a time period in which the resource usage indicator is higher than the resource usage threshold is obtained; according to the behavior data table, priority statistics are performed according to the access pressure to obtain a time period in which the pressure is higher than the set pressure threshold, and the obtained time period is determined as a busy period;
[0031] According to the busy period, an idle period in a statistical cycle is determined; and according to the idle period, an execution time of a system scheduled task is determined.
[0032] In a second aspect, an embodiment of the present application provides a method and apparatus for analyzing server services, the apparatus comprising:
[0033] A behavior data table determination module is used to obtain user behavior data and write the user behavior data into a behavior data table of a relational database;
[0034] a structured data table generating module, configured to perform a count of the number of occurrences of the behavior data table by data type in different time periods within an analysis cycle, obtain a priority of each data type, and write the statistical results into a first structured data table according to data type, number of occurrences of the data type, and priority;
[0035] and,
[0036] During the analysis period, the behavior data table is counted by operation type in different time periods to obtain the priority of each operation type, and the statistical results are written into the second structured data table according to the operation type, data type, time period and priority;
[0037] and,
[0038] During the analysis period, the behavior data table is counted according to the data access pressure in different time periods to obtain the priority of each data access pressure, and the statistical results are written into a third structured data table according to the data type, the number of access pressure statistics, and the priority;
[0039] The business analysis module is used to analyze the server business within the analysis period according to the first structured data table, the second structured data table and the third structured data table.
[0040] In a third aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the server business analysis method as described in the embodiment of the present application.
[0041] In a fourth aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the server service analysis method as described in the embodiment of the present application is implemented.
[0042] The technical solution provided by the embodiment of the present application obtains user behavior data and writes the user behavior data into a behavior data table of a relational database; during the analysis period, the behavior data table is counted according to the data type in time periods to obtain the priority of each data type, and the statistical results are written into a first structured data table according to the data type, the number of data type statistics and the priority; and, during the analysis period, the behavior data table is counted according to the operation type in time periods to obtain the priority of each operation type, and the statistical results are written into a second structured data table according to the operation type, data type, time period and priority; and, during the analysis period, the behavior data table is counted according to the data access pressure in time periods to obtain the priority of each data access pressure, and the statistical results are written into a third structured data table according to the data type, the number of access pressure statistics and the priority; based on the first structured data table, the second structured data table and the third structured data table, the server business within the analysis period is analyzed. The technical solution provided by the present application can provide a data basis for the system's resource allocation based on the results of the user's behavior information analysis, thereby achieving the purpose of rationally allocating the system's resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 This is a flow chart of a server service analysis method provided by an embodiment of the present application;
[0044] Figure 2 Schematic diagram of a server service analysis method provided in an embodiment of the present application;
[0045] Figure 3 This is a structural diagram of a server service analysis method and device provided in an embodiment of the present application;
[0046] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0047] The present application will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are intended only to illustrate the present application and are not intended to limit the present application. It should also be noted that, for ease of description, the accompanying drawings only illustrate portions of the present application, not all of the structures.
[0048] Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow charts describe the steps as sequential processes, many of the steps can be implemented in parallel, concurrently, or simultaneously. In addition, the order of the steps can be rearranged. The process can be terminated when its operation is completed, but can also have additional steps not included in the accompanying drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.
[0049] Figure 1 This is a flowchart of the server service analysis method provided in an embodiment of the present application. This embodiment is applicable to the service management of the server under the mixed data type access mode. The method can be executed by the server service analysis method device provided in an embodiment of the present application. The device can be implemented by software and / or hardware and can be integrated into the electronic device running this system.
[0050] This solution addresses the increasing number of cameras in surveillance systems, the growing volume of data, the increasing variety of data types, and the increasing complexity of business functions. In this context, the data storage and business pressure on backend big data servers continues to grow. However, by optimizing the business execution logic at the software level based on current user behavior and actual operating conditions, and adjusting resource allocation accordingly, we can ensure the best possible service when users need it.
[0051] Currently, when big data systems are running, they provide external services and internal scheduled tasks without considering the business pressure of the environment. The following three aspects are relatively typical:
[0052] 1. Provides a mixed data type data access mode. When mixed data is accessed, Flume provides a consumer group and starts storing the consumed data simultaneously.
[0053] 2. When users issue search and other services, they immediately issue search conditions for data retrieval;
[0054] 3. Currently, the server has some scheduled services, which will be executed when the specified scheduled task execution time is reached.
[0055] Because the business pressure of the environment and the impact of real-time business operations on the server are not taken into consideration, the server's external service environment cannot achieve self-optimization and adjustment, which will result in the external service environment being unable to provide better services due to the high pressure. Currently, there are some technical solutions, such as using the external data access function to have the same standards for all data access. This will lead to data entry being blocked due to server performance impacts and internal component defects when the environmental data pressure increases, and the real-time data required by users cannot be entered into the database and applied in a timely manner. When the subsequent external service environment runs for a long time, the amount of data will become larger and larger. The search tasks issued by users immediately and the immediate execution of the search business will take a long time, requiring users to wait for a long time.
[0056] Furthermore, scheduled tasks are typically executed during a specific timeframe, such as the early morning hours. Choosing this timeframe for scheduled tasks creates the risk of excessive server performance pressure. On the one hand, insufficient performance during this timeframe can lead to environmental anomalies, impacting usage during other timeframes. On the other hand, some scheduled tasks, if unable to complete within the specified timeframe, will simply exit and execute at the next designated timeframe. However, this can still occur due to large data volumes or other reasons, resulting in the scheduled task failing to complete every time.
[0057] In the above existing solutions, the business execution logic and resource allocation within the big data server are basically executed and obtained immediately, which may conflict with the actual use of users.
[0058] The present invention collects user operation information and pressure information of the actual operation of the environment, considers the execution logic of data access and retrieval, and software timing services, establishes a software self-learning mechanism for the server, continuously collects statistics on the execution logic and execution time of the current service in each analysis cycle, and makes targeted adjustments in the next analysis cycle, and solves the above-mentioned typical problems based on this cyclic self-learning mechanism.
[0059] like Figure 1 As shown, the server service analysis method includes:
[0060] S110: Obtain user behavior data, and write the user behavior data into a behavior data table of a relational database.
[0061] User behavior data may include data retrieval, data update, data deletion, and research and analysis. Data retrieval involves filtering data based on search criteria, data update involves updating data, data deletion involves deleting certain data, and research and analysis involves conducting preliminary research and judgment on data.
[0062] A relational database refers to a database that uses a relational model to organize data, such as SQLite, Oracle, and MySQL. The biggest feature of a relational database is transaction consistency. The relational model refers to a two-dimensional table model, and a relational database is a data organization composed of two-dimensional tables and the connections between them.
[0063] In contrast, non-relational databases, such as MongoDB, Redis, and HBase, use key-value pairs to store data, are distributed, and generally do not support ACID properties. Therefore, non-relational databases are not strictly a type of database, but can be understood as a collection of structured data storage methods.
[0064] In this solution, user behavior data can be obtained by collecting service interface call information. When the interface provided by the server is called, a log is printed. When the log is printed, the user behavior is generated in the following form and written into the behavior data table of the relational database table. The behavior data table may include the following fields:
[0065] business Interface name Data types involved Time pressure There are risks
[0066] Among them, business refers to the operation type, which can be customized, mainly including: data retrieval, data update, data deletion, research and analysis business, etc.
[0067] The interface name can be an actual interface to facilitate subsequent interface restrictions.
[0068] The data types involved can be customized. For example, in the monitoring field, it can include vehicle data, MAC (Media Access Control Address, media access control address or physical address) data, and pedestrian data, etc.; the MAC data can be the MAC address of the mobile device used by the user.
[0069] The time period can be divided into hours, such as the hour period when the business starts to execute. For example, if it is executed at 12:30, just record 12.
[0070] Pressure can be the data access rate or execution time per hour. The Pressure field can be filled with "Yes" or "No", indicating whether the server is under pressure during the current period.
[0071] During the execution process, if there is data access, the data access rate in the previous hour will be counted every hour. The data access rate can be the average access volume per server per second or per hour.
[0072] In this solution, optionally, during the data collection process, the execution information of the scheduled tasks in the environment may be obtained and written into the task information data table of the relational database.
[0073] The scheduled task execution information defined by the server can also collect execution information. After the execution is completed, the execution record is written to the task information data table of the relational database. The task information data table can include the following fields:
[0074] Task Name Start time End Time Is the execution completed?
[0075] This solution uses monitoring scripts or components like scollector to collect system resource metrics, including CPU, Mem, disk space, and I / O data, as well as performance data for components such as ZooKeeper, Kafka, and ES. This collection is performed on a scheduled basis, with a default interval of 5 seconds. The generated data is then stored in a database, such as HBase, and the stored information can be defined as a data resource table.
[0076] S120. During the analysis period, the behavior data table is counted according to the data type in different time periods to obtain the priority of each data type, and the statistical results are written into the first structured data table according to the data type, the number of data type statistics, and the priority; and, during the analysis period, the behavior data table is counted according to the operation type in different time periods to obtain the priority of each operation type, and the statistical results are written into the second structured data table according to the operation type, data type, time period, and priority; and, during the analysis period, the behavior data table is counted according to the data access pressure in different time periods to obtain the priority of each data access pressure, and the statistical results are written into the third structured data table according to the data type, the number of access pressure statistics, and the priority.
[0077] An analysis cycle can be set, such as every 7 days. During each analysis cycle, various data are statistically analyzed. Statistics can be collected across the entire data set or by time period, for example, by using a 7×24 hour period. This solution uses time-based statistics to demonstrate the distribution of data over time within an analysis cycle. This provides information on data access and query performance for each time period within the analysis cycle, better demonstrating the temporal distribution of server processing volume within the analysis cycle.
[0078] Figure 2 Schematic diagram of the server service analysis method provided by the embodiment of the present application. Figure 2As shown, a statistical analysis task (called AnalyseTask) can be performed on task data every 7 days. The thresholds involved can be modified through the product configuration file. The analysis logic is as follows:
[0079] User behavior information analysis:
[0080] Analyze from three perspectives: data type classification, user operation and time analysis, and business pressure classification.
[0081] Among them, data type statistics is to count the number of times of each data type, such as the number of time periods when the data access volume of the vehicle data type exceeds a certain threshold, as the data type statistics number, and the results are written into the first structured data table according to "data type", "data type statistics number", and "priority";
[0082] User operation and time analysis: statistics are collected according to user operation types and corresponding time periods, and the operation type data within each time period is reflected. For example, the number of data retrievals within each time period. The results are entered into the second structured data table according to "business", "data type", "time period", and "priority".
[0083] The data access pressure can be calculated by referring to the dimension statistics in the process. For example, the number of times the data is written to a time period of 100 records per second is written to the third structured data table according to the fields "Data Type", "Access Pressure Statistics", and "Priority".
[0084] In this embodiment, optionally, the method further includes:
[0085] The behavior data table is statistically analyzed for feedback duration according to the operation type, and whether there is a risk is determined based on the obtained statistical result, and the risk determination result is written into the risk relationship field of the behavior data table.
[0086] For example, for research and analysis services, the "Risk Exists" field in the behavior data table can be updated based on a 5-minute execution duration. If the analysis exceeds 5 minutes, it will be updated to "Yes," and if it is less than 5 minutes, it will be updated to "No." For data retrieval, data update, data deletion, and other services, the "Risk Exists" field in the behavior data table can be updated based on a 5-second feedback duration. If the retrieval exceeds 5 seconds, it will be updated to "Yes," and if it is less than 5 seconds, it will be updated to "No." For other services, the settings can be adjusted based on actual circumstances. Accordingly, after obtaining the risk assessment results, they can be written to the corresponding behavior data table based on the time period.
[0087] S130: Analyze server services within an analysis period according to the first structured data table, the second structured data table, and the third structured data table.
[0088] Based on the three structured data tables obtained above, the busyness of the server business, or the busyness in a certain period of time, can be determined, and whether there is any business in the period that can be transferred to other periods of time can be regularly analyzed, thereby achieving the purpose of quantitative analysis.
[0089] In addition, the statistical analysis task (AnalyseTask) provided by this solution can perform statistical analysis on the previous cycle every time a cycle (7 days in the above example) is reached, and obtain quantitative data of the previous cycle, so that it can be iterated periodically to provide users with a more objective basis for server business analysis.
[0090] The technical solution provided in the embodiment of the present application creates a server self-learning mechanism based on the collected user operation information and system environment information, thereby achieving the purpose of timely analysis of server tasks, and providing technical guarantee for the stable operation of the server in the case of huge data volume.
[0091] In a feasible embodiment, optionally, analyzing the server services within the analysis period according to the first structured data table, the second structured data table, and the third structured data table includes:
[0092] Assigning values to the priorities written in the first structured data table, the second structured data table, and the third structured data table using a preset rule;
[0093] Take the data type as the statistical object and get the sum of the values assigned to each statistical object;
[0094] A data writing strategy for each statistical object is determined according to the sum of the values assigned to each statistical object.
[0095] In this solution, when mixed data types are accessed, each data type is not consumed and stored at the same rate. According to the statistical results of the first structured data table, the second structured data table and the third structured data table, the data types are used as statistical objects and assigned values respectively. For example, high priority is 5 points, medium priority is 3 points, and low priority is 1 point. The scores are processed in sequence. Specifically, the corresponding priorities can also be stored in the data table, and the statistical results can be updated in the next analysis cycle. For the data types accessed in the environment, when accessing data, the strategy adopted can be to prioritize the data types with high scores to be stored first. At present, the consumption and storage of data in the environment are all carried out by the Flume consumer component. Therefore, the internal configuration of the consumer component can be adjusted by summing the priority scores after analysis.
[0096] On the basis of the above technical solution, optionally, determining the data writing strategy for each statistical object according to the sum of the values assigned to each statistical object includes:
[0097] Reading at least two predetermined score ranges;
[0098] At least two data types whose assigned sums fall within at least two score ranges are written using at least two corresponding consumption durations or batch consumption data volumes.
[0099] Specifically, taking the Flume consumer component as an example, all data types are currently consumed in batches of 1 second or 1,000 items. These configurations are pre-written in the Flume consumer component's corresponding configuration file, flume-conf.properties. Using the previously obtained assignment sums, the consumption batches for each data type can be redefined. For example, data with a high assignment sum can be consumed every 1 second or when the cumulative batch size reaches 1,000 items; data with a medium assignment sum can be consumed every 30 seconds or when the cumulative batch size reaches 5,000 items; and data with a low assignment sum can be consumed every 1 minute or when the cumulative batch size reaches 10,000 items. Therefore, by adjusting the consumption rate of each data type, high-priority data types can be introduced into the environment more quickly to ensure normal user functionality.
[0100] In a feasible embodiment, optionally, analyzing the server services within the analysis period according to the first structured data table, the second structured data table, and the third structured data table includes:
[0101] Assigning values to the priorities written in the first structured data table, the second structured data table, and the third structured data table using a preset rule;
[0102] Take the data type as the statistical object and get the sum of the values assigned to each statistical object;
[0103] Determine the target object whose operation type is retrieval and meets the preset conditions based on the sum of the values assigned to the statistical objects and the update result of the risk relationship field of the behavior data table;
[0104] The target object is stored in a pre-divided memory space.
[0105] In this solution, the sum of the assigned values of each statistical object and the behavioral data table can be filtered according to the conditions of retrieval for business, high priority for the type of data involved, and high risk for the risk. It can be concluded that there is a risk of retrieval timeout for high-priority data. Furthermore, the reason for the read timeout is that the retrieval performance of the underlying storage components (Hbase, ES, etc.) is insufficient, resulting in a long retrieval time. Therefore, a piece of memory space is directly reserved in the server. This part of the memory space can be used to store the results obtained by high-frequency filtering conditions, and the corresponding filtering conditions can be obtained through the retrieval operations analyzed above. Specifically, the corresponding operation log can be read to analyze a certain dimension that is most involved in the retrieval conditions, such as the card port or camera field in the video surveillance industry, and this condition can be used as a high-frequency filtering condition. The time condition can be in the order of the current day and the previous day until the reserved memory space is full.
[0106] The size of the reserved memory space can be determined using the following rules:
[0107] When analyzing scheduled tasks, we calculate the maximum memory usage and combine it with the server's total memory. We then take half of the difference between the two. For example, if the total memory capacity is 200Gb and 100Gb is already used, we use half of the remaining 100Gb, or 50Gb, as the reserved memory space.
[0108] When users issue search conditions, they first filter the conditions in the reserved memory space. Since the search speed in the memory is faster than in other storage spaces, the search time is reduced. If there is a range of conditions that are not met, the conditions are combined again and the search task is issued. At this time, because the search range is smaller, the search time will also be reduced.
[0109] This solution can store frequently retrieved data in memory through such a setting, thereby improving the response speed of the search. At the same time, the stored data is filtered according to the set rules and has a higher probability of being retrieved, thus avoiding the blindness of the data storage process and making full use of the allocated memory space.
[0110] In a feasible embodiment, optionally, the method further includes:
[0111] Obtain the indicator collection results of system resources;
[0112] According to the indicator collection result, a time period in which the resource usage indicator is higher than the resource usage threshold is obtained; according to the behavior data table, priority statistics are performed according to the access pressure to obtain a time period in which the pressure is higher than the set pressure threshold, and the obtained time period is determined as a busy period;
[0113] According to the busy period, an idle period in a statistical cycle is determined; and according to the idle period, an execution time of a system scheduled task is determined.
[0114] The indicator collection results of the system resources can be read from the data resource table obtained by storing the data normally after the collection.
[0115] The execution time period of the system scheduled tasks can define the system task time as adjustable (the scheduled tasks every 7 days are fixed at 11 pm on Sunday). AnalyseTask can analyze the data resource table on the one hand, and analyze the time period of high pressure on the system with indicators such as "total CPU greater than 80%" and "IOwait greater than 5%". All business corresponding execution time periods in the behavior data table are combined into one time range, excluding the time period when the data access pressure is less than the preset value, such as the time period when the data access pressure is less than 40. The above two time ranges are busy time periods, and the rest of the day can be determined as idle time periods. Combined with the task information data table, if there is a scheduled task within the busy time period, the execution time of the scheduled task can be changed to the idle time period.
[0116] Additionally, scheduled tasks can be sorted and assigned based on pre-defined scheduled task priorities and the number of times the task information database has been executed. Given that scheduled retrieval tasks have the highest priority, scheduled tasks for the following week can be executed according to the adjusted timeframe. This allows for continuous optimization over time, making optimal use of the system's idle periods.
[0117] In addition, you can also create a whitelist to add scheduled tasks that need to be executed during certain time periods so that they do not need to be adjusted during the time period.
[0118] This model will continuously collect environmental information and use it to continuously optimize and adjust until the server's task operating environment becomes stable and reasonable. It can also establish a cleanup mechanism to prevent excessive data accumulation.
[0119] The technical solution provided in the embodiment of the present application optimizes and adjusts the configuration of data access based on the actual usage of users and the actual situation of the system environment, ensuring that the data most needed by users can be stored in time to provide retrieval and other services; performs advance caching operations on data retrieval, stores some results in the cache in advance, and the next time the user's retrieval is executed in the cache first, thereby improving the retrieval speed; the execution of system tasks will not take into account the business pressure of the environment, and adjustments based on the business pressure of the environment will be more conducive to the provision of services.
[0120] Figure 3 FIG. 1 is a structural diagram of a server service analysis method and apparatus provided in an embodiment of the present application. Figure 3 As shown, the device may include:
[0121] A behavior data table determination module 310 is configured to obtain user behavior data and write the user behavior data into a behavior data table of a relational database;
[0122] Structured data table generation module 320, used for
[0123] Performing a count of occurrences of the behavior data table by data type in different time periods during the analysis period to obtain a priority of each data type, and writing the statistical results into a first structured data table according to data type, number of occurrences of the data type, and priority;
[0124] and,
[0125] During the analysis period, the behavior data table is counted by operation type in different time periods to obtain the priority of each operation type, and the statistical results are written into the second structured data table according to the operation type, data type, time period and priority;
[0126] and,
[0127] During the analysis period, the behavior data table is counted according to the data access pressure in different time periods to obtain the priority of each data access pressure, and the statistical results are written into a third structured data table according to the data type, the number of access pressure statistics, and the priority;
[0128] The business analysis module 330 is configured to analyze the server business within an analysis period according to the first structured data table, the second structured data table, and the third structured data table.
[0129] The server service analysis method device provided by the embodiment of the present invention can execute the server service analysis method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of executing the server service analysis method.
[0130] An embodiment of the present application further provides a storage medium containing computer-executable instructions. When the computer-executable instructions are executed by a computer processor, the computer-executable instructions are used to perform a server service analysis method, the method comprising:
[0131] Obtaining user behavior data and writing the user behavior data into a behavior data table of a relational database;
[0132] Performing a count of occurrences of the behavior data table by data type in different time periods during the analysis period to obtain a priority of each data type, and writing the statistical results into a first structured data table according to data type, number of occurrences of the data type, and priority;
[0133] and,
[0134] During the analysis period, the behavior data table is counted by operation type in different time periods to obtain the priority of each operation type, and the statistical results are written into the second structured data table according to the operation type, data type, time period and priority;
[0135] and,
[0136] During the analysis period, the behavior data table is counted according to the data access pressure in different time periods to obtain the priority of each data access pressure, and the statistical results are written into a third structured data table according to the data type, the number of access pressure statistics, and the priority;
[0137] The server services within the analysis period are analyzed according to the first structured data table, the second structured data table, and the third structured data table.
[0138] Storage media refers to any of various types of memory electronic devices or storage electronic devices. The term "storage medium" is intended to include: installation media, such as CD-ROMs, floppy disks, or tape devices; computer system memory or random access memory, such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; non-volatile memory, such as flash memory, magnetic media (such as hard disks or optical storage); registers or other similar types of memory elements, etc. Storage media may also include other types of memory or combinations thereof. In addition, the storage medium may be located in the computer system in which the program is executed, or it may be located in a different second computer system that is connected to the computer system via a network (such as the Internet). The second computer system may provide program instructions to the computer for execution. The term "storage medium" may include two or more storage media that may reside in different locations (e.g., in different computer systems connected via a network). The storage medium may store program instructions (e.g., embodied as a computer program) that can be executed by one or more processors.
[0139] Of course, the storage medium containing computer-executable instructions provided in an embodiment of the present application is not limited to the operations of the server business analysis method described above, but can also execute related operations in the server business analysis method provided in any embodiment of the present application.
[0140] An embodiment of the present application provides an electronic device, in which the server service analysis method device provided by the embodiment of the present application can be integrated. The electronic device can be configured within a system, or can be a device that executes part or all of the functions within the system. Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 4As shown, this embodiment provides an electronic device 400, which includes: one or more processors 420; a storage device 410 for storing one or more programs. When the one or more programs are executed by the one or more processors 420, the one or more processors 420 implement the server service analysis method provided in the embodiment of the present application. The method includes:
[0141] Obtaining user behavior data and writing the user behavior data into a behavior data table of a relational database;
[0142] Performing a count of occurrences of the behavior data table by data type in different time periods during the analysis period to obtain a priority of each data type, and writing the statistical results into a first structured data table according to data type, number of occurrences of the data type, and priority;
[0143] and,
[0144] During the analysis period, the behavior data table is counted by operation type in different time periods to obtain the priority of each operation type, and the statistical results are written into the second structured data table according to the operation type, data type, time period and priority;
[0145] and,
[0146] During the analysis period, the behavior data table is counted according to the data access pressure in different time periods to obtain the priority of each data access pressure, and the statistical results are written into a third structured data table according to the data type, the number of access pressure statistics, and the priority;
[0147] The server services within the analysis period are analyzed according to the first structured data table, the second structured data table, and the third structured data table.
[0148] Of course, those skilled in the art will appreciate that the processor 420 also implements the technical solution of the server service analysis method provided in any embodiment of the present application.
[0149] Figure 4 The electronic device 400 shown is merely an example and should not limit the functions and scope of use of the embodiments of the present application.
[0150] like Figure 4 As shown, the electronic device 400 includes a processor 420, a storage device 410, an input device 430, and an output device 440; the number of processors 420 in the electronic device can be one or more. Figure 4 In the figure, a processor 420 is used as an example; the processor 420, the storage device 410, the input device 430 and the output device 440 in the electronic device can be connected via a bus or other means. Figure 4The connection via bus 450 is taken as an example.
[0151] The storage device 410 is a computer-readable storage medium that can be used to store software programs, computer executable programs, and module units, such as program instructions corresponding to the server business analysis method in the embodiment of the present application.
[0152] The storage device 410 may primarily include a program storage area and a data storage area. The program storage area may store an operating system and at least one application required for a function; the data storage area may store data created based on the use of the terminal, etc. Furthermore, the storage device 410 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state memory device. In some instances, the storage device 410 may further include a memory remotely located relative to the processor 420, and such remote memory may be connected via a network. Examples of the aforementioned networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0153] The input device 430 may be used to receive input numbers, character information or voice information, and generate key signal input related to user settings and function control of the electronic device. The output device 440 may include electronic devices such as a display screen and a speaker.
[0154] The electronic device provided in the embodiment of the present application can provide a data basis for system resource allocation based on the results of user behavior information analysis, thereby achieving the purpose of rational allocation of system resources.
[0155] The server service analysis method apparatus, medium, and electronic device provided in the above embodiments can execute the server service analysis method provided in any embodiment of the present application, and have the corresponding functional modules and beneficial effects of executing the method. For technical details not fully described in the above embodiments, please refer to the server service analysis method provided in any embodiment of the present application.
[0156] Note that the above are only preferred embodiments of the present application and the technical principles employed. Those skilled in the art will understand that the present application is not limited to the specific embodiments described herein, and that various obvious changes, readjustments, and substitutions can be made by those skilled in the art without departing from the scope of protection of the present application. Therefore, although the present application has been described in more detail through the above embodiments, the present application is not limited to the above embodiments and may include many other equivalent embodiments without departing from the scope of the present application. The scope of the present application is determined by the scope of the appended claims.
Claims
1. A server service analysis method, characterized in that: The method comprises: Obtaining user behavior data and writing the user behavior data into a behavior data table of a relational database; Performing a count of occurrences of the behavior data table by data type in different time periods during the analysis period to obtain a priority of each data type, and writing the statistical results into a first structured data table according to data type, number of occurrences of the data type, and priority; and, During the analysis period, the behavior data table is counted by operation type in different time periods to obtain the priority of each operation type, and the statistical results are written into the second structured data table according to the operation type, data type, time period and priority; and, During the analysis period, the behavior data table is counted according to the data access pressure in different time periods to obtain the priority of each data access pressure, and the statistical results are written into a third structured data table according to the data type, the number of access pressure statistics, and the priority; Analyzing server services within an analysis period according to the first structured data table, the second structured data table, and the third structured data table includes: Assigning values to the priorities written in the first structured data table, the second structured data table, and the third structured data table using a preset rule; Take the data type as the statistical object and get the sum of the values assigned to each statistical object; The data writing strategy for each statistical object is determined based on the sum of the values assigned to each statistical object.
2. The method according to claim 1, characterized in that The method further comprises: The behavior data table is statistically analyzed for feedback duration according to the operation type, and whether there is a risk is determined based on the obtained statistical result, and the risk determination result is written into the risk relationship field of the behavior data table.
3. The method according to claim 1, characterized in that Determining a data writing strategy for each statistical object according to the sum of the values assigned to each statistical object includes: Reading at least two predetermined score ranges; At least two data types whose assigned sums fall within at least two score ranges are written using at least two corresponding consumption durations or batch consumption data volumes.
4. The method according to claim 2, characterized in that Analyzing the server services within the analysis period according to the first structured data table, the second structured data table, and the third structured data table further includes: Assigning values to the priorities written in the first structured data table, the second structured data table, and the third structured data table using a preset rule; Take the data type as the statistical object and get the sum of the values assigned to each statistical object; Based on the sum of the values assigned to each statistical object and the updated results of the risk relationship fields in the behavior data table, the target object whose operation type is retrieval and meets the preset conditions is determined; The target object is stored in a pre-divided memory space.
5. The method according to claim 1, wherein The method further comprises: Obtains the execution information of scheduled tasks in the environment and writes it to the task information data table in the relational database.
6. The method according to claim 5, characterized in that The method further comprises: Obtain the indicator collection results of system resources; According to the indicator collection result, a time period in which the resource usage indicator is higher than the resource usage threshold is obtained; according to the behavior data table, priority statistics are performed according to the access pressure to obtain a time period in which the pressure is higher than the set pressure threshold, and the obtained time period is determined as a busy period; According to the busy period, an idle period in a statistical cycle is determined; and according to the idle period, an execution time of a system scheduled task is determined.
7. A server service analysis device, characterized in that: The device comprises: A behavior data table determination module is used to obtain user behavior data and write the user behavior data into a behavior data table of a relational database; a structured data table generating module, configured to perform a count of the number of occurrences of the behavior data table by data type in different time periods within an analysis cycle, obtain a priority of each data type, and write the statistical results into a first structured data table according to data type, number of occurrences of the data type, and priority; and, During the analysis period, the behavior data table is counted by operation type in different time periods to obtain the priority of each operation type, and the statistical results are written into the second structured data table according to the operation type, data type, time period and priority; and, During the analysis period, the behavior data table is counted according to the data access pressure in different time periods to obtain the priority of each data access pressure, and the statistical results are written into a third structured data table according to the data type, the number of access pressure statistics, and the priority; A business analysis module, configured to analyze server business within an analysis period according to the first structured data table, the second structured data table, and the third structured data table; The business analysis module is specifically used to assign values to the priorities written in the first structured data table, the second structured data table, and the third structured data table using preset rules; taking the data type as the statistical object, obtaining the sum of the assigned values of each statistical object; and determining the data writing strategy of each statistical object based on the sum of the assigned values of each statistical object.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the server service analysis method according to any one of claims 1 to 6 is implemented.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable by the processor, wherein: When the processor executes the computer program, the server service analysis method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Method and device for processing electric power related data
CN111626543A
User behavior data processing method and device, electronic equipment and storage medium
CN111726402A