Sample data acquisition method and device, equipment, storage medium and program product
By obtaining the sample data generated by the second process associated with the first process from the distributed cache server, the problem of long time and high resource consumption in extracting black sample information in the SOC platform is solved, and the efficiency of data acquisition and prediction results are improved. real-time.
Patent Information
- Application Number
- CN202310256059.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-02
- Publication Date
- 2024-09-03
AI Technical Summary
When existing technology extracts black sample information from massive data platforms in SOC platforms, offline tasks take a long time, synchronization efficiency is low, and resource consumption is high, resulting in low real-time performance of online testing.
By obtaining the target sample data generated by running the first process in the terminal, and in response to the time data indicating that the first process is running within the historical time range, obtaining the associated sample generated by running the second process associated with the first process from the distributed cache server. Data, the target sample data and associated sample data are used as process prediction sample data, which are used to test the prediction results of the process prediction task.
It reduces the number of offline tasks on the data platform that stores full process data, reduces resource consumption, and improves data acquisition efficiency and the efficiency and real-time performance of prediction result testing for process prediction tasks.
Smart Images

Figure CN118585545A
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device, equipment, storage medium and program product for acquiring sample data. Background Art
[0002] In order to improve the automated operation capabilities of the Security Operations Center (SOC) platform and enhance the ability of security rules and machine learning models to detect high-risk processes, it is necessary to extract black sample information from the massive data platform for online testing in daily operations.
[0003] In related technologies, since it is difficult to realize real-time extraction of massive data in big data testing, offline tasks are often established to extract and store data in the business system database (Database, DB) in advance, and then data is obtained from the DB during online testing to realize the extraction of test data.
[0004] However, these offline tasks often take several hours or even more than a day, with extremely low synchronization efficiency, high costs caused by resource consumption, and low real-time performance of online testing. Summary of the invention
[0005] The embodiments of the present application provide a method, device, equipment, storage medium and program product for acquiring sample data, which can improve the efficiency of data acquisition. The technical solution is as follows.
[0006] In one aspect, a method for acquiring sample data is provided, the method comprising:
[0007] Acquire target sample data, where the target sample data is data generated by the operation of a first process in the terminal, and the target sample data is used to indicate the operation status of the first process, and the target sample data includes time data corresponding to the operation of the first process;
[0008] In response to the moment data indicating that the first process is running within a first historical time range, first associated sample data generated by the running of a second process associated with the first process is obtained from a distributed cache server, and the distributed cache server is used to cache the process data generated within the first historical time range, where the first historical time range is a time range with the current moment as the end moment and lasting for a preset time period;
[0009] The target sample data and the first associated sample data are used as process prediction sample data, and the process prediction sample data is used to test the prediction result of the process prediction task.
[0010] In another aspect, a device for acquiring sample data is provided, the device comprising:
[0011] A target sample data acquisition module, used to acquire target sample data, wherein the target sample data is data generated by the operation of a first process in the terminal, the target sample data is used to indicate the operation status of the first process, and the target sample data includes time data corresponding to the operation of the first process;
[0012] A first associated sample data acquisition module is configured to, in response to the moment data indicating that the first process is running within a first historical time range, acquire, from a distributed cache server, first associated sample data generated by the running of a second process associated with the first process, the distributed cache server being configured to cache process data generated within the first historical time range, wherein the first historical time range is a time range with the current moment as the end moment and lasting for a preset time period;
[0013] The prediction sample data acquisition module is used to use the target sample data and the first associated sample data as process prediction sample data, and the process prediction sample data is used to test the prediction result of the process prediction task.
[0014] On the other hand, a computer device is provided, which includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the sample data acquisition method as described in any of the above-mentioned embodiments of the present application.
[0015] On the other hand, a computer-readable storage medium is provided, in which at least one instruction, at least one program, a code set or an instruction set is stored. The at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to implement a method for acquiring sample data as described in any of the above-mentioned embodiments of the present application.
[0016] On the other hand, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method for obtaining sample data described in any of the above embodiments.
[0017] The beneficial effects brought by the technical solution provided by the embodiment of the present application include at least:
[0018] By acquiring target sample data for indicating the running status of the first process, in response to the time data corresponding to the running of the first process included in the target sample data indicating that the first process is running within the first historical time range, first associated sample data generated by the running of the second process associated with the first process is acquired from the distributed cache server, and the target sample data and the first associated sample data are used as process prediction sample data for testing the prediction result of the process prediction task. By using the distributed cache server that caches the process data generated within the first historical time range, the number of offline tasks of the data platform storing the full amount of process data is reduced, the cost caused by resource consumption is reduced, and the test efficiency and real-time performance of testing the prediction result of the process prediction task are improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0020] Figure 1 It is a schematic diagram of an implementation environment provided by an exemplary embodiment of the present application;
[0021] Figure 2 is a flow chart of a method for acquiring sample data provided by an exemplary embodiment of the present application;
[0022] Figure 3 is a flow chart of a method for obtaining first associated sample data provided by an exemplary embodiment of the present application;
[0023] Figure 4 It is a schematic diagram of a distributed cache server node framework provided by an exemplary embodiment of the present application;
[0024] Figure 5 is a schematic diagram of obtaining first associated sample data provided by an exemplary embodiment of the present application;
[0025] Figure 6 is a flow chart of a method for obtaining associated sample data provided by an exemplary embodiment of the present application;
[0026] Figure 7 is a schematic diagram of obtaining second associated sample data provided by an exemplary embodiment of the present application;
[0027] Figure 8 is a flow chart of a real-time data storage method provided by an exemplary embodiment of the present application;
[0028] Fig. 9is a schematic diagram of data caching provided by an exemplary embodiment of the present application;
[0029] Fig.10 is a flow chart of a process prediction method provided by an exemplary embodiment of the present application;
[0030] Fig.11 is a schematic diagram of a sample data acquisition system framework provided by an exemplary embodiment of the present application;
[0031] Fig.12 is a schematic diagram of a sample data acquisition system provided by an exemplary embodiment of the present application;
[0032] Fig.13 It is a schematic diagram of the structure of a distributed cache server provided by an exemplary embodiment of the present application;
[0033] Fig.14 This is a distributed reading schematic diagram of a distributed cache server provided by an exemplary embodiment of the present application;
[0034] Fig.15 It is a distributed cache schematic diagram of a distributed cache server provided by an exemplary embodiment of the present application;
[0035] Fig.16 is a structural block diagram of a device for acquiring sample data provided by an exemplary embodiment of the present application;
[0036] Fig.17 is a structural block diagram of a sample data acquisition device module provided by an exemplary embodiment of the present application;
[0037] Fig.18 It is a structural block diagram of a terminal provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0038] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below in conjunction with the accompanying drawings.
[0039] It should be understood that although the terms first, second, etc. may be used in the present disclosure to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present disclosure, the first parameter may also be referred to as the second parameter, and similarly, the second parameter may also be referred to as the first parameter. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0040] In order to improve the automated operation capability of the SOC platform and improve the detection capability of security rules and machine learning models for high-risk processes, it is necessary to extract black sample information from the massive data platform for online testing in daily operations. In related technologies, since it is difficult to achieve real-time extraction of massive data in big data testing, it is often extracted in advance and stored in the business system database by establishing offline tasks, and then the data is obtained from the database during online testing to achieve test data extraction. However, these offline tasks often take several hours or even more than a day, with extremely low synchronization efficiency, high costs caused by resource consumption, and low real-time performance of online testing. Among them, the database, in short, can be regarded as an electronic filing cabinet-a place for storing electronic files, where users can add, query, update, delete, and other operations on the data in the files. The so-called "database" is a collection of data that is stored together in a certain way, can be shared with multiple users, has as little redundancy as possible, and is independent of the application. The database management system (DBMS) is a computer software system designed for managing databases, generally with basic functions such as storage, interception, security, and backup. Database management systems can be classified according to the database model they support, such as relational, Extensible Markup Language (XML); or according to the type of computer they support, such as server clusters, mobile phones; or according to the query language used, such as Structured Query Language (SQL); or according to the performance focus, such as maximum scale, maximum speed; or other classification methods. Regardless of the classification method used, some DBMS can cross categories, for example, supporting multiple query languages at the same time.
[0041] The method for obtaining sample data provided in the embodiment of the present application obtains target sample data for indicating the running status of a first process, and in response to the time data corresponding to the running of the first process included in the target sample data indicating that the running of the first process is within a first historical time range, obtains first associated sample data generated by the running of a second process associated with the first process from a distributed cache server, and uses the target sample data and the first associated sample data as process prediction sample data for testing the prediction result of a process prediction task. By using a distributed cache server that caches the process data generated within the first historical time range, the number of offline tasks of a data platform storing full process data is reduced, the data acquisition efficiency is improved, the cost caused by resource consumption is reduced, and the test efficiency and real-time performance of testing the prediction result of the process prediction task are improved.
[0042] First, let's introduce the implementation environment of this application. Figure 1 , which shows a schematic diagram of an implementation environment provided by an exemplary embodiment of the present application, wherein the implementation environment includes: a terminal 110, a distributed cache server 120 and a full data platform 130.
[0043] A communication connection relationship is established between any two of the terminal 110, the distributed cache server 120 and the full data platform 130, and data can be transmitted between the terminal 110, the distributed cache server 120 and the full data platform 130 through the communication connection relationship. The distributed cache server stores the first associated sample data 111, and the full data platform 130 stores the data generated by all process operations in the terminal 110. In the case where there is a process running in the terminal 110, the terminal 110 generates real-time process data 101, obtains the real-time process data 101 in the terminal 110 and performs dynamic backup to obtain backup process data 102, and stores the backup process data 102 in a distributed manner in the distributed cache server 120, and stores the real-time process data 101 in the full data platform 130. In some embodiments, the backup process data 102 cached by the distributed cache server 120 includes the first associated sample data 111, and the real-time process data 101 stored in the full data platform 130 includes the second associated sample data 112.
[0044] In some embodiments, target sample data 113 is obtained from the process data of the terminal 110. The target sample data 113 is data generated by the operation of the first process in the terminal 110. The target sample data 113 is used to indicate the operation status of the first process. The target sample data 113 includes time data corresponding to the operation of the first process. In response to the time data indicating that the first process is running within a first historical time range, first associated sample data 111 generated by the operation of a second process associated with the first process is obtained from the distributed cache server 120. The distributed cache server 120 is used to cache the process data generated within the first historical time range. The first historical time range is a time period that ends at the current time and lasts for a preset period of time. range; using the target sample data 113 and the first associated sample data 111 as process prediction sample data 114, the process prediction sample data is used to test the prediction result of the process prediction task; in response to the moment data indicating that the first process is running within the second historical time range, obtaining the second associated sample data 112 generated by the third process associated with the first process from the full data platform 130, the full data platform 130 is used to store the process data generated within the second historical time range, the second historical time range is a time range with the start moment of the first historical time range as the end moment and lasting for a preset time length; using the target sample data 113 and the second associated sample data 112 as process prediction sample data 115.
[0045] The above-mentioned terminal is optional. The terminal can be a desktop computer, a laptop computer, a mobile phone, a tablet computer, an e-book reader, an MP3 (Moving Picture Experts Group Audio Layer III) player, an MP4 (Moving Picture Experts Group Audio Layer IV) player, a smart TV, a smart car, and other forms of terminal devices, which are not limited to the embodiments of the present application.
[0046] It is worth noting that the above-mentioned server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms. The terminal can be a smart phone, tablet computer, laptop computer, desktop computer, smart speaker, smart watch, etc., but is not limited to this. The terminal and the server can be directly or indirectly connected by wired or wireless communication, and this application does not limit this.
[0047] Among them, cloud technology refers to a hosting technology that unifies hardware, software, network and other resources within a wide area network or local area network to achieve data computing, storage, processing and sharing.
[0048] In some embodiments, the above server can also be implemented as a node in a blockchain system.
[0049] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions. For example, the operation data and account information involved in this application are all obtained with full authorization.
[0050] To further explain, before collecting relevant data of the user (for example: account information, historical operation data and real-time operation data involved in this application) and during the process of collecting relevant data of the user, this application can display a prompt interface, pop-up window or output voice prompt information, and the prompt interface, pop-up window or voice prompt information is used to prompt the user that its relevant data is currently being collected, so that this application only starts to execute the relevant steps of obtaining relevant data of the user after obtaining the confirmation operation issued by the user to the prompt interface or pop-up window, otherwise (that is, when the confirmation operation issued by the user to the prompt interface or pop-up window is not obtained), the relevant steps of obtaining relevant data of the user are terminated, that is, the relevant data of the user is not obtained. In other words, all user data collected by this application are collected with the consent and authorization of the user, and the collection, use and processing of relevant user data need to comply with the relevant laws, regulations and standards of relevant countries and regions.
[0051] For illustration, please refer to Figure 2 , which shows a flow chart of a method for obtaining sample data provided by an exemplary embodiment of the present application. The method can be applied to a terminal, a server, or both. The present application embodiment takes the method applied to a terminal as an example for explanation. Figure 2 As shown, the method comprises the following steps:
[0052] Step 210, obtaining target sample data.
[0053] In some embodiments, the target sample data is data generated by the running of the first process in the terminal. The first process can be any process running in the terminal, or it can be a process in the terminal that meets preset process running requirements. The preset process running requirements can be implemented as an exception in the running of the first process, etc.
[0054] Exemplarily, the first process may be a black process that generates macro virus data and the like during operation.
[0055] Optionally, the target sample data may be data generated by the operation of any process of the terminal, or data generated by a process in the terminal that meets preset process operation requirements, such as black process data. The target sample data is used to indicate the operation status of the first process, and optionally, the target sample data may include information such as the process name, process identifier (PID), user name, and alarm time of the first process.
[0056] In some embodiments, the target sample data includes time data corresponding to the running of the first process, and the time data can be used to indicate the time when the first process starts running, or to indicate the time when the target sample data corresponding to the first process is generated.
[0057] Step 220 , in response to the time data indicating that the first process is running within a first historical time range, first associated sample data generated by the running of a second process associated with the first process is obtained from a distributed cache server.
[0058] The distributed cache server is used to cache process data generated within a first historical time range, where the first historical time range is a time range with the current time as the end time and lasting for a preset time period.
[0059] Exemplarily, the first historical time range may be within three days with the current time as the end time, and the distributed cache server is used to cache the process data generated within the last three days.
[0060] In some embodiments, the second process is a process associated with the first process, that is, the second process may be a process that has a calling relationship with the first process, or a process concurrent with the first process, or any process that has an associated relationship with the first process during terminal operation. The first associated sample data is data generated by the operation of the second process, and may include information such as the process name, PID, user name, and alarm time of the second process.
[0061] In some embodiments, the implementation method for obtaining the first associated sample data from the distributed cache server can be based on a preset association relationship, by indexing the process name, PID, user name, alarm time and other information in the cached process data to obtain the first associated sample data.
[0062] Exemplarily, if the preset association relationship is implemented as the first process and the second process are processes called by the same user, then by searching the user name in the process data, the process data whose user name is consistent with the target sample data is obtained as the first association data; if the preset association relationship is implemented as the alarm time of the second process is within a specified time range before and after the alarm time of the first process, then by searching the alarm time in the process data, the process data whose alarm time is within a specified time range before and after the alarm event of the first process is obtained as the first association data.
[0063] In some embodiments, the distributed cache server includes multiple node servers, and the implementation method of the first associated sample data includes obtaining a distributed lock of a sample acquisition task corresponding to the target sample data in response to a target node server among the multiple node servers, and obtaining the first associated sample data produced by the second process from the target node server. The multiple node servers cache the same process data respectively, and at the same time, in response to a specified task, at most only one node server among the multiple node servers obtains the distributed lock corresponding to the specified task, and the node server that obtains the distributed lock is the target node server, and the distributed lock is used to instruct the target node server to execute the specified task.
[0064] In some embodiments, the sample acquisition task corresponding to the above-mentioned target sample data is implemented by acquiring process data associated with the target sample data, that is, acquiring the first associated sample data generated by the running of the second process. In response to the target node server acquiring the distributed lock of the task, the distributed cache server acquires the first associated sample data cached in the target node server based on the distributed lock through the target node server.
[0065] Step 230: Use the target sample data and the first associated sample data as process prediction sample data.
[0066] Among them, the process prediction sample data is used to test the prediction results of the process prediction task.
[0067] In some embodiments, the process prediction task is used to predict the running status of the process. For example, the process prediction task is used to predict whether the process is a black process, whether an alarm message is generated, whether the process ends abnormally, etc.
[0068] In some embodiments, the prediction sample data is annotated with a reference label for indicating the process running status. The prediction result is obtained by predicting the prediction sample data through a process prediction program corresponding to the process prediction task. The test result is obtained based on the reference label and the prediction result, that is, the detection rate of the process prediction program is tested based on the difference between the reference label and the prediction result.
[0069] Optionally, the prediction method adopted by the process prediction program includes at least one of rule prediction, artificial intelligence (AI) prediction, and hash matching. Among them, rule prediction refers to generating prediction results corresponding to prediction sample data based on preset rules; AI prediction refers to obtaining prediction results corresponding to prediction sample data through a pre-trained AI model; hash matching refers to matching the hash values of prediction sample data through a platform that stores a large number of hash values corresponding to processes, and generating prediction results corresponding to prediction sample data based on the matching results. Among them, the training process of the AI model can be implemented as obtaining prediction sample data marked with reference labels, performing process prediction on the prediction sample data through a candidate AI model to obtain sample prediction results, determining a prediction loss value based on the difference between the sample prediction result and the reference label, and training the candidate AI model based on the prediction loss value to obtain an AI model.
[0070] Exemplarily, the process prediction task is to detect black processes including Trojan viruses. The prediction results include two situations: "black process" and "normal process". When the process prediction program adopts a rule prediction method, the preset rule is implemented as a Trojan virus generated during process operation. The prediction result is obtained based on the query of the inclusion of Trojan viruses in the sample prediction data, wherein the prediction result corresponding to the prediction sample data containing Trojan viruses is "black process", otherwise, it is "normal process"; when the process prediction program adopts an AI prediction method, the AI model is a pre-trained black process detection model, and the sample prediction data is input into the black process detection model to output the prediction result; when the process prediction program adopts a hash matching method, the hash value corresponding to the prediction sample data is matched through a message digest algorithm version 5 (Message Digest Algorithm 5, MD5) platform. If there is a hash value consistent with the hash value corresponding to the prediction sample data in the MD5 platform, the prediction result of the prediction sample data is "black process", otherwise, the prediction result is "normal process". Among them, the prediction sample data is marked with reference labels, and the reference labels include "black process" labels and "normal process" labels. The test of the prediction results of the process prediction task is implemented by comparing the prediction results and the reference labels. If the reference labels of the prediction sample data are consistent with the prediction results, the process prediction program detects correctly, otherwise it detects incorrectly. The test result can be realized as the detection result of a single prediction sample data, or as the detection rate of the process prediction program for multiple prediction sample data.
[0071] To summarize, the method provided by the embodiment of the present application obtains target sample data for indicating the running status of a first process, and in response to the time data corresponding to the running of the first process included in the target sample data indicating that the first process is running within a first historical time range, obtains the first associated sample data generated by the running of a second process associated with the first process from a distributed cache server, and uses the target sample data and the first associated sample data as process prediction sample data to test the prediction result of the process prediction task. By using a distributed cache server that caches the process data generated within the first historical time range, the number of offline tasks of the data platform storing the full amount of process data is reduced, the data acquisition efficiency is improved, the cost caused by resource consumption is reduced, and at the same time, the test efficiency and real-time performance of testing the prediction result of the process prediction task are improved.
[0072] In some embodiments, the distributed cache server includes multiple node servers. Figure 3 , Figure 3 is a flow chart of a method for obtaining first associated sample data provided by an exemplary embodiment of the present application. Figure 3As shown, when the time data indicates that the first process is running within the historical time range, the above step 220 is implemented as step 221.
[0073] Step 221 , in response to a target node server among the multiple node servers acquiring a distributed lock of a sample acquisition task corresponding to target sample data, first associated sample data generated by the running of a second process is acquired from the target node server.
[0074] Among them, multiple node servers cache the same process data.
[0075] In some embodiments, different sample acquisition tasks correspond to different distributed locks. A node server that seizes the distributed lock among multiple node servers serves as the target node server to execute the sample acquisition task corresponding to the seized distributed lock. Optionally, each node server can seize one or more distributed locks.
[0076] Optionally, the multiple node servers may include one or more target node servers.
[0077] For illustration, please refer to Figure 4 , Figure 4 FIG. 1 is a schematic diagram of a distributed cache server node framework provided by an exemplary embodiment of the present application. Figure 4 As shown, there are multiple node servers in the distributed cache server 400, including node server 1, node server 2 to node server n. For a distributed lock 410 of a single sample acquisition task, the sample acquisition task is executed by node server 1 that seizes the distributed lock 410 among multiple node servers. For multiple different distributed locks of multiple sample acquisition tasks, multiple node servers can execute the sample acquisition tasks corresponding to the distributed locks by respectively seizing a distributed lock.
[0078] In some embodiments, the target node server includes multiple container engines, and the above step 221 is implemented as: in response to the target container engine in the target node server obtaining the distributed lock corresponding to the target sample data, the first associated sample data generated by the second process running is obtained from the target node server through the target container engine.
[0079] In some embodiments, each node server can seize multiple distributed locks, and multiple container engines in the target node server can respectively seize one distributed lock from the multiple distributed locks corresponding to the target node server, wherein the container engine that seizes the distributed lock corresponding to the target sample data serves as the target container engine and executes the task of obtaining the target sample data, that is, obtaining the first associated sample data generated by the running of the second process from the target node server.
[0080] For illustration, please refer to Figure 5 , Figure 5 is a schematic diagram of obtaining first associated sample data provided by an exemplary embodiment of the present application, such as Figure 5 As shown, there are multiple node servers in the distributed cache server 500, including node server 1, node server 2 to node server n, wherein node server 1 to node server n are all target node servers, that is, node server 1 to node server n respectively include multiple container engines, and the multiple container engines include container engine 1, container engine 2 to container engine 10. Assuming that the container engine 10 in each target node server seizes the distributed lock corresponding to the target sample data, the container engine 10 in each target node server performs the task of obtaining the target sample data, that is, the container engines 10 corresponding to each of node servers 1 to node server n respectively obtain the first associated sample data generated by the second process running from node server 1 to node server n.
[0081] To summarize, the method provided in the embodiment of the present application, through a distributed cache server including multiple node servers, when the moment data indicates that the first process is running within the first historical time range, responds to the target node server among the multiple node servers obtaining the distributed lock of the sample acquisition task corresponding to the target sample data, and obtains the first associated sample data generated by the running of the second process from the target node server. Multiple target node servers can execute the sample acquisition task at the same time, thereby improving data acquisition efficiency.
[0082] The method provided by the embodiment of the present application, through a target node server including multiple container engines, when the time data indicates that the first process is running within the first historical time range, in response to the target container engine among the multiple container engines obtaining the distributed lock corresponding to the target sample data, obtains the first associated sample data generated by the running of the second process from the target node server. While the target container engine obtains the first associated sample data generated by the running of the second process from the target node server, other container engines in the target node can execute other data acquisition or storage tasks by preempting other distributed locks, thereby improving data acquisition efficiency and resource utilization, and reducing costs caused by resource consumption.
[0083] Please refer to Figure 6 , Figure 6 is a flow chart of a method for obtaining associated sample data provided by an exemplary embodiment of the present application. Figure 6 As shown, in some embodiments, obtaining the associated sample data after the above step 210 includes the following two situations:
[0084] The first , the moment data included in the target sample data is within the first historical time range.
[0085] The second , the target sample data includes moment data within the second historical time range.
[0086] In some embodiments, in the first case, the above steps 220 to 230 are performed after the above step 210, which will not be repeated here.
[0087] In the second case, the above step 210 includes the following steps:
[0088] Step 240 , in response to the moment data indicating that the first process is running within the second historical time range, second associated sample data generated by the running of a third process associated with the first process is obtained from the full data platform.
[0089] Among them, the full data platform is used to store process data generated within a preset historical time range, and the preset historical time range includes a first historical time range and a second historical event range.
[0090] Exemplarily, the first historical time range may be within three days with the current moment as the end moment, and the second historical time range may be a time range with the start moment of the first historical time range as the end moment and lasting for a preset period of time. For example, if the second historical time range is three days ago, the full data platform is used to store full process data within three years, and the time data indicates that the first process is running within the second historical time range, that is, the process data of the first process is in the full data platform, and the first process was running three days ago.
[0091] In some embodiments, the third process is a process associated with the first process, that is, the third process may be a process that has a calling relationship with the first process, or a process concurrent with the first process, or any process that has an associated relationship with the first process during terminal operation. The second associated sample data is data generated by the operation of the third process, and may include information such as the process name, PID, user name, and alarm time of the third process.
[0092] In some embodiments, the second associated sample data may be obtained from the distributed cache server by indexing the process name, PID, user name, alarm time and other information in the cached process data based on a preset association relationship to obtain the first associated sample data.
[0093] In some embodiments, step 240 includes the following two steps:
[0094] first step In response to the moment data indicating that the first process is running within the second historical time range, an offline sample extraction task is created for the full data platform.
[0095] Among them, the offline sample extraction task is used to instruct to obtain sample data in the full data platform in an offline search manner.
[0096] In some embodiments, based on the sample features corresponding to the offline sample extraction task, the process name, PID, user name, alarm time and other information of the process data in the full data platform can be indexed and searched offline to obtain the process data corresponding to the offline sample extraction task.
[0097] Step 2 , the second associated sample data generated by the third process is obtained from the full data platform through the offline sample extraction task.
[0098] In some embodiments, the third process is a process associated with the first process, that is, the third process may be a process that has a calling relationship with the first process, or a process concurrent with the first process, or any process that has an associated relationship with the first process during terminal operation. The second associated sample data is data generated by the operation of the third process, and may include information such as the process name, PID, user name, and alarm time of the third process.
[0099] Step 250: Use the target sample data and the second associated sample data as process prediction sample data.
[0100] Among them, the process prediction sample data is used to test the prediction results of the process prediction task.
[0101] In some embodiments, the process prediction task is used to predict the running status of the process. For example, the process prediction task is used to predict whether the process is a black process, whether an alarm message is generated, whether the process ends abnormally, etc.
[0102] In some embodiments, the above step 250 includes the following two steps:
[0103] first step , storing the second associated sample data in the distributed cache server.
[0104] In some embodiments, the distributed storage server includes multiple node servers. In response to a target node server among the multiple node servers obtaining a sample storage task corresponding to the target sample data, the second associated sample data is stored in the target node server.
[0105] In some embodiments, the distributed cache server uses the time data or PID and other information of the second associated sample data as an index to store the second associated sample data.
[0106] Step 2, obtain the second associated sample data from the distributed cache server through a distributed collection method, and use the target sample data and the second associated sample data as process prediction sample data.
[0107] In some embodiments, the distributed storage server includes multiple node servers. In response to a target node server among the multiple node servers acquiring a distributed lock of a sample collection task corresponding to target sample data, the second associated sample data is acquired from the target node server.
[0108] In some embodiments, the target node server includes multiple container engines, and in response to the target container engine among the multiple container engines acquiring a distributed lock of the target sample data, the second associated sample is acquired from the target node server.
[0109] For illustration, please refer to Figure 7 , Figure 7 is a schematic diagram of obtaining second associated sample data provided by an exemplary embodiment of the present application, such as Figure 7 As shown, the distributed cache server 700 has multiple node servers, including node server 1, node server 2 to node server n, wherein node server 1 to node server n are all target node servers, that is, node server 1 to node server n respectively include multiple container engines, and the multiple container engines include container engine 1, container engine 2 to container engine 10. Assuming that container engine 1 to container engine 9 in each target node server seizes the distributed lock corresponding to the target sample data, the container engine 1 to container engine 9 in each target node server performs the sample collection task, that is, the container engine 1 to container engine 9 corresponding to each of node servers 1 to node server n respectively obtains the second associated sample data generated by the operation of the third process from node server 1 to node server n.
[0110] To summarize, the method provided in the embodiment of the present application, in response to the moment data indicating that the first process is running within the second historical time range, obtains the second associated sample data generated by the running of the third process associated with the first process from the full data platform, and uses the target sample data and the second associated sample data as process prediction sample data, thereby ensuring the comprehensiveness of data acquisition.
[0111] The method provided in the embodiment of the present application creates an offline sample extraction task to the full data platform in response to the moment data indicating that the first process is running within the second historical time range, and obtains the second associated sample data generated by the running of the third process from the full data platform through the offline sample extraction task, thereby realizing the extraction of the second associated sample data from a large amount of process data.
[0112] The method provided in the embodiment of the present application stores the second associated sample data in a distributed cache server, obtains the second associated sample data from the distributed cache server through a distributed collection method, and uses the target sample data and the second associated sample data as process prediction sample data. By storing the second associated sample data in the distributed cache server, when there is a demand for sample data acquisition, the second associated sample data is obtained from the distributed cache server through a distributed collection method, thereby improving data acquisition efficiency.
[0113] Please refer to Figure 8 , Figure 8 is a flow chart of a real-time data storage method provided by an exemplary embodiment of the present application. Figure 8 As shown, the method comprises the following steps:
[0114] Step 810, obtaining a data consumption queue.
[0115] The data consumption queue is used to store the real-time generated process data in queue order.
[0116] In some embodiments, the data consumption queue stores the real-time generated process data in queue order according to the first-in-first-out principle, that is, the process data generated at the starting time is stored at the head of the queue, and the real-time generated process data is queued and stored in chronological order.
[0117] Step 820, obtaining real-time process data from the data consumption queue.
[0118] In some embodiments, the stored real-time data is read according to the first-in-first-out principle, that is, the real-time process data stored at the head of the queue is first obtained, and the subsequent trial process data is sequentially obtained according to the queue order.
[0119] Step 830, dynamically back up the real-time process data to obtain backup process data.
[0120] In some embodiments, the real-time process data is dynamically backed up according to a preset historical cycle, such as taking three days as a backup cycle, and dynamically backing up the real-time process data of the most recent three days to obtain the backup process data of the most recent three days.
[0121] Step 840, the backup process data is distributedly stored in the distributed cache server, and the real-time process data is stored in the full data platform.
[0122] In some embodiments, the trial process data of the last three days, ie, the backup process data, is stored in a distributed cache server, and all real-time process data is stored in a full data platform.
[0123] For illustration, please refer to Fig. 9 , Fig. 9 is a schematic diagram of data caching provided by an exemplary embodiment of the present application, such as Fig. 9 As shown, a data consumption queue 910 is obtained, real-time process data 901 is obtained from the data consumption queue 910, the real-time process data 901 is dynamically backed up to obtain backup process data 902, the backup process data 902 is distributedly stored in a distributed cache server 920, and the real-time process data 901 is stored in a full data platform 930.
[0124] To summarize, the method provided in the embodiment of the present application obtains real-time process data from the acquired data consumption queue, dynamically backs up the real-time process data, obtains backup process data, and distributes the backup process data in a distributed cache server, and stores the real-time process data in a full data platform, and stores the real-time process data in a distributed server and a full data platform according to time periods, respectively, so that the sample data acquisition method can acquire sample data based on the full data platform and distributed servers that store the real-time process data and the backup process data, thereby improving data acquisition efficiency and integrity.
[0125] Please refer to Fig.10 , Fig.10 is a flow chart of a process prediction method provided by an exemplary embodiment of the present application. Fig.10 As shown, in some embodiments, the above step 230 further includes the following steps:
[0126] Step 1010, obtaining a process prediction task.
[0127] Among them, the process prediction task is used to predict the process operation status.
[0128] Exemplarily, the process prediction task is used to predict whether the process is a black process, whether an alarm message is generated, whether the process ends abnormally, etc.
[0129] Step 1020: Obtain prediction sample data based on the process prediction task.
[0130] The prediction sample data is annotated with reference labels for indicating the process running status.
[0131] In some embodiments, task reference labels based on different process predictions may include different labels such as "black process" and "normal process", "generating alarm information" and "not generating alarm information", "abnormal end" and "normal end".
[0132] Step 1030 , performing process prediction on the target sample data and the first associated sample data in the process prediction sample data through a process prediction program corresponding to the process prediction task, and obtaining a process prediction result.
[0133] Optionally, the prediction method adopted by the process prediction program includes at least one of rule prediction, AI prediction, and hash matching. Among them, rule prediction refers to generating prediction results corresponding to prediction sample data based on preset rules; AI prediction refers to obtaining prediction results corresponding to prediction sample data through a pre-trained AI model; hash matching refers to matching the hash values of prediction sample data through a platform that stores a large number of hash values corresponding to processes, and generating prediction results corresponding to the prediction sample data based on the matching results. Among them, the training process of the AI model can be implemented as obtaining prediction sample data marked with reference labels, performing process prediction on the prediction sample data through a candidate AI model to obtain sample prediction results, determining a prediction loss value based on the difference between the sample prediction result and the reference label, and training the candidate AI model based on the prediction loss value to obtain an AI model.
[0134] Exemplarily, the process prediction task is to detect black processes including Trojan viruses. The prediction results include two situations: "black process" and "normal process". When the process prediction program adopts a rule prediction method, the preset rule is implemented as a Trojan virus generated during process operation. The prediction result is obtained based on the query of the inclusion of Trojan viruses in the sample prediction data, wherein the prediction result corresponding to the predicted sample data containing Trojan viruses is "black process", otherwise, it is "normal process"; when the process prediction program adopts an AI prediction method, the AI model is a pre-trained black process detection model, and the sample prediction data is input into the black process detection model to output the prediction result; when the process prediction program adopts a hash matching method, the hash value corresponding to the predicted sample data is matched through the MD5 platform. If there is a hash value in the MD5 platform that is consistent with the hash value corresponding to the predicted sample data, the prediction result of the predicted sample data is "black process", otherwise, the prediction result is "normal process".
[0135] Step 1040 , generating a test result of the process prediction program based on the reference tag and the process prediction result.
[0136] The test results are used to indicate the detection rate of the process prediction program for the alarm process.
[0137] In some embodiments, the test of the prediction result of the process prediction task is implemented by comparing the prediction result with the reference label. If the reference label of the predicted sample data is consistent with the prediction result, the process prediction program detects correctly, otherwise the detection is incorrect. The test result can be implemented as the detection result of a single prediction sample data, or as the detection rate of the process prediction program for multiple prediction sample data.
[0138] Exemplarily, if the process prediction result of a certain prediction sample data is "normal process" and the reference label of the prediction sample data is "black process", the prediction result is inconsistent with the reference label, and a test result of "not detected" is generated; if the process prediction result of a certain prediction sample data is "black process" and the reference label of the prediction sample data is "black process", the prediction result is consistent with the reference label, and a test result of "detected" is generated. The prediction results of multiple prediction sample data are tested, and the detection rate of the process prediction program for multiple prediction sample data is determined based on the ratio of the number of "detected" results in the multiple test results to the number of test results.
[0139] To summarize, the method provided in the embodiments of the present application obtains a process prediction task, obtains prediction sample data based on the process prediction task, performs process prediction on the target sample data and the first associated sample data in the process prediction sample data through a process prediction program corresponding to the process prediction task, obtains a process prediction result, generates a test result of the process prediction program based on the reference label and the process prediction result, and implements testing of the process prediction result.
[0140] Please refer to Fig.11 , Fig.11 is a schematic diagram of a sample data acquisition system framework provided by an exemplary embodiment of the present application. Fig.11 As shown, the sample data acquisition system includes a scheduling server 1110 , a sample file transfer server 1120 , and a distributed cache server 1130 .
[0141] Among them, the scheduling server 1110 is used to obtain target sample data, which is data generated by the operation of the first process in the terminal. The target sample data is used to indicate the operation status of the first process, and the target sample data includes time data corresponding to the operation of the first process; in response to the time data indicating that the first process is running within the first historical time range, a data acquisition request is sent to the sample file transfer server 1120, and the data acquisition request includes the target sample data.
[0142] The sample file transfer server 1120 is used to receive a data acquisition request; based on the data acquisition request, send a data search instruction to the distributed cache server, where the data search instruction is used to instruct the distributed cache server to acquire sample data associated with the first process.
[0143] The distributed cache server 1130 is used to receive a data acquisition request; based on the data acquisition request, it acquires the first associated sample data generated by the running of the second process associated with the first process, and the distributed cache server is used to cache the process data generated within a first historical time range, and the first historical time range is a time range with the current moment as the end moment and lasting for a preset time period; the target sample data and the first associated sample data are sent to the sample file reading server 1140, and the sample file reading server 1140 is used to send the target sample data and the first associated sample data as process prediction sample data to the process prediction terminal 1150.
[0144] In some embodiments, the process prediction terminal 1150 is used to obtain a process prediction task, obtain prediction sample data based on the process prediction task, perform process prediction on the target sample data and the first associated sample data in the process prediction sample data through a process prediction program corresponding to the process prediction task, obtain a process prediction result, generate a test result of the process prediction program based on the reference label and the process prediction result, and implement testing of the process prediction result.
[0145] For illustration, please refer to Fig.12 , Fig.12 is a schematic diagram of a sample data acquisition system provided by an exemplary embodiment of the present application. Fig.12 As shown, the sample data acquisition system includes a scheduling server 1210 , a sample file transfer server 1220 and a distributed cache server 1230 .
[0146] In some embodiments, the distributed cache server 1230 sends the target sample data and the first associated sample data to the sample file reading server 1240 , and the sample file reading server 1240 is used to send the target sample data and the first associated sample data as process prediction sample data to the process prediction terminal 1250 .
[0147] In some embodiments, the scheduling server 1210 includes a work order system 1211, a sample management platform 1212 and an asynchronous scheduling server 1213. The work order system 1211 is used to automatically obtain the first process and enter the target sample data corresponding to the first process into the sample management platform 1212. The sample management platform 1212 is used to store the target sample data sent by the work order system 1211 or manually entered by the operator, and send the target sample data to the asynchronous scheduling server 1213. The asynchronous scheduling server 1213 is used to send the target sample data to different data storage nodes for storage based on the time data.
[0148] In some embodiments, the data storage node includes a distributed cache server 1230 and a full data platform 1260. The distributed cache server 1230 is used to store target sample data within a first historical time range, and the full data platform 1260 is used to store all target sample data.
[0149] To summarize, the system provided by the embodiment of the present application obtains target sample data for indicating the running status of a first process, and in response to the time data corresponding to the running of the first process included in the target sample data indicating that the first process is running within a first historical time range, obtains first associated sample data generated by the running of a second process associated with the first process from a distributed cache server, and uses the target sample data and the first associated sample data as process prediction sample data for testing the prediction result of a process prediction task. By using a distributed cache server that caches the process data generated within the first historical time range, the search range of the first associated sample data of the target sample data is narrowed, the data acquisition efficiency is improved, the cost caused by resource consumption is reduced, and at the same time, the test efficiency and real-time performance of testing the prediction result of the process prediction task are improved.
[0150] In some embodiments, the above-mentioned distributed server adopts a distributed read-write cache design. Optionally, the distributed server may include a first data platform and a second data platform. The first data platform is used for distributed caching of backup process data obtained based on dynamic backup of real-time process data and target sample data within a first historical time range. The second data platform includes multiple sample files, and process prediction sample data is stored in the multiple sample files. Among them, the process prediction sample data may include a corresponding relationship between the target sample data and the first associated sample data, or a corresponding relationship between the target sample data and the second associated sample data. Among them, the sample file including the corresponding relationship between the target sample data and the first associated sample data is a data file generated by the distributed server based on the target sample data within the first historical time range stored in the first data platform, obtaining the first associated sample data corresponding to the target sample data from the backup process data stored in the first data platform, and using the target sample data and the first associated sample data as process prediction sample data; the sample file including the corresponding relationship between the target sample data and the second associated sample data is a data file generated by the distributed server based on the target sample data and the second associated sample data obtained from the full data platform.
[0151] For illustration, please refer to Fig.13 , Fig.13 FIG. 1 is a schematic diagram of a distributed cache server structure provided by an exemplary embodiment of the present application. Fig.13As shown, the distributed cache server 1300 includes a first data platform 1310 and a second data platform 1320. The first data platform 1310 receives and caches target sample data 1301 within three days sent by the scheduling server 1330. The first data platform 1310 dynamically backs up the real-time process data 1302 in the data consumption queue 1340, obtains and caches the backup process data 1303; the second data platform 1340 obtains the first associated sample data 1304 from the backup process data 1303 based on the target sample data 1301, uses the target sample data 1301 and the first associated sample data 1304 as process prediction sample data to generate a sample file 1305 corresponding to the process sample data and caches it; the second data platform 1340 receives and caches the target sample data 1306 and the second associated sample data 1307 three days ago sent by the scheduling server 1330, uses the target sample data 1306 and the second associated sample data 1307 as process prediction sample data to generate and cache a sample file 1308 corresponding to the process sample data.
[0152] In some embodiments, the distributed server includes multiple node servers, and the multiple node servers respectively include multiple container engines. The multiple node servers or multiple container engines respectively execute the tasks corresponding to the distributed locks by seizing the distributed locks corresponding to the multiple tasks. For example, if some of the multiple node servers seize the distributed locks corresponding to the data acquisition task, then some of the node servers execute the data acquisition task. If other node servers seize the distributed locks corresponding to the data caching task, then the other node servers execute the data caching task.
[0153] In some embodiments, assuming that a target node server among multiple node servers includes multiple container engines, and the target node server seizes multiple distributed locks corresponding to the data acquisition task, multiple container engines seize one from the multiple distributed locks respectively, and execute the data acquisition task corresponding to the distributed lock to obtain the corresponding target data. Optionally, the target data can be any data stored in a distributed server, such as target sample data, first associated sample data, and second associated sample data, which is not limited in this application.
[0154] For illustration, please refer to Fig.14 , Fig.14 FIG. 1 is a distributed read schematic diagram of a distributed cache server provided by an exemplary embodiment of the present application. Fig.14As shown, the distributed cache server 1400 includes multiple node servers, namely node server 1 to node server n, and the multiple node servers respectively include 10 container engines, namely container engine 1 to container engine 10. The container engines 1 to container engine 10 in the multiple node servers are used to execute sample file reading tasks. The container engines 1 to container engine 10 in the multiple node servers seize the multiple distributed locks 1410 corresponding to the sample file reading tasks. Based on the multiple distributed locks 1410, the container engines 1 to container engine 10 in the multiple node servers execute their respective corresponding sample file reading tasks, determine the associated sample data that need to be read based on the target sample data in the preset target sample data list 1420, obtain the associated sample data corresponding to the target sample data from the sample file 1430, and send the read associated sample data to the process prediction terminal 1401.
[0155] In some embodiments, it is assumed that a target node server among multiple node servers includes multiple container engines, and the target node server seizes multiple distributed locks corresponding to the data caching task. If some of the multiple container engines seize the distributed locks corresponding to the backup data caching task in the data caching task from multiple distributed locks, then these part of the container engines execute the backup data caching task, cache the backup process data obtained by dynamic backup based on real-time process data, and generate sample files. If other container engines seize the distributed locks corresponding to the full data caching task in the data caching task from multiple distributed locks, then the other container engines execute the full data caching task, cache the specified sample data in the full data platform, and generate sample files.
[0156] For illustration, please refer to Fig.15 , Fig.15 FIG. 1 is a distributed cache schematic diagram of a distributed cache server provided by an exemplary embodiment of the present application. Fig.15As shown, the distributed cache server 1500 includes multiple node servers, and the multiple node servers respectively include 10 container engines, namely container engine 1 to container engine 10. The container engines 1 to container engine 10 in the multiple node servers are used to execute the sample file cache task, wherein the container engines 1 to container engine 9 in the multiple node servers that seize the distributed lock 1510 corresponding to the backup data cache task are used to execute the backup data cache task, and the container engine 10 in the multiple node servers that seize the distributed lock 1520 corresponding to the sample data cache task is used to execute the sample data cache task. The container engines 1 to container engines 9 in the multiple node servers dynamically back up the real-time process data in the data consumption queue 1501, obtain and cache the backup process data indexed by the specified data information, and generate multiple sample files including the backup process data; the container engines 10 in the multiple node servers cache the specified sample data in the full data platform 1502 and generate sample files.
[0157] Fig.16 is a structural block diagram of a device for acquiring sample data provided by an exemplary embodiment of the present application, such as Fig.16 As shown, the device includes the following parts:
[0158] The target sample data acquisition module 1610 is used to acquire target sample data, which is data generated by the operation of the first process in the terminal. The target sample data is used to indicate the operation status of the first process, and the target sample data includes time data corresponding to the operation of the first process.
[0159] The first associated sample data acquisition module 1620 is used to obtain the first associated sample data generated by the operation of the second process associated with the first process from the distributed cache server in response to the moment data indicating that the first process is running within a first historical time range. The distributed cache server is used to cache the process data generated within the first historical time range. The first historical time range is a time range with the current moment as the end moment and lasting for a preset period of time.
[0160] The prediction sample data acquisition module 1630 is used to use the target sample data and the first associated sample data as process prediction sample data, and the process prediction sample data is used to test the prediction result of the process prediction task.
[0161] Please refer to Fig.17 , Fig.17 is a structural block diagram of a sample data acquisition device module provided by an exemplary embodiment of the present application, such as Fig.17 As shown, in some embodiments, the first associated sample data acquisition module 1620 includes:
[0162] The first associated sample data acquisition unit 1621 is used to acquire the first associated sample data generated by the second process from the target node server in response to the target node server among the multiple node servers acquiring the distributed lock of the sample acquisition task corresponding to the target sample data.
[0163] In some embodiments, the first associated sample data acquisition unit 1621 is used to obtain the distributed lock corresponding to the target sample data in response to the target container engine in the target node server, and obtain the first associated sample data generated by the second process running from the target node server through the target container engine.
[0164] In some embodiments, the apparatus further comprises:
[0165] The second associated sample data acquisition module 1640 is configured to acquire, from the full data platform, second associated sample data generated by the operation of a third process associated with the first process in response to the moment data indicating that the first process is running within a second historical time range;
[0166] The process prediction sample data acquisition module 1650 is used to use the target sample data and the second associated sample data as process prediction sample data, and the process prediction sample data is used to test the prediction result of the process prediction task.
[0167] In some embodiments, the second associated sample data acquisition module 1640 is used to create an offline sample extraction task to the full data platform in response to the moment data indicating that the first process is running within a second historical time range, and the offline sample extraction task is used to indicate the acquisition of sample data in the full data platform in an offline search manner; and the second associated sample data generated by the running of the third process is obtained from the full data platform through the offline sample extraction task.
[0168] In some embodiments, the process prediction sample data acquisition module 1650 is used to store the second associated sample data in the distributed cache server;
[0169] The second associated sample data is acquired from the distributed cache server in a distributed collection manner, and the target sample data and the second associated sample data are used as process prediction sample data.
[0170] In some embodiments, the apparatus further comprises:
[0171] The data consumption queue acquisition module 1601 is used to acquire a data consumption queue, and the data consumption queue is used to store the real-time generated process data in queue order;
[0172] A real-time process data acquisition module 1602 is used to acquire real-time process data from the data consumption queue;
[0173] A dynamic backup module 1603 is used to dynamically back up the real-time process data to obtain backup process data;
[0174] The data cache module 1604 is used to distribute and store the backup process data in the distributed cache server, and to store the real-time process data in the full data platform.
[0175] In some embodiments, the apparatus further comprises:
[0176] The process prediction task acquisition module 1660 is used to acquire the process prediction task, and the process prediction task is used to predict the process running status;
[0177] A prediction sample data acquisition module 1670, configured to acquire the prediction sample data based on the process prediction task, wherein the prediction sample data is annotated with a reference tag for indicating the process running status;
[0178] The process prediction module 1680 is used to perform process prediction on the target sample data and the first associated sample data in the process prediction sample data through the process prediction program corresponding to the process prediction task to obtain a process prediction result;
[0179] The test result generating module 1690 is used to generate the test result of the process prediction program based on the reference tag and the process prediction result, and the test result is used to indicate the detection rate of the process prediction program for the alarm process.
[0180] To summarize, the device provided by the embodiment of the present application obtains target sample data for indicating the running status of a first process, and in response to the time data corresponding to the running of the first process included in the target sample data indicating that the first process is running within a first historical time range, obtains first associated sample data generated by the running of a second process associated with the first process from a distributed cache server, and uses the target sample data and the first associated sample data as process prediction sample data for testing the prediction result of a process prediction task. By using a distributed cache server that caches the process data generated within the first historical time range, the number of offline tasks of a data platform storing full process data is reduced, the data acquisition efficiency is improved, the cost caused by resource consumption is reduced, and at the same time, the test efficiency and real-time performance of testing the prediction result of the process prediction task are improved.
[0181] It should be noted that the sample data acquisition device provided in the above embodiment is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0182] Fig.18 The structure block diagram of a terminal 1800 provided by an exemplary embodiment of the present application is shown. The terminal 1800 may be: a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III, Moving Picture Experts Group Audio Layer 3), an MP4 (Moving Picture Experts Group Audio Layer IV, Moving Picture Experts Group Audio Layer 4) player, a laptop computer or a desktop computer. The terminal 1800 may also be called a user device, a portable terminal, a laptop terminal, a desktop terminal or other names.
[0183] Typically, the terminal 1800 includes: a processor 1801 and a memory 1802 .
[0184] The processor 1801 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 1801 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 1801 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 1801 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 1801 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0185] The memory 1802 may include one or more computer-readable storage media, which may be non-transitory. The memory 1802 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 1802 is used to store at least one instruction, which is used to be executed by the processor 1801 to implement the method for obtaining sample data provided in the method embodiment of the present application.
[0186] In some embodiments, the terminal 1800 also includes other components, which can be understood by those skilled in the art. Fig.18 The structure shown in the figure does not constitute a limitation on the terminal 1800, and the terminal 1800 may include more or less components than those shown in the figure, or combine some components, or adopt a different component arrangement.
[0187] The embodiment of the present application also provides a computer device, which can be implemented as follows: Figure 1 The computer device includes a processor and a memory, wherein at least one instruction, at least one program, code set or instruction set is stored in the memory, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by the processor to implement the sample data acquisition method provided by the above-mentioned method embodiments.
[0188] An embodiment of the present application also provides a computer-readable storage medium, on which is stored at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by a processor to implement the sample data acquisition method provided in the above-mentioned method embodiments.
[0189] The embodiments of the present application also provide a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the method for obtaining sample data described in any of the above embodiments.
[0190] Optionally, the computer readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a solid state drive (SSD), or an optical disk. Among them, the random access memory may include a resistance random access memory (ReRAM) and a dynamic random access memory (DRAM). The serial numbers of the above embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments.
[0191] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0192] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for acquiring sample data, characterized in that: The method comprises: Acquire target sample data, where the target sample data is data generated by the operation of a first process in the terminal, and the target sample data is used to indicate the operation status of the first process, and the target sample data includes time data corresponding to the operation of the first process; In response to the moment data indicating that the first process is running within a first historical time range, first associated sample data generated by the running of a second process associated with the first process is obtained from a distributed cache server, and the distributed cache server is used to cache the process data generated within the first historical time range, where the first historical time range is a time range with the current moment as the end moment and lasting for a preset time period; The target sample data and the first associated sample data are used as process prediction sample data, and the process prediction sample data is used to test the prediction result of the process prediction task.
2. The method according to claim 1, characterized in that The distributed cache server includes multiple node servers; The step of acquiring, from the distributed cache server, first associated sample data generated by the execution of a second process associated with the first process includes: In response to a target node server among the multiple node servers acquiring a distributed lock of a sample acquisition task corresponding to the target sample data, the first associated sample data generated by the execution of the second process is acquired from the target node server.
3. The method according to claim 2, characterized in that The target node server includes multiple container engines; In response to a target node server among the multiple node servers acquiring a distributed lock of a sample acquisition task corresponding to the target sample data, acquiring the first associated sample data generated by the running of the second process from the target node server includes: In response to the target container engine in the target node server acquiring the distributed lock corresponding to the target sample data, the first associated sample data generated by the execution of the second process is acquired from the target node server through the target container engine.
4. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: In response to the moment data indicating that the first process is running within a second historical time range, obtaining second associated sample data generated by the running of a third process associated with the first process from the full data platform; The target sample data and the second associated sample data are used as process prediction sample data, and the process prediction sample data is used to test the prediction result of the process prediction task.
5. The method according to claim 4, characterized in that In response to the moment data indicating that the first process is running within a second historical time range, obtaining second associated sample data generated by the running of a third process associated with the first process from the full data platform includes: In response to the moment data indicating that the first process is running within a second historical time range, creating an offline sample extraction task for the full data platform, the offline sample extraction task is used to instruct to obtain sample data in the full data platform in an offline search manner; The second associated sample data generated by the execution of the third process is obtained from the full data platform through the offline sample extraction task.
6. The method according to claim 5, characterized in that The step of using the target sample data and the second associated sample data as process prediction sample data includes: storing the second associated sample data in the distributed cache server; The second associated sample data is acquired from the distributed cache server in a distributed collection manner, and the target sample data and the second associated sample data are used as process prediction sample data.
7. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: Obtain a data consumption queue, where the data consumption queue is used to store the process data generated in real time in a queue order; Acquire real-time process data from the data consumption queue; Dynamically backing up the real-time process data to obtain backup process data; The backup process data is distributedly stored in the distributed cache server, and the real-time process data is stored in the full data platform.
8. The method according to any one of claims 1 to 3, characterized in that: After taking the target sample data and the first associated sample data as process prediction sample data, the method further includes: Acquire a process prediction task, where the process prediction task is used to predict the process running status; Acquiring the prediction sample data based on the process prediction task, wherein the prediction sample data is annotated with a reference tag for indicating the process running status; Performing process prediction on the target sample data and the first associated sample data in the process prediction sample data through a process prediction program corresponding to the process prediction task to obtain a process prediction result; A test result of the process prediction program is generated based on the reference tag and the process prediction result, wherein the test result is used to indicate a detection rate of the process prediction program for an alarm process.
9. A sample data acquisition system, characterized in that: The system comprises: The scheduling server is configured to obtain target sample data, wherein the target sample data is data generated by the operation of a first process in a terminal, the target sample data is used to indicate the operation status of the first process, and the target sample data includes time data corresponding to the operation of the first process; in response to the time data indicating that the first process is running within a first historical time range, send a data acquisition request to a sample file transfer server, wherein the data acquisition request includes the target sample data; The sample file transfer server is used to receive the data acquisition request; based on the data acquisition request, send a data search instruction to the distributed cache server, wherein the data search instruction is used to instruct the distributed cache server to acquire the sample data associated with the first process; The distributed cache server is used to receive the data acquisition request; based on the data acquisition request, it obtains the first associated sample data generated by the second process associated with the first process, and the distributed cache server is used to cache the process data generated within the first historical time range, and the first historical time range is a time range with the current moment as the end moment and lasting for a preset time period; the target sample data and the first associated sample data are sent to the sample file reading server, and the sample file reading server is used to send the target sample data and the first associated sample data as process prediction sample data to the process prediction terminal.
10. A device for acquiring sample data, characterized in that: The device comprises: A target sample data acquisition module, used to acquire target sample data, wherein the target sample data is data generated by the operation of a first process in the terminal, the target sample data is used to indicate the operation status of the first process, and the target sample data includes time data corresponding to the operation of the first process; A first associated sample data acquisition module is configured to, in response to the moment data indicating that the first process is running within a first historical time range, acquire, from a distributed cache server, first associated sample data generated by the running of a second process associated with the first process, the distributed cache server being configured to cache process data generated within the first historical time range, wherein the first historical time range is a time range with the current moment as the end moment and lasting for a preset time period; The prediction sample data acquisition module is used to use the target sample data and the first associated sample data as process prediction sample data, and the process prediction sample data is used to test the prediction result of the process prediction task.
11. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the method for acquiring sample data according to any one of claims 1 to 8.
12. A computer-readable storage medium, characterized in that: The readable storage medium stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the method for acquiring sample data as described in any one of claims 1 to 8.
13. A computer program product, characterized in that It comprises a computer program or an instruction, and when the computer program or the instruction is executed by a processor, it implements the method for obtaining sample data as claimed in any one of claims 1 to 8.
