Detailed Description
In order to make those skilled in the art better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
FIG. 1 is a flow diagram of a method of running a task according to one embodiment of the present application. The method of fig. 1 is performed by a running device of a task.
As shown in fig. 1, at S102, after running a formal operation task, determining whether a target commissioning task exists, where the formal operation task is used to run a formal operation policy configured by a multi-layer service logic layer in the wind control system, and the target commissioning task is used to run a commissioning policy and a formal operation policy configured by a target service logic layer in the multi-layer service logic layer, and run formal operation policies configured by other service logic layers except the target service logic layer in the multi-layer service logic layer.
It should be noted that the wind control system in the method shown in fig. 1 is a system based on a hierarchical strategy. The hierarchical policy is to divide multiple business logic layers according to the control range of the wind control policy to perform policy system control, for example, the multiple business logic layers include but are not limited to a trusted layer, an identification layer, and a decision layer.
It should be further noted that the formal operation policy may be understood as a policy in a formal operation state, and the commissioning policy may be understood as a policy in a commissioning state, where the commissioning policy needs to evaluate whether landing data of the commissioning policy meets a service expectation in a commissioning manner. The essence of the formal operation task is an analysis process responsible for the business, and the formal operation task is independently and independently analyzed and responsible for the business. The operation result of the test run task is only used for evaluation and analysis of business students, and cannot cause interference to the business.
Specifically, in some embodiments, running a formal operational task is essentially running a formal operational policy of a multi-layer business logic layer configuration in the wind control system. When the formal operation strategy configured by the multiple service logic layers is operated, the operation result of the formal operation strategy of the previous service logic layer is output to the next service logic layer, namely the operation result of the formal operation strategy of the previous layer is depended when the formal strategy of the next service logic layer is operated. And outputting the running result of the formal running task when the formal running task is finished. The operation result of the formal operation task is a result obtained by combining the operation results of formal operation strategies of the multi-layer service logic layer.
For example, taking an example that the multi-layer service logic layer sequentially includes a trusted layer, an identification layer and a decision layer, an operation result obtained by operating a formal operation policy configured by the trusted layer needs to be output to the identification layer, an operation result obtained by operating a formal operation policy configured by the identification layer depends on the operation result of the trusted layer when operating the formal operation policy configured by the identification layer, an operation result obtained by operating the formal operation policy configured by the identification layer needs to be output to the decision layer, an operation result obtained by operating the formal operation policy configured by the decision layer depends on the operation result of the identification layer when operating the formal operation policy configured by the decision layer, and finally, the operation result obtained by operating the formal operation policy configured by the trusted layer, the operation result obtained by operating the formal operation policy configured by the identification layer and the operation result obtained.
Specifically, in some embodiments, the running target commissioning task is essentially running a commissioning policy and a formal running policy of a target service logic layer configuration in a multi-layer service logic layer, and running a formal running policy of other service logic layer configurations outside the multi-layer service logic layer. When the trial operation strategy configured by the target service logic layer is operated, the operation result of the formal operation strategy of the previous service logic layer of the target service logic layer is depended on, the operation result of the formal operation strategy configured by the target service logic layer needs to be output to the next service logic layer of the target service logic layer, and when the formal operation strategy configured by the next service logic layer is operated, the operation result of the formal operation strategy configured by the target service logic layer is depended on. And when the running of the test run task is finished, storing the running result of the test run task. Here, the operation result of the commissioning task includes an analysis log and data related to the commissioning task. That is, the running result of the commissioning task is not output to the external service, and the formal service is not interfered.
For example, taking an example that the multi-layer service logic layer sequentially includes a trusted layer, an identification layer, and a decision layer, where the target service logic layer is the identification layer, that is, when the target commissioning task is run, the commissioning policy and the formal operation policy configured by the identification layer need to be run, and the formal operation policy configured by the trusted layer and the formal operation policy configured by the decision layer need to be run. When the target trial operation task is operated, the formal operation strategy configured by the credible layer is operated to obtain the operation result of the credible layer, the operation result of the credible layer is relied on when the trial operation strategy configured by the identification layer is operated, the operation result of the credible layer is relied on when the formal operation strategy configured by the identification layer is operated, and then the operation result of the formal operation strategy configured by the identification layer is relied on when the formal operation strategy configured by the decision layer is operated. And storing analysis logs and data related to the target trial run task when the target trial run task is run.
Optionally, in some embodiments, the analysis log includes a specific wind control policy hit by the target commissioning task, for example, a trusted layer hit wind control policy a/wind control policy B, and an identification layer hit wind control policy C/wind control policy D. The data comprises event snapshots, variable snapshots, model snapshots and the like. The event snapshot can be understood as information of service requesters or service data, and the information of the service requesters is packaged into a wind control event in the wind control system. The variable snapshot may be understood as a specific value of a wind control policy condition, for example, one wind control policy condition is: and if the mobile phone number is in the blacklist, the comparison value is Ture/False, and the variable snapshot can record whether the mobile phone number passes or does not pass under the wind control strategy condition in the blacklist. The model snapshot can be understood as the score that the model of the system deployment runs out. For example, a neural network model is deployed in the system, and the neural network model is used for calculating the credible score of the user, and the model snapshot records the score calculated by the neural network model by the business data (when pen analysis).
Optionally, in some embodiments, determining whether the target commissioning task exists includes: judging whether a target commissioning task exists according to the commissioning strategy configuration conditions of the plurality of service logic layers; when a business logic layer configured with a trial operation strategy exists in a plurality of business logic layers, determining that a target trial operation task exists, and determining the business logic layer configured with the trial operation strategy as a target business logic layer; and when the business logic layer configured with the trial operation strategy does not exist in the plurality of business logic layers, determining that the target trial operation task does not exist.
As an example, when a service logic layer in which a tag corresponding to the configured policy is a target tag exists among the plurality of service logic layers, it is determined that a service logic layer in which a commissioning policy is configured exists among the plurality of service logic layers. Or it can be understood that different labels (tag) are allocated to the formal operation policy and the trial operation policy, and whether the formal operation policy or the trial operation policy is configured for one service logic layer can be determined according to the labels.
Further, in some embodiments, when it is determined that the commissioning task switches set in the multiple service logic layers are in an on state, whether the target commissioning task exists is determined according to a commissioning policy configuration condition of the multiple service logic layers. That is to say, when determining whether the target commissioning task exists, first, it is determined whether a set service logic layer with the commissioning task switch in an on state exists in the plurality of service logic layers, and if the set service logic layer with the commissioning task switch in the on state does not exist, it is directly determined that the target commissioning task does not exist. If the set service logic layer with the trial operation task switch in the on state exists, the trial operation strategy configuration condition of the service logic layer with the trial operation task switch in the on state is further judged, if the service logic layer with the trial operation task switch in the on state is configured with the trial operation strategy, the target trial operation task is determined to exist, and the service logic layer configured with the trial operation strategy is determined to be the target service logic layer. And if the service logic layer of the trial operation task switch in the on state is not configured with the trial operation strategy, determining that the target trial operation task does not exist.
Optionally, in some embodiments, a domain (or referred to as a tenant) may initiate a commissioning task separately for each business logic layer. Or it can be understood that, for a tenant, the commissioning task only runs the commissioning policy and the formal operation policy configured on one service logic layer, and runs the formal operation policies configured on other service logic layers. The domains may be divided according to risk types corresponding to the services, and one service may have multiple domains. For example, a business may correspond to three risk types of account theft, marketing cheating, and merchant risk, and the business may include three domains of account theft, marketing cheating, and merchant risk.
And S104, when the target commissioning task exists, starting an asynchronous thread to run the target commissioning task.
It should be noted that starting the asynchronous thread at S104 may be understood as starting a new thread independent of the thread running the formal running task. Therefore, the test run task is operated independently of the formal run task and is completely isolated from the operation process of the formal run task, and the decoupling of the operation result of the test run task and the operation result of the formal run task is realized.
Optionally, in some embodiments, the number of the target commissioning tasks is multiple, and starting the asynchronous thread to execute the target commissioning task includes: starting an asynchronous thread; and running a plurality of target test run tasks through the asynchronous thread. For example, for an air control system or a service with low timeliness requirement, a target trial run task is added into a trial run task queue, an asynchronous thread is started, and the plurality of target trial run tasks are run according to the sequence of the target trial run task in the trial run task queue. Here, the commissioning tasks of different tenants can run concurrently on one asynchronous thread.
Optionally, in some other embodiments, the number of the target commissioning tasks is multiple, and starting the asynchronous thread to execute the target commissioning task includes: starting a plurality of asynchronous threads; and executing a plurality of target commissioning tasks through the plurality of asynchronous threads, wherein the target commissioning tasks executed by different asynchronous threads are different. For example, for a wind control system or service with a high timeliness requirement, multiple asynchronous threads can be started, multiple commissioning tasks can be run simultaneously, the processing speed of the commissioning tasks can be increased, and the timeliness requirement of the wind control system or service is met.
For example, if there are 4 target commissioning tasks to be run, 4 asynchronous threads may be started to execute the 4 target commissioning tasks of the simultaneous performers, and each asynchronous thread executes one target commissioning task. But less than 4 asynchronous threads may be turned on to perform these 4 target commissioning tasks. The number of the specifically started asynchronous threads can be determined according to the requirement of the system or the service on timeliness and the configuration condition of system resources.
The method for operating the task according to a specific embodiment of the present application will be described in detail below with reference to fig. 2. The method shown in fig. 2 is performed by a task execution device. The method shown in fig. 2 may be applied to a hierarchical policy based wind control system.
As shown in fig. 2, at S202, traffic enters the wind control system.
At S204, the executive task windmills the traffic.
At S206, a service post-processing is performed to determine whether to perform a commissioning task.
It should be noted that if the task itself executed at S204 is a commissioning task, a new commissioning task is not derived, i.e., it is determined at S206 not to execute the commissioning task. If the task is formally run during the task running at S204, whether to execute the trial running task is determined based on the service configuration information, where the service configuration information may specifically indicate the on state of a trial running task switch set in each service logic layer and indicate the service logic layer configured with the trial running policy.
At S208, if the commissioning task is executed, the asynchronous thread is started to execute the commissioning task.
Specifically, the essence of executing the commissioning task is to execute the commissioning policy and the formal operation policy configured by the service logic layer configured with the commissioning policy indicated by the service configuration information, and to execute the formal operation policy configured by other service logic layers.
Alternatively, the number of started asynchronous threads may be determined according to the number of the commissioning tasks.
At S210, if the trial run task is not executed, a running result of the task is acquired.
It is understood that, if the task executed at S204 is a formal running task, the running result of the task may be output to the peripheral service after being acquired at S210. If the task executed at S204 is a commissioning task, at S210, only the analysis log and data related to the commissioning task are saved after the operation result of the task is obtained, where the analysis log and data related to the commissioning task are similar to those in the method shown in fig. 1, and in order to avoid repetition, detailed description is omitted here. And the stored analysis log and data are used for evaluation and analysis by business classmates, and the interference to formal business is avoided.
The operation method of the service according to the embodiment of the present application is described in detail above with reference to fig. 1 and fig. 2. An electronic device according to an embodiment of the present application will be described in detail below with reference to fig. 3. Referring to fig. 3, at a hardware level, the electronic device includes a processor, optionally an internal bus, a network interface, and a memory. The Memory may include a Memory, such as a Random-Access Memory (RAM), and may further include a non-volatile Memory, such as at least 1 disk Memory. Of course, the electronic device may also include hardware required for other services.
The processor, the network interface, and the memory may be interconnected by an internal bus, which may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an extended EISA (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 3, but this does not indicate only one bus or one type of bus.
And the memory is used for storing programs. In particular, the program may include program code comprising computer operating instructions. The memory may include both memory and non-volatile storage and provides instructions and data to the processor.
The processor reads the corresponding computer program from the nonvolatile memory into the memory and then runs the computer program, and forms a running device of the task on a logic level. The processor is used for executing the program stored in the memory and is specifically used for executing the following operations:
after running a formal running task, judging whether a target trial running task exists, wherein the formal running task is used for running a formal running strategy configured by a multi-layer service logic layer in a wind control system, and the target trial running task is used for running a trial running strategy and a formal running strategy configured by the target service logic layer in the multi-layer service logic layer and running formal running strategies configured by other service logic layers except the target service logic layer in the multi-layer service logic layer;
and when the target commissioning task exists, starting an asynchronous thread to run the target commissioning task.
The method performed by the execution device of the tasks disclosed in the embodiments of fig. 1 and fig. 2 of the present application can be applied to or implemented by a processor. The processor may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in a processor or instructions in the form of software. The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components. The various methods, steps, and logic blocks disclosed in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in a memory, and a processor reads information in the memory and completes the steps of the method in combination with hardware of the processor.
Of course, besides the software implementation, the electronic device of the present application does not exclude other implementations, such as a logic device or a combination of software and hardware, and the like, that is, the execution subject of the following processing flow is not limited to each logic unit, and may also be hardware or a logic device.
Embodiments of the present application also propose a computer-readable storage medium storing one or more programs, the one or more programs including instructions, which when executed by an electronic device including a plurality of application programs, enable the electronic device to perform the method of the embodiment shown in fig. 1 and 2, and in particular to perform the following method:
after running a formal running task, judging whether a target trial running task exists, wherein the formal running task is used for running a formal running strategy configured by a multi-layer service logic layer in a wind control system, and the target trial running task is used for running a trial running strategy and a formal running strategy configured by the target service logic layer in the multi-layer service logic layer and running formal running strategies configured by other service logic layers except the target service logic layer in the multi-layer service logic layer;
and when the target commissioning task exists, starting an asynchronous thread to run the target commissioning task.
Fig. 4 is a schematic structural diagram of an operating device of a task of an embodiment of the present application. Referring to fig. 4, in a software implementation, the task execution device 400 may include: a judging unit 401 and a task executing unit 402, wherein,
a determining unit 401, configured to determine whether there is a target commissioning task after running a formal operation task, where the formal operation task is used to run a formal operation policy configured by a multi-layer service logic layer in the wind control system, and the target commissioning task is used to run a commissioning policy and a formal operation policy configured by a target service logic layer in the multi-layer service logic layer, and run a formal operation policy configured by another service logic layer other than the target service logic layer in the multi-layer service logic layer
And the task running unit 402 is used for starting an asynchronous thread to run the target trial running task when the target trial running task exists.
After the running device of the task runs the formal running task, if the target trial running task exists, the asynchronous thread is started to run the target trial running task, so that the trial running task runs independently relative to the formal running task and is thoroughly isolated from the running process of the formal running task, the running result of the trial running task and the running result of the formal running task can be decoupled, the data for service evaluation and the data output to the external service are decoupled, and the complexity of stripping and merging decision results in a wind control system is reduced.
Optionally, as an embodiment, the determining unit 401:
judging whether a target commissioning task exists according to the commissioning strategy configuration conditions of the plurality of service logic layers;
when a business logic layer configured with a trial operation strategy exists in the plurality of business logic layers, determining that a target trial operation task exists, and determining the business logic layer configured with the trial operation strategy as the target business logic layer;
and when the service logic layer configured with the trial operation strategy does not exist in the plurality of service layers, determining that the target trial operation task does not exist.
Optionally, as an embodiment, the determining unit 401:
and when a service logic layer with a label corresponding to the configured strategy as a target label exists in the plurality of service logic layers, determining that the service logic layer configured with the commissioning strategy exists in the plurality of service logic layers.
Optionally, as an embodiment, the determining unit 401:
when the trial operation task switches arranged on the plurality of service logic layers are determined to be in an open state, judging whether a target trial operation task exists according to the trial operation strategy configuration conditions of the plurality of service logic layers;
optionally, as an embodiment, the number of the target commissioning tasks is multiple;
wherein the task execution unit 402:
starting an asynchronous thread;
and running a plurality of target test run tasks through the asynchronous thread.
Optionally, as an embodiment, the number of the target commissioning tasks is multiple;
wherein the task execution unit 402:
starting a plurality of asynchronous threads;
and running a plurality of target trial running tasks through the plurality of asynchronous threads, wherein the target trial running tasks executed by different asynchronous threads are different.
Optionally, as an embodiment, as shown in fig. 4, the running device 400 of the task further includes a result processing unit 403;
the result processing unit 403: and outputting the running result of the formal running task when the formal running task is run.
Optionally, as an embodiment, as shown in fig. 4, the running device 400 of the task further includes a result processing unit 403;
the result processing unit 403: and when the target trial run task is run, storing the running result of the target trial run task, wherein the running result of the target trial run task comprises analysis logs and data related to the target trial run task.
The task running device 400 may also execute the method in the embodiment shown in fig. 1 and fig. 2, and implement the function of the task running device in the embodiment shown in fig. 1 and fig. 2, which is not described herein again in this embodiment of the present application.
In short, the above description is only a preferred embodiment of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.