CN110007967B - Data processing method, device and equipment based on streaming framework - Google Patents

Data processing method, device and equipment based on streaming framework Download PDF

Info

Publication number
CN110007967B
CN110007967B CN201711470644.7A CN201711470644A CN110007967B CN 110007967 B CN110007967 B CN 110007967B CN 201711470644 A CN201711470644 A CN 201711470644A CN 110007967 B CN110007967 B CN 110007967B
Authority
CN
China
Prior art keywords
analysis unit
data
output
analysis
processed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201711470644.7A
Other languages
Chinese (zh)
Other versions
CN110007967A (en
Inventor
周胜凯
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Hikvision Digital Technology Co Ltd
Original Assignee
Hangzhou Hikvision Digital Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Priority to CN201711470644.7A priority Critical patent/CN110007967B/en
Publication of CN110007967A publication Critical patent/CN110007967A/en
Application granted granted Critical
Publication of CN110007967B publication Critical patent/CN110007967B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The embodiment of the invention provides a data processing method, a device and equipment based on a streaming framework, wherein the method comprises the following steps: acquiring task parameters corresponding to data to be processed; determining an analysis unit for processing the data to be processed and an analysis sequence of the analysis unit according to the task parameters; loading the determined analysis unit; connecting each loaded analysis unit according to the analysis sequence to obtain an analysis unit combination; inputting the data to be processed into the analysis unit combination, and analyzing the data to be processed by utilizing the thread contained in each analysis unit; and acquiring a processing result according to the output content of the analysis unit combination. Therefore, in the scheme, after the task parameters are obtained, the analysis unit is loaded, the analysis unit does not continuously run in a process mode, and after the analysis unit is loaded, the data is analyzed by using the threads contained in the analysis unit.

Description

Data processing method, device and equipment based on streaming framework
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a data processing method, apparatus, and device based on a streaming framework.
Background
In some scenarios with large data processing amount, a streaming framework is usually applied for data processing. Streaming frameworks such as Storm can be applied to data processing in various scenarios such as real-time analysis, online machine learning, continuous computation, distributed remote invocation, and the like.
However, in the process of data processing by applying Storm, each analysis unit continuously runs in a process mode, and a large amount of resources are occupied.
Disclosure of Invention
The embodiment of the invention aims to provide a data processing method, a data processing device and data processing equipment based on a streaming framework, so as to reduce the resource occupancy rate.
To achieve the above object, an embodiment of the present invention provides a data processing method based on a streaming framework, including:
acquiring task parameters corresponding to data to be processed;
determining an analysis unit for processing the data to be processed and an analysis sequence of the analysis unit according to the task parameters; wherein each analysis unit comprises an independent thread;
loading the determined analysis unit; connecting each loaded analysis unit according to the analysis sequence to obtain an analysis unit combination;
acquiring the data to be processed, inputting the data to be processed into the analysis unit combination, and analyzing the data to be processed by using threads contained in each analysis unit in the analysis unit combination;
and acquiring a processing result according to the output content of the analysis unit combination.
Optionally, the obtaining of the task parameter corresponding to the data to be processed may include:
acquiring a first configuration file corresponding to data to be processed;
the determining, according to the task parameter, an analysis unit that processes the data to be processed and an analysis order of the analysis unit may include:
and determining an analysis unit for processing the data to be processed and an analysis sequence of the analysis unit according to the identification and the identification sequence of the analysis unit contained in the first configuration file.
Optionally, after acquiring the data to be processed, the method may further include: generating a structural body object with a preset structure aiming at the data to be processed;
the inputting the data to be processed into the analysis unit combination, and analyzing the data to be processed by using the thread included in each analysis unit in the analysis unit combination, includes:
inputting the structural body object into a first analysis unit in the analysis unit combination, analyzing the structural body object by using threads contained in the first analysis unit to obtain an analysis result, and adding the analysis result to the structural body object to obtain an output object of the first analysis unit;
according to the analysis sequence, sequentially determining each analysis unit behind the first analysis unit as a current analysis unit; inputting an output object of a last analysis unit of a current analysis unit into the current analysis unit, analyzing the output object of the last analysis unit by using a thread contained in the current analysis unit to obtain an analysis result, and adding the analysis result to the output object of the last analysis unit to obtain the output object of the current analysis unit;
the acquiring a processing result according to the output content of the analysis unit combination may include:
and acquiring a processing result according to the output object of the last analysis unit in the analysis unit combination.
Optionally, after obtaining the output object of the first analysis unit, the method may further include:
adding the output object of the first analysis unit to the output queue of the first analysis unit;
the inputting the output object of the last analysis unit of the current analysis unit into the current analysis unit comprises:
sequentially reading the output object of the last analysis unit from the input queue of the current analysis unit according to a preset queue sequence;
after the obtaining of the output object of the current analysis unit, the method further includes:
and adding the output object of the current unit to the output queue of the current analysis unit.
Optionally, the obtaining a processing result according to an output object of a last analysis unit in the analysis unit combination may include:
judging whether the output object of the last analysis unit in the analysis unit combination meets the output condition;
if yes, acquiring a processing result from an output object of the last analysis unit;
and if not, returning to execute the step of inputting the structural body object into the first analysis unit in the analysis unit combination.
Optionally, before acquiring the data to be processed, the method may further include: acquiring a second configuration file corresponding to the data to be processed;
reading an identifier of an interactive accessory library contained in the second configuration file, and loading an interactive accessory inventory corresponding to the read identifier, wherein the interactive accessory library comprises an input interface, an output interface, an assembly accessory and a detection accessory;
after acquiring the data to be processed, the method may further include:
calling the input interface, and inputting the data to be processed into the interactive accessory library;
the generating a structural body object with a preset structure for the data to be processed may include:
assembling the data to be processed by using the assembly accessories to generate a structural body object with a preset structure;
the determining whether the output object of the last analysis unit in the analysis unit combination satisfies the output condition may include:
calling the detection accessory, detecting an output object of the last analysis unit in the analysis unit combination, and judging whether a detection result meets an output condition;
after obtaining the processing result from the output object of the last analysis unit, the method may further include:
and calling the output interface and outputting the processing result.
Optionally, the interaction accessory library further includes a deletion accessory, and after the output interface is called and the processing result is output, the method may further include:
and calling the deletion accessory to delete the output object of the last analysis unit.
Optionally, after obtaining the processing result according to the output content of the analysis unit combination, the method may further include: unloading the analysis units in the analysis unit combination.
In order to achieve the above object, an embodiment of the present invention further provides a data processing apparatus based on a streaming framework, including:
the first acquisition module is used for acquiring task parameters corresponding to data to be processed;
the determining module is used for determining an analysis unit for processing the data to be processed and an analysis sequence of the analysis unit according to the task parameters; wherein each analysis unit comprises an independent thread;
the first loading module is used for loading the determined analysis unit;
the connection module is used for connecting each loaded analysis unit according to the analysis sequence to obtain an analysis unit combination;
the second acquisition module is used for acquiring the data to be processed;
the analysis module is used for inputting the data to be processed into the analysis unit combination and analyzing the data to be processed by utilizing threads contained in each analysis unit in the analysis unit combination;
and the third acquisition module is used for acquiring a processing result according to the output content of the analysis unit combination.
Optionally, the first obtaining module may be specifically configured to: acquiring a first configuration file corresponding to data to be processed;
the determining module may be specifically configured to:
and determining an analysis unit for processing the data to be processed and an analysis sequence of the analysis unit according to the identification and the identification sequence of the analysis unit contained in the first configuration file.
Optionally, the apparatus may further include:
the generating module is used for generating a structural body object with a preset structure aiming at the data to be processed;
the analysis module may be specifically configured to:
inputting the structural body object into a first analysis unit in the analysis unit combination, analyzing the structural body object by using threads contained in the first analysis unit to obtain an analysis result, and adding the analysis result to the structural body object to obtain an output object of the first analysis unit;
according to the analysis sequence, sequentially determining each analysis unit behind the first analysis unit as a current analysis unit; inputting an output object of a last analysis unit of a current analysis unit into the current analysis unit, analyzing the output object of the last analysis unit by using a thread contained in the current analysis unit to obtain an analysis result, and adding the analysis result to the output object of the last analysis unit to obtain the output object of the current analysis unit;
the third obtaining module may be specifically configured to:
and acquiring a processing result according to the output object of the last analysis unit in the analysis unit combination.
Optionally, the apparatus may further include: a first adding module and a second adding module, wherein,
a first adding module, configured to add the output object of the first analysis unit to the output queue of the first analysis unit;
the analysis module is further configured to sequentially read an output object of the previous analysis unit from an input queue of the current analysis unit according to a preset queue order;
and the second adding module is used for adding the output object of the current unit into the output queue of the current analysis unit after the output object of the current analysis unit is obtained.
Optionally, the apparatus may further include:
the judging module is used for judging whether the output object of the last analysis unit in the analysis unit combination meets the output condition; if yes, triggering the third acquisition module; if not, triggering the analysis module;
the third obtaining module may be specifically configured to: and acquiring a processing result from an output object of the last analysis unit.
Optionally, the apparatus further comprises: a fourth obtaining module, a second loading module, an input module and an output module, wherein,
the fourth acquisition module is used for acquiring a second configuration file corresponding to the data to be processed;
the second loading module is used for reading the identification of the interactive accessory library contained in the second configuration file and loading the interactive accessory inventory corresponding to the read identification, wherein the interactive accessory library comprises an input interface, an output interface, an assembly accessory and a detection accessory;
the input module is used for calling the input interface and inputting the data to be processed into the interactive accessory library;
the generating module may be specifically configured to: assembling the data to be processed by using the assembly accessories to generate a structural body object with a preset structure;
the determining module may be specifically configured to:
calling the detection accessory, detecting an output object of the last analysis unit in the analysis unit combination, and judging whether a detection result meets an output condition;
and the output module is used for calling the output interface and outputting the processing result after the processing result is obtained from the output object of the last analysis unit.
Optionally, the interaction accessory library further includes a deletion accessory, and the apparatus may further include:
and the deleting module is used for calling the deleting accessory and deleting the output object of the last analysis unit.
Optionally, the apparatus may further include:
and the unloading module is used for unloading the analysis units in the analysis unit combination after acquiring the processing result according to the output content of the analysis unit combination.
In order to achieve the above object, an embodiment of the present invention further provides an electronic device, including a processor and a memory;
a memory for storing a computer program;
and the processor is used for realizing any data processing method based on the streaming framework when executing the program stored in the memory.
By applying the embodiment of the invention, after the task parameters are obtained, the analysis unit is loaded, the analysis unit does not continuously run in a process mode, and the data is analyzed by using the thread contained in the analysis unit after the analysis unit is loaded.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a first flowchart of a data processing method based on a streaming framework according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a second data processing method based on a streaming framework according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a streaming framework according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of an analysis unit and a pipeline according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of another streaming framework provided by embodiments of the present invention;
fig. 6 is a schematic structural diagram of a data processing apparatus based on a streaming framework according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, 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 invention.
In order to solve the technical problem, embodiments of the present invention provide a data processing method and apparatus based on a streaming framework, and an electronic device. The method and the device can be applied to various electronic devices, and are not limited specifically.
First, a data processing method based on a streaming framework according to an embodiment of the present invention is described in detail below.
Fig. 1 is a first schematic flow chart of a data processing method based on a streaming framework according to an embodiment of the present invention, including:
s101: and acquiring task parameters corresponding to the data to be processed.
For example, the data to be processed may be a video, an image, and the like, and is not limited in particular. It should be noted that in S101, the data to be processed is not acquired, but the task parameters corresponding to the data to be processed are acquired.
As an embodiment, S101 may include: and acquiring a first configuration file corresponding to the data to be processed. To distinguish from the profiles in the following, the profile acquired in S101 is referred to as a first profile. The first configuration file may include an identifier and an identifier sequence of the analysis unit, where the identifier and the identifier sequence of the analysis unit belong to the task parameter. Alternatively, the task parameter may also include a numerical value, and the corresponding relationship between the numerical value and the analysis unit identifier and the identification sequence is preset. The specific content of the task parameter is not limited.
S102: and determining an analysis unit for processing the data to be processed and an analysis sequence of the analysis unit according to the task parameter. Wherein each analysis unit comprises an independent thread.
As described above, the identifier of the analysis unit, that is, the identifier of the analysis unit that processes the to-be-processed data, and the identifier of the analysis unit may be a serial number, an ID, or the like, and is not limited specifically, and the identifier sequence is the processing sequence of each analysis unit that processes the to-be-processed data.
Taking the data to be processed as the video, for example, a plurality of processing steps such as decoding the video, detecting a person target, extracting a face feature, extracting a person clothes feature, and the like can be performed on the video, and each processing step can correspond to one analysis unit. The processing steps have a sequence, and correspondingly, the analysis units for processing the data to be processed also have an analysis sequence. For different data to be processed, the analysis units for processing the data may be different, and the analysis order of the analysis units for processing the data may also be different.
For example, a section of video includes face data, and multiple processing steps such as decoding the section of video, detecting a face target, and extracting face features are required, and each processing step may correspond to one analysis unit. Assume that three analysis units are determined to process the data to be processed: the device comprises an analysis unit 1, an analysis unit 2 and an analysis unit 3, wherein the analysis unit 1 is used for decoding data to be processed, the analysis unit 2 is used for detecting a face target in the data to be processed, and the analysis unit 3 is used for extracting face features in the data to be processed.
For another example, another video segment contains license plate data, and multiple processing steps such as decoding, vehicle target detection, license plate feature extraction, and the like need to be performed on the video segment, and each processing step may correspond to one analysis unit. Assume that three analysis units are determined to process the data to be processed: the system comprises an analysis unit 1, an analysis unit 4 and an analysis unit 5, wherein the analysis unit 1 is used for decoding data to be processed, the analysis unit 4 is used for detecting a vehicle target in the data to be processed, and the analysis unit 5 is used for extracting license plate features in the data to be processed.
Each analysis unit comprises an independent thread, and each analysis unit processes data to be processed by using the thread contained in the analysis unit.
S103: loading the determined analysis unit; and connecting the loaded analysis units according to the analysis sequence to obtain an analysis unit combination.
In the present device (execution main body) or another device communicatively connected to the present device, a plurality of analysis units are stored in advance in the form of plug-ins, and the determined analysis unit that processes the data to be processed is loaded to the memory.
The plurality of analysis units stored in advance may not have a connection relationship therebetween in advance. And after the determined analysis units are loaded to the memory and the analysis sequence of each analysis unit for processing the data to be processed is determined, connecting the loaded analysis units according to the analysis sequence to obtain an analysis unit combination. Therefore, the connection relation among the analysis units is adjustable, different connection relations can be established according to different data to be processed, and different analysis unit combinations can be obtained.
Continuing the above example, the data to be processed is a video segment containing face data, and the analysis unit 1-3 for processing the data to be processed is determined, and the analysis sequence is from front to back: analysis unit 1, analysis unit 2, analysis unit 3. The three analysis units are connected according to the analysis sequence, specifically, the output interface of the analysis unit 1 is connected with the input interface of the analysis unit 2, and the output interface of the analysis unit 2 is connected with the input interface of the analysis unit 3, so as to obtain an analysis unit combination.
S104: and acquiring the data to be processed, inputting the data to be processed into the analysis unit combination, and analyzing the data to be processed by using the threads contained in each analysis unit in the analysis unit combination.
For example, the task parameter acquired in S101 may further include address information of the data to be processed, where the address information may be a URL (Uniform Resource Locator), or may be other, which is not limited specifically. According to the address information, the data to be processed can be acquired.
Still taking the data to be processed as the video for illustration, firstly inputting the video into the analysis unit 1, and decoding the video by using the thread in the analysis unit 1 to obtain the decoded data; inputting the decoded data into an analysis unit 2, and detecting a face target in the decoded data by using a thread in the analysis unit 2 to obtain face target data; the face target data is input into the analysis unit 3, and the face features in the data to be processed are extracted by using the threads in the analysis unit 3 to obtain the face feature data.
S105: and acquiring a processing result according to the output content of the analysis unit combination.
As an embodiment, the output content may be directly used as the processing result; or, format conversion may be performed on the output content, and the converted data may be used as a processing result; or, valid data may be extracted from the output content as a processing result, and the like, which is not limited in particular.
For example, in the above example, the analysis unit 3 is the last unit in the analysis unit combination, and the output content of the analysis unit 3 is the output content of the analysis unit combination, and the output content is the face feature data, and the face feature data can be directly used as the processing result.
By applying the embodiment shown in fig. 1 of the present invention, after the task parameters are obtained, the analysis unit is loaded, the analysis unit does not continuously run in a process manner, and after the analysis unit is loaded, the data is analyzed by using the threads included in the analysis unit.
As an embodiment, after the data to be processed is acquired, a structural body object with a preset structure may be generated for the data to be processed. For example, the preset structure may include three parts, the first part may be referred to as a header structure, and the header structure may store processing progress information for processing the data to be processed, error code information during processing, and the like. The second part may store the data to be processed and the third part may store the analysis results for each analysis unit in the analysis combination.
In this way, inputting the data to be processed into the analysis unit combination, and analyzing the data to be processed by using the thread included in each analysis unit in the analysis unit combination may include:
inputting the structural body object into a first analysis unit in the analysis unit combination, analyzing the structural body object by using a thread contained in the first analysis unit to obtain an analysis result, and adding the analysis result to the structural body object to obtain an output object of the first analysis unit;
secondly, according to the analysis sequence, sequentially determining each analysis unit behind the first analysis unit as a current analysis unit; inputting an output object of a last analysis unit of a current analysis unit into the current analysis unit, analyzing the output object of the last analysis unit by using a thread contained in the current analysis unit to obtain an analysis result, and adding the analysis result to the output object of the last analysis unit to obtain the output object of the current analysis unit.
S105 may include: and acquiring a processing result according to the output object of the last analysis unit in the analysis unit combination.
Continuing with the above example, each analysis unit adds its own analysis result to the third part of the preset structure, that is, the output object of the last analysis unit contains all the contents of the structure object and also contains the analysis results of all the analysis units in the analysis unit combination. For example, the analysis result of the last analysis unit may be extracted as the processing result from the output object of the last analysis unit; alternatively, the analysis result of each analysis unit may be extracted as the processing result from the output object of the last analysis unit; alternatively, the output of the last analysis unit may be used as the processing result.
As an embodiment, each analysis unit may include an input queue and an output queue, the analysis unit obtains an output object of a previous analysis unit from the input queue, or obtains the structure object, and the analysis unit adds its output object to the output queue.
Specifically, after the output object of the first analysis unit is obtained, the output object of the first analysis unit is added to an output queue of the first analysis unit;
the inputting the output object of the last analysis unit of the current analysis unit into the current analysis unit comprises: sequentially reading the output object of the last analysis unit from the input queue of the current analysis unit according to a preset queue sequence;
and after the output object of the current analysis unit is obtained, adding the output object of the current unit to an output queue of the current analysis unit.
For example, if the data to be processed is a video, each analysis unit may process each image in the video. Assuming that the analysis unit 1-2 is used to process a video, a structural object corresponding to a first image is input into the analysis unit 1, the analysis unit 1 analyzes the structural object by using threads contained in the analysis unit 1 to obtain an output object, and the output object is added into an output queue of the analysis unit 1; similarly, the analysis unit 1 performs the above-described processing for each image in the video.
The input queue of the analysis unit 2 and the output queue of the analysis unit 1 may be connected by a pipeline, so that the analysis unit 2 may obtain the output object of the analysis unit 1 from its own input queue. The analysis unit 2 reads the output objects of the analysis unit 1 in turn from its own input queue, one output object at a time. The analysis unit 2 analyzes the read output object by using the thread contained in the analysis unit to obtain an output object, and adds the output object to an output queue of the analysis unit 2; similarly, the analysis unit 2 performs the above-described processing for each of the read output objects.
In the present embodiment, an input/output queue is set for each analysis unit, and for each analysis unit, a plurality of output objects may exist in the input queue of the analysis unit, so that even if the processing rate of the last analysis unit of the analysis unit is low, the analysis unit does not need to wait, and the data processing efficiency is improved compared with a scheme in which no input/output queue is set.
As an embodiment, after obtaining the processing result according to the output object of the last analysis unit in the analysis unit combination, it may also be determined whether the output object of the last analysis unit in the analysis unit combination meets the output condition; if yes, acquiring a processing result from an output object of the last analysis unit; and if not, returning to execute the step of inputting the structural body object into the first analysis unit in the analysis unit combination.
Taking the video containing the license plate data as an example, the output object of the last analysis unit contains license plate feature data, such as a license plate number; an output condition may be set for the license plate number, such as whether there is an unrecognized character, and if so, the first analyzing unit and subsequent steps of inputting the structure object into the analyzing unit combination are repeatedly performed. Until there are no unrecognized characters in the license plate number included in the output object of the last analyzing unit, or until the number of repeated executions reaches a threshold value. In other words, the output condition may also be for whether the number of iterations reaches a threshold.
In the embodiment, a loop mechanism is implemented, that is, when the output object of the last analysis unit does not satisfy the output condition, each analysis unit is cyclically utilized to perform analysis until the output object satisfies the output condition or the number of loops reaches a threshold value, so that the accuracy of the processing result can be improved. The existing Storm framework cannot realize the circulation mechanism, so that compared with the Storm framework, the embodiment improves the accuracy of processing results.
As an implementation manner, before acquiring the data to be processed, a second configuration file corresponding to the data to be processed may also be acquired; reading the identification of an interactive accessory library contained in the second configuration file, and loading the interactive accessory inventory corresponding to the read identification, wherein the interactive accessory library comprises an input interface, an output interface, an assembly accessory and a detection accessory. The input interface is the input interface of the interactive accessory library, and the output interface is the output interface of the interactive accessory library. The input/output interface of the interworking accessory library may be an interface connected to an upper application or a user device, and may be understood as an external interface, and the input/output interface of the analysis unit in the above description and the input/output interface of the pipe in the following description may be understood as an internal interface without being connected to an upper application or a user device.
After the data to be processed is obtained, an input interface of an interactive accessory library can be called, and the data to be processed is input into the interactive accessory library.
In this embodiment, one or more interactive accessory libraries exist in the present apparatus (execution main body) or other apparatuses communicatively connected to the present apparatus, and each interactive accessory library includes an input interface, an output interface, an assembly accessory, and a detection accessory. Each piece of data to be processed may correspond to a second configuration file. To distinguish the description from the configuration file in the above, the configuration file containing the identification of the interaction partner library is referred to as a second configuration file.
Or, the first configuration file and the second configuration file may belong to the same configuration file, where the configuration file includes the identifier of the interactive accessory library, the identifier of the analysis unit, and the identifier sequence.
Each piece of data to be processed may correspond to a second configuration file, where the second configuration file includes an identifier of an interaction kit library for processing the piece of data to be processed. The identifier of the interactive accessory library may be a serial number, an ID, or the like, and is not particularly limited, and the interactive accessory library corresponding to the identifier is loaded into the memory.
The generating a structural body object with a preset structure for the data to be processed may include: and assembling the data to be processed by using the assembly accessories to generate a structural body object with a preset structure.
In the embodiment, an input interface in an interactive accessory library is called, data to be processed is input into the interactive accessory library, and the data to be processed is assembled by using the assembly accessory to generate a structural body object with a preset structure.
In addition, determining the sequence of the analysis units and the analysis units for processing the data to be processed, and connecting the determined analysis units into an analysis unit combination according to the sequence; the structure object is input into the analysis unit combination, and the analysis unit combination outputs one output object.
The determining whether the output object of the last analysis unit in the analysis unit combination satisfies the output condition may include: and calling the detection accessory, detecting the output object of the last analysis unit in the analysis unit combination, and judging whether the detection result meets the output condition.
If not, inputting the structural body object into the analysis unit combination again; if yes, acquiring a processing result from the output object, calling an output interface in the interaction accessory library, and outputting the processing result, wherein the output may be sending the processing result to the user equipment or an upper application.
The interactive accessory library can also comprise a deleting accessory, and after the output interface is called and the processing result is output, the deleting accessory can be called to delete the output object of the last analysis unit, so that the memory resource can be saved, and the memory is ensured not to be leaked.
As an embodiment, after the data to be processed is processed, the analysis unit in the analysis unit combination may be unloaded, so that the memory usage may be reduced.
Fig. 2 is a second flowchart of a data processing method based on a streaming framework according to an embodiment of the present invention,
s201: and acquiring a second configuration file corresponding to the data to be processed.
S202: reading the identification of the interactive accessory library contained in the second configuration file, and loading the interactive accessory inventory corresponding to the read identification, wherein the interactive accessory library comprises an input interface, an output interface, an assembly accessory and a detection accessory.
In this embodiment, there may be two levels of loading, and in order to distinguish descriptions, the configuration file utilized by the first level of loading is referred to as a second configuration file, and the configuration file utilized by the second level of loading is referred to as a first configuration file. The first level of loading is loading the interactive parts library and the second level of loading is loading the analysis unit.
A specific processing framework may be as shown in FIG. 3, including an interaction partner library, a plug-in manager, and an analysis unit. And the plug-in manager loads the interactive accessory library by reading the second configuration file and loads the analysis unit by reading the first configuration file. There may be multiple interaction partner libraries and analysis units, and different interaction partner libraries and analysis units are usually loaded for different data to be processed.
In the first-stage loading, the plug-in manager obtains the identifier of the interactive accessory library for processing the data to be processed by reading the second configuration file; and the plug-in manager loads the interactive accessory library corresponding to the identification to the memory and maps the interface address of the interactive accessory library, wherein the interface address comprises an input interface address and an output interface address.
S203: acquiring a first configuration file corresponding to data to be processed; determining an analysis unit for processing the data to be processed and an analysis sequence of the analysis unit according to the identification and the identification sequence of the analysis unit contained in the first configuration file; wherein each analysis unit comprises an independent thread.
S204: loading the determined analysis unit; and connecting the loaded analysis units according to the analysis sequence to obtain an analysis unit combination.
S204 is the second-level loading, the plug-in manager in fig. 3 obtains the identifier and the identifier sequence of the analysis unit by reading the first configuration file, loads the analysis unit corresponding to the identifier to the memory, and connects the loaded analysis units in series according to the identifier sequence to obtain the analysis unit combination.
In this embodiment, as shown in fig. 3, the analysis units may be connected to each other by a pipe, and data transmitted between the analysis units may flow from one analysis unit to another analysis unit through the pipe. The first and last analysis units are connected to the interactive accessory library by tubing. As shown in fig. 4, the internal interface of the pipeline comprises an input interface pin and an output interface pout, wherein pin is connected to the output interface of the analyzing unit 1 and pout is connected to the input interface of the analyzing unit 2, so that data can flow from the analyzing unit 1 to the analyzing unit 2.
For example, no data caching may be performed in the pipeline; in addition, it is also possible to set the number of iterative transmissions in the pipe, such as in fig. 4, if the data transmission between the analysis unit 1 and the analysis unit 2 fails, the transmission is repeated until the number of iterative transmissions reaches the number set by the pipe.
In this embodiment, an encapsulation layer may be disposed between the interaction kit library and the analysis units, and the encapsulation layer is used to shield the logic relationship inside each analysis unit. For example, as shown in fig. 5, an encapsulation layer is provided between the plug-in manager and each analysis unit and the interaction accessory library, and the interaction accessory library can respond to the interface of each analysis unit in a streaming manner only by calling the interface of the encapsulation layer. Therefore, for the calling party, all the analysis units do not need to be called in a traversing mode, calling logic among the analysis units does not need to be concerned, operation is simple, and experience is better.
In addition, in this embodiment, each analysis unit includes an independent thread, that is, the operation in each analysis unit is performed by different threads, and the threads are not affected by each other, so that even if the operation amount in one analysis unit is large, the operation in other analysis units is not affected, the operation efficiency is improved, and compared with a scheme in which the analysis units continuously run in a process manner, the resource occupancy rate is reduced.
S205: and acquiring data to be processed.
S206: and calling the input interface, and inputting the data to be processed into the interactive accessory library.
S207: and assembling the data to be processed by using the assembly fittings to generate a structural body object with a preset structure.
In S202, an interactive component library is loaded into the memory, where the interactive component library includes assembly components, and the assembly components can assemble the data to be processed into structural objects of a preset structure. For example, the preset structure may include three parts, the first part may be referred to as a header structure, and the header structure may store processing progress information for processing the data to be processed, error code information during processing, and the like. The second part may store the data to be processed and the third part may store the analysis results for each analysis unit in the analysis combination.
S208: and inputting the structural body object into a first analysis unit in the analysis unit combination, analyzing the structural body object by using threads contained in the first analysis unit to obtain an analysis result, and adding the analysis result to the structural body object to obtain an output object of the first analysis unit.
S209: according to the analysis sequence, sequentially determining each analysis unit behind the first analysis unit as a current analysis unit; and inputting the output object of the last analysis unit of the current analysis unit into the current analysis unit, analyzing the output object of the last analysis unit by using the thread contained in the current analysis unit to obtain an analysis result, and adding the analysis result to the output object of the last analysis unit to obtain the output object of the current analysis unit.
As an embodiment, each analysis unit may include an input queue and an output queue, and the analysis unit obtains an output object of a previous analysis unit from the input queue or obtains the structure object, and the analysis unit adds its own output object to the output queue.
Specifically, after the output object of the first analysis unit is obtained, the output object of the first analysis unit is added to the output queue of the first analysis unit; sequentially reading the output object of the last analysis unit from the input queue of the current analysis unit according to a preset queue sequence; after the output object of the current analysis unit is obtained, the output object of the current unit is added to the output queue of the current analysis unit.
In the present embodiment, an input/output queue is set for each analysis unit, and for each analysis unit, a plurality of output objects may exist in the input queue of the analysis unit, so that even if the processing rate of the last analysis unit of the analysis unit is low, the analysis unit does not need to wait, and the data processing efficiency is improved compared with a scheme in which no input/output queue is set.
S210: calling the detection accessory, detecting the output object of the last analysis unit in the analysis unit combination, judging whether the detection result meets the output condition, if so, executing S211, and if not, returning to the step S208.
As described above, different interactive parts libraries can be loaded for different data to be processed, that is, each part in the interactive parts library is suitable for the data to be processed, so that the detection part in the interactive parts library can detect the output object of the data to be processed.
For example, the data to be processed is a video containing license plate data, an output object of the last analysis unit contains a license plate number recognition result, and the detection accessory can detect whether unrecognized characters exist in the recognition result; if so, the detection result does not meet the output condition, and S208-S210 are repeatedly executed; if not, the detection result satisfies the output condition, and S211 is executed.
In addition, a threshold value can be set for the number of times of repeated execution in the detection accessory, and if the detection result does not satisfy the output condition all the time, the number of times of repeated execution of S208-S210 reaches the threshold value, the detection result is considered to satisfy the output condition.
When S208 is executed back, for the output object of the last analysis unit, the analysis result of each analysis unit stored in the third part of the output object may be deleted, and the information stored in the first part of the output object may be updated, for example, the processing progress information, the error code information in the processing process, and the like are updated to the initial value, and the like, which is not limited specifically. The output target of the last analysis unit subjected to the above processing is input to the first analysis unit as a structural body target.
Alternatively, when the process returns to S208, the assembly kit may be recalled, the structure object of the preset structure may be regenerated, and the newly generated structure object may be input to the first analysis unit.
In the embodiment, a loop mechanism is implemented, that is, when the output object of the last analysis unit does not satisfy the output condition, each analysis unit is cyclically utilized to perform analysis until the output object satisfies the output condition or the number of loops reaches a threshold value, so that the accuracy of the processing result can be improved. The existing Storm framework cannot realize the circulation mechanism, so that compared with the Storm framework, the method improves the accuracy of the processing result.
S211: and acquiring a processing result from the output object of the last analysis unit, calling the output interface and outputting the processing result.
Continuing with the above example, each analysis unit adds its own analysis result to the third portion of the preset configuration, so that the output of the last analysis unit contains all of the structure object and also contains the analysis results of all of the analysis units in the combination of analysis units.
For example, the analysis result of the last analysis unit may be extracted as the processing result from the output object of the last analysis unit; alternatively, the analysis result of each analysis unit may be extracted as the processing result from the output object of the last analysis unit; alternatively, the output of the last analysis unit may be used as the processing result.
S212: and calling the deletion accessory to delete the output object of the last analysis unit.
S213: and unloading the interactive accessory library and the analysis unit in the analysis unit combination.
As an embodiment, after the pending data is processed, the interaction kit library and the analysis unit may be unloaded through the plug-in manager. Corresponding to loading the interworking library and the analysis unit, the interworking library may be unloaded by the second configuration file, and the analysis unit may be unloaded by the first configuration file.
Specifically, the memory space applied when the interactive accessory library is loaded in S202 may be released according to the address handle of the interactive accessory library included in the second configuration file; the memory space applied when the analysis unit is loaded in S204 is released according to the address handle of the analysis unit included in the first configuration file.
In this embodiment, after the data to be processed is processed, the memory occupied by the processing procedure is released, so that the memory occupancy rate can be reduced.
One specific embodiment is described below in conjunction with fig. 3-5:
1. the device receives a processing task: license plate numbers in a video segment are identified. The device obtains two configuration files related to the processing task: profile a and profile B. The data to be processed is the video, the configuration file a is the second configuration file in the content, and the configuration file B is the first configuration file in the content.
Reading the identifier of the interactive accessory library contained in the configuration file A, and if the identifier is serial number 3, loading the interactive accessory library with the serial number 3 into a memory through a plug-in manager, wherein the interactive accessory library comprises an input interface, an output interface, an assembly accessory and a detection accessory. And acquiring the video segment, calling an input interface in the interactive accessory library, and inputting the video segment into the interactive accessory library. And assembling the video into a structural body object with a preset structure by using the assembly parts in the interactive part library.
For example, the preset structure may include three parts, the first part may be referred to as a header structure, and the header structure may store processing progress information for processing the data to be processed, error code information during processing, and the like. The second part may store the data to be processed and the third part may store the analysis results for each analysis unit in the analysis combination.
In addition, reading the identifiers and identifier sequences of the analysis units contained in the configuration file B, assuming that the identifiers and identifier sequences are: the analysis unit 1, the analysis unit 4 and the analysis unit 5 load the three analysis units to the memory through the plug-in manager, and connect the three analysis units according to the sequence to obtain an analysis unit combination. In particular, the three analytical units may be connected by tubing as shown in fig. 3, wherein the analytical unit 1 and the analytical unit 5 are connected by tubing to the interactive fittings library. Each analysis unit contains an independent thread.
As shown in fig. 5, an encapsulation layer is provided between the plug-in manager and each analysis unit and the interactive accessory library, and the interactive accessory library can respond to the interface of each analysis unit in a streaming manner only by calling the interface of the encapsulation layer. Therefore, for the calling party, all the analysis units do not need to be called in a traversing mode, calling logic among the analysis units does not need to be concerned, operation is simple, and experience is better.
The structure object assembled by the assembly kit is input to the input queue of the first analysis unit in the analysis unit combination, that is, the input queue of the analysis unit 1. The analysis unit 1 may periodically obtain a structure object from its own input queue, and read the to-be-processed data stored in the second part of the structure object, that is, the video; the analysis unit 1 decodes the video segment by using a thread contained in the analysis unit to obtain decoded data, the decoded data is added to a third part of the structural body object as an analysis result, and the structural body object added with the decoded data is an output object of the analysis unit 1; the analysis unit 1 outputs the output object to its own output queue.
The output queue of the analysis unit 1 is connected to the input queue of the analysis unit 4 via a pipeline, so that one or more output objects of the analysis unit 1 are present in the input queue of the analysis unit 4. The analysis unit 4 may periodically obtain an output object of the analysis unit 1 from its own input queue.
The analysis unit 4 reads the decoded data stored in the third part of the output object and the processing progress information of the first part of the output object; the analysis unit 4 detects a vehicle target in the decoded data by using a thread included in the analysis unit and combining the processing progress information, adds the detected vehicle target data as an analysis result to a third part of the output object, and the output object after the vehicle target data is added is the output object of the analysis unit 4; the analysis unit 4 outputs the output object to its own output queue.
The output queue of the analysis unit 4 is connected to the input queue of the analysis unit 5 via a pipeline, so that one or more output objects of the analysis unit 4 are present in the input queue of the analysis unit 5. The analysis unit 5 may periodically obtain an output object of the analysis unit 4 from its own input queue.
The analysis unit 5 reads the vehicle target data stored in the third part of the output object and the processing progress information of the first part of the output object; the analysis unit 5 extracts the license plate number in the vehicle target data by using the thread contained by the analysis unit and combining the processing progress information, adds the license plate number as an analysis result to the third part of the output object, and the output object after adding the license plate number is the output object of the analysis unit 5; the analysis unit 5 outputs the output object to its own output queue.
The detection accessory in the interactive accessory library can detect the output object of the analysis unit 5 and judge that the unrecognized character does not exist in the license plate number; if not, the detection result meets the output condition, the license plate number is obtained from the output object of the analysis unit 5 as the processing result, the output interface is called, and the processing result is output.
If the unrecognized character exists in the license plate number, the detection result does not meet the output condition, and the step of inputting the structural body object into the analysis unit 1 is returned until the detection result meets the output condition or the number of times of returning execution reaches a threshold value.
When the step of inputting the structure object into the analysis unit 1 is performed, for the output object of the analysis unit 5, the analysis result of each analysis unit stored in the third part of the output object may be deleted, and information stored in the first part of the output object may be updated, for example, processing progress information, error code information in the processing process, and the like are updated to an initial value, and the like, which is not limited in particular. The output target of the analysis unit 5 subjected to the above-described processing is input to the analysis unit 1 as a structural body target.
Alternatively, when the step of inputting the structure object into the analysis unit 1 is performed, the assembly kit may be recalled, the structure object of the preset structure may be newly generated, and the newly generated structure object may be input into the analysis unit 1.
After the processing result is output, a deletion accessory in the interaction accessory library is called, and the output object of the analysis unit 5 is deleted. In addition, the interaction kit library and the analysis unit can be unloaded through the plug-in manager. Specifically, the memory space applied when the interactive accessory library is loaded can be released according to the address handle of the interactive accessory library contained in the configuration file a; and releasing the memory space applied when the analysis unit is loaded according to the address handle of the analysis unit contained in the configuration file B.
By applying the embodiment, on the first aspect, after the task parameters are obtained, the analysis unit is loaded, the analysis unit does not continuously run in a process mode, and after the analysis unit is loaded, the data is analyzed by using the thread included in the analysis unit, so that compared with a scheme that the analysis unit continuously runs in a process mode, the resource occupancy rate is reduced, and the thread is easier to control than the process; in the second aspect, a circulation mechanism is realized, that is, when the output object of the last analysis unit does not meet the output condition, each analysis unit is circularly utilized to perform analysis until the output object meets the output condition or the circulation frequency reaches a threshold value, so that the accuracy of the processing result can be improved; and in the third aspect, the interactive accessory library and the analysis unit are loaded respectively through two-stage loading, and different interactive accessory libraries and different analysis units are loaded according to different data to be processed, so that the loading is flexible and adjustable.
Corresponding to the foregoing method embodiment, an embodiment of the present invention further provides a data processing apparatus based on a streaming framework, as shown in fig. 6, including:
a first obtaining module 601, configured to obtain a task parameter corresponding to data to be processed;
a determining module 602, configured to determine, according to the task parameter, an analysis unit that processes the data to be processed and an analysis sequence of the analysis unit; wherein each analysis unit comprises an independent thread;
a first loading module 603, configured to load the determined analysis unit;
a connection module 604, configured to connect the loaded analysis units according to the analysis order to obtain an analysis unit combination;
a second obtaining module 605, configured to obtain the data to be processed;
an analysis module 606, configured to input the to-be-processed data into the analysis unit combination, and analyze the to-be-processed data by using a thread included in each analysis unit in the analysis unit combination;
a third obtaining module 607, configured to obtain a processing result according to the output content of the analysis unit combination.
As an embodiment, the first obtaining module 601 may specifically be configured to: acquiring a first configuration file corresponding to data to be processed;
the determining module 602 may specifically be configured to:
and determining an analysis unit for processing the data to be processed and an analysis sequence of the analysis unit according to the identification and the identification sequence of the analysis unit contained in the first configuration file.
As an embodiment, the apparatus may further include:
a generating module (not shown in the figure) for generating a structural body object with a preset structure according to the data to be processed;
the analysis module 606 may be specifically configured to:
inputting the structural body object into a first analysis unit in the analysis unit combination, analyzing the structural body object by using threads contained in the first analysis unit to obtain an analysis result, and adding the analysis result to the structural body object to obtain an output object of the first analysis unit;
according to the analysis sequence, sequentially determining each analysis unit behind the first analysis unit as a current analysis unit; inputting an output object of a last analysis unit of a current analysis unit into the current analysis unit, analyzing the output object of the last analysis unit by using a thread contained in the current analysis unit to obtain an analysis result, and adding the analysis result to the output object of the last analysis unit to obtain the output object of the current analysis unit;
the third obtaining module 607 may specifically be configured to:
and acquiring a processing result according to the output object of the last analysis unit in the analysis unit combination.
As an embodiment, the apparatus may further include: a first adding module and a second adding module (not shown in the figure), wherein,
a first adding module, configured to add the output object of the first analysis unit to the output queue of the first analysis unit;
the analysis module 606 may be further configured to sequentially read an output object of the previous analysis unit from an input queue of the current analysis unit according to a preset queue order;
and the second adding module is used for adding the output object of the current unit into the output queue of the current analysis unit after the output object of the current analysis unit is obtained.
As an embodiment, the apparatus may further include:
a judging module (not shown in the figure) for judging whether the output object of the last analysis unit in the analysis unit combination meets the output condition; if yes, trigger the third obtaining module 607; if not, the analysis module 606 is triggered;
the third obtaining module 607 may specifically be configured to: and acquiring a processing result from an output object of the last analysis unit.
As an embodiment, the apparatus may further include: a fourth acquisition module, a second loading module, an input module and an output module (not shown in the figure), wherein,
the fourth acquisition module is used for acquiring a second configuration file corresponding to the data to be processed;
the second loading module is used for reading the identification of the interactive accessory library contained in the second configuration file and loading the interactive accessory inventory corresponding to the read identification, wherein the interactive accessory library comprises an input interface, an output interface, an assembly accessory and a detection accessory;
the input module is used for calling the input interface and inputting the data to be processed into the interactive accessory library;
the generating module may be specifically configured to: assembling the data to be processed by using the assembly accessories to generate a structural body object with a preset structure;
the determining module may be specifically configured to:
calling the detection accessory, detecting an output object of the last analysis unit in the analysis unit combination, and judging whether a detection result meets an output condition;
and the output module is used for calling the output interface and outputting the processing result after the processing result is obtained from the output object of the last analysis unit.
As an embodiment, the interaction accessory library further includes a deletion accessory, and the apparatus further includes:
and a deleting module (not shown in the figure) for calling the deleting accessory and deleting the output object of the last analysis unit.
As an embodiment, the apparatus may further include:
and an unloading module (not shown in the figure) for unloading the analysis units in the analysis unit combination after acquiring the processing result according to the output content of the analysis unit combination.
By applying the embodiment shown in fig. 6 of the present invention, after the task parameters are obtained, the analysis unit is loaded, the analysis unit does not continuously run in a process manner, and after the analysis unit is loaded, the data is analyzed by using the thread included in the analysis unit.
An embodiment of the present invention further provides an electronic device, as shown in fig. 7, including a processor 701 and a memory 702,
a memory 702 for storing a computer program;
the processor 701 is configured to implement any of the above-described data processing methods based on the streaming framework when executing the program stored in the memory 702.
The Memory mentioned in the above electronic device may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
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.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, 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 identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the embodiment of the data processing apparatus based on the streaming framework shown in fig. 6 and the embodiment of the electronic device shown in fig. 7, since they are substantially similar to the embodiments of the data processing method based on the streaming framework shown in fig. 1 to 5, the description is relatively simple, and relevant points can be found by referring to the partial description of the embodiments of the data processing method based on the streaming framework shown in fig. 1 to 5.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (15)

1. A data processing method based on a streaming framework, comprising:
acquiring task parameters corresponding to data to be processed;
determining an analysis unit for processing the data to be processed and an analysis sequence of the analysis unit according to the task parameters; wherein each analysis unit comprises an independent thread;
loading the determined analysis unit; connecting each loaded analysis unit according to the analysis sequence to obtain an analysis unit combination;
acquiring the data to be processed, inputting the data to be processed into the analysis unit combination, and analyzing the data to be processed by using threads contained in each analysis unit in the analysis unit combination;
acquiring a processing result according to the output content of the analysis unit combination;
after the data to be processed is obtained, the method further comprises the following steps: generating a structural body object with a preset structure aiming at the data to be processed;
the inputting the data to be processed into the analysis unit combination, and analyzing the data to be processed by using the thread included in each analysis unit in the analysis unit combination, includes:
inputting the structural body object into a first analysis unit in the analysis unit combination, analyzing the structural body object by using threads contained in the first analysis unit to obtain an analysis result, and adding the analysis result to the structural body object to obtain an output object of the first analysis unit;
according to the analysis sequence, sequentially determining each analysis unit behind the first analysis unit as a current analysis unit; inputting an output object of a last analysis unit of a current analysis unit into the current analysis unit, analyzing the output object of the last analysis unit by using a thread contained in the current analysis unit to obtain an analysis result, and adding the analysis result to the output object of the last analysis unit to obtain the output object of the current analysis unit;
the acquiring a processing result according to the output content of the analysis unit combination comprises:
and acquiring a processing result according to the output object of the last analysis unit in the analysis unit combination.
2. The method according to claim 1, wherein the acquiring of the task parameter corresponding to the data to be processed includes:
acquiring a first configuration file corresponding to data to be processed;
the determining, according to the task parameter, an analysis unit that processes the data to be processed and an analysis order of the analysis unit includes:
and determining an analysis unit for processing the data to be processed and an analysis sequence of the analysis unit according to the identification and the identification sequence of the analysis unit contained in the first configuration file.
3. The method of claim 1, further comprising, after said obtaining the output object of the first analysis unit:
adding the output object of the first analysis unit to the output queue of the first analysis unit;
the inputting an output object of a last analysis unit of the current analysis unit into the current analysis unit includes:
sequentially reading the output object of the last analysis unit from the input queue of the current analysis unit according to a preset queue sequence;
after the obtaining of the output object of the current analysis unit, the method further includes:
and adding the output object of the current unit to the output queue of the current analysis unit.
4. The method according to claim 1, wherein the obtaining a processing result according to an output object of a last analysis unit in the analysis unit combination comprises:
judging whether the output object of the last analysis unit in the analysis unit combination meets the output condition;
if yes, acquiring a processing result from an output object of the last analysis unit;
and if not, returning to execute the step of inputting the structural body object into the first analysis unit in the analysis unit combination.
5. The method of claim 4, further comprising, prior to obtaining the data to be processed: acquiring a second configuration file corresponding to the data to be processed;
reading an identifier of an interactive accessory library contained in the second configuration file, and loading an interactive accessory inventory corresponding to the read identifier, wherein the interactive accessory library comprises an input interface, an output interface, an assembly accessory and a detection accessory;
after the data to be processed is obtained, the method further comprises the following steps:
calling the input interface, and inputting the data to be processed into the interactive accessory library;
the generating a structural body object with a preset structure aiming at the data to be processed comprises the following steps:
assembling the data to be processed by using the assembly accessories to generate a structural body object with a preset structure;
the judging whether the output object of the last analysis unit in the analysis unit combination meets the output condition includes:
calling the detection accessory, detecting an output object of the last analysis unit in the analysis unit combination, and judging whether a detection result meets an output condition;
after obtaining the processing result from the output object of the last analysis unit, the method further includes:
and calling the output interface and outputting the processing result.
6. The method of claim 5, wherein the interactive accessory library further comprises a delete accessory, and after the processing result is output by calling the output interface, further comprises:
and calling the deletion accessory to delete the output object of the last analysis unit.
7. The method of claim 1, further comprising, after obtaining a processing result based on the output content of the analysis unit combination:
unloading the analysis units in the analysis unit combination.
8. A streaming framework-based data processing apparatus, comprising:
the first acquisition module is used for acquiring task parameters corresponding to data to be processed;
the determining module is used for determining an analysis unit for processing the data to be processed and an analysis sequence of the analysis unit according to the task parameters; wherein each analysis unit comprises an independent thread;
the first loading module is used for loading the determined analysis unit;
the connection module is used for connecting each loaded analysis unit according to the analysis sequence to obtain an analysis unit combination;
the second acquisition module is used for acquiring the data to be processed;
the analysis module is used for inputting the data to be processed into the analysis unit combination and analyzing the data to be processed by utilizing threads contained in each analysis unit in the analysis unit combination;
the third acquisition module is used for acquiring a processing result according to the output content of the analysis unit combination;
the generating module is used for generating a structural body object with a preset structure aiming at the data to be processed;
the analysis module is specifically configured to:
inputting the structural body object into a first analysis unit in the analysis unit combination, analyzing the structural body object by using threads contained in the first analysis unit to obtain an analysis result, and adding the analysis result to the structural body object to obtain an output object of the first analysis unit;
according to the analysis sequence, sequentially determining each analysis unit behind the first analysis unit as a current analysis unit; inputting an output object of a last analysis unit of a current analysis unit into the current analysis unit, analyzing the output object of the last analysis unit by using a thread contained in the current analysis unit to obtain an analysis result, and adding the analysis result to the output object of the last analysis unit to obtain the output object of the current analysis unit;
the third obtaining module is specifically configured to:
and acquiring a processing result according to the output object of the last analysis unit in the analysis unit combination.
9. The apparatus of claim 8, wherein the first obtaining module is specifically configured to: acquiring a first configuration file corresponding to data to be processed;
the determining module is specifically configured to:
and determining an analysis unit for processing the data to be processed and an analysis sequence of the analysis unit according to the identification and the identification sequence of the analysis unit contained in the first configuration file.
10. The apparatus of claim 8, further comprising: a first adding module and a second adding module, wherein,
a first adding module, configured to add the output object of the first analysis unit to the output queue of the first analysis unit;
the analysis module is further configured to sequentially read an output object of the previous analysis unit from an input queue of the current analysis unit according to a preset queue order;
and the second adding module is used for adding the output object of the current unit into the output queue of the current analysis unit after the output object of the current analysis unit is obtained.
11. The apparatus of claim 8, further comprising:
the judging module is used for judging whether the output object of the last analysis unit in the analysis unit combination meets the output condition; if yes, triggering the third acquisition module; if not, triggering the analysis module;
the third obtaining module is specifically configured to: and acquiring a processing result from an output object of the last analysis unit.
12. The apparatus of claim 11, further comprising: a fourth obtaining module, a second loading module, an input module and an output module, wherein,
the fourth acquisition module is used for acquiring a second configuration file corresponding to the data to be processed;
the second loading module is used for reading the identification of the interactive accessory library contained in the second configuration file and loading the interactive accessory inventory corresponding to the read identification, wherein the interactive accessory library comprises an input interface, an output interface, an assembly accessory and a detection accessory;
the input module is used for calling the input interface and inputting the data to be processed into the interactive accessory library;
the generation module is specifically configured to: assembling the data to be processed by using the assembly accessories to generate a structural body object with a preset structure;
the judgment module is specifically configured to:
calling the detection accessory, detecting an output object of the last analysis unit in the analysis unit combination, and judging whether a detection result meets an output condition;
and the output module is used for calling the output interface and outputting the processing result after the processing result is obtained from the output object of the last analysis unit.
13. The apparatus of claim 12, wherein the library of interaction accessories further comprises a delete accessory, the apparatus further comprising:
and the deleting module is used for calling the deleting accessory and deleting the output object of the last analysis unit.
14. The apparatus of claim 8, further comprising:
and the unloading module is used for unloading the analysis units in the analysis unit combination after acquiring the processing result according to the output content of the analysis unit combination.
15. An electronic device comprising a processor and a memory;
a memory for storing a computer program;
a processor for implementing the method steps of any of claims 1 to 7 when executing a program stored in the memory.
CN201711470644.7A 2017-12-29 2017-12-29 Data processing method, device and equipment based on streaming framework Active CN110007967B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711470644.7A CN110007967B (en) 2017-12-29 2017-12-29 Data processing method, device and equipment based on streaming framework

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711470644.7A CN110007967B (en) 2017-12-29 2017-12-29 Data processing method, device and equipment based on streaming framework

Publications (2)

Publication Number Publication Date
CN110007967A CN110007967A (en) 2019-07-12
CN110007967B true CN110007967B (en) 2022-05-06

Family

ID=67164072

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711470644.7A Active CN110007967B (en) 2017-12-29 2017-12-29 Data processing method, device and equipment based on streaming framework

Country Status (1)

Country Link
CN (1) CN110007967B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111290744B (en) * 2020-01-22 2023-07-21 北京百度网讯科技有限公司 Stream type computing job processing method, stream type computing system and electronic equipment
CN111611236A (en) * 2020-05-28 2020-09-01 宁波和利时智能科技有限公司 Data analysis method and system
CN112433866A (en) * 2020-11-25 2021-03-02 杭州视洞科技有限公司 Storm-DRPC-based face recognition performance optimization method
CN113282246B (en) * 2021-06-15 2023-07-04 杭州海康威视数字技术股份有限公司 Data processing method and device

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102542047A (en) * 2011-12-28 2012-07-04 奇智软件(北京)有限公司 Task logic library generating method, task logic library generating system, data processing method and data processing system
CN102546247A (en) * 2011-12-29 2012-07-04 华中科技大学 Massive data continuous analysis system suitable for stream processing
CN105260405A (en) * 2015-09-22 2016-01-20 北京云知声信息技术有限公司 Web crawler method and device
CN106201443A (en) * 2016-07-27 2016-12-07 福建富士通信息软件有限公司 A kind of method and system based on the Storm how concurrent written document of streaming Computational frame
US20170083378A1 (en) * 2015-09-18 2017-03-23 Salesforce.Com, Inc. Managing processing of long tail task sequences in a stream processing framework
CN106777009A (en) * 2016-12-07 2017-05-31 北京奇虎科技有限公司 Smart machine and task scheduling perform control method and device
CN107026851A (en) * 2017-03-22 2017-08-08 西安电子科技大学 A kind of real-time system guard method based on stream data processing
CN107229747A (en) * 2017-06-26 2017-10-03 湖南星汉数智科技有限公司 A kind of large-scale data processing unit and method based on Stream Processing framework

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102542047A (en) * 2011-12-28 2012-07-04 奇智软件(北京)有限公司 Task logic library generating method, task logic library generating system, data processing method and data processing system
CN102546247A (en) * 2011-12-29 2012-07-04 华中科技大学 Massive data continuous analysis system suitable for stream processing
US20170083378A1 (en) * 2015-09-18 2017-03-23 Salesforce.Com, Inc. Managing processing of long tail task sequences in a stream processing framework
CN105260405A (en) * 2015-09-22 2016-01-20 北京云知声信息技术有限公司 Web crawler method and device
CN106201443A (en) * 2016-07-27 2016-12-07 福建富士通信息软件有限公司 A kind of method and system based on the Storm how concurrent written document of streaming Computational frame
CN106777009A (en) * 2016-12-07 2017-05-31 北京奇虎科技有限公司 Smart machine and task scheduling perform control method and device
CN107026851A (en) * 2017-03-22 2017-08-08 西安电子科技大学 A kind of real-time system guard method based on stream data processing
CN107229747A (en) * 2017-06-26 2017-10-03 湖南星汉数智科技有限公司 A kind of large-scale data processing unit and method based on Stream Processing framework

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
"一种基于STORM的交通流数据实时处理系统设计与实现";南海京;《中国优秀博硕士学位论文全文数据库(硕士)工程科技Ⅱ辑》;20150815;C034-231 *
Vasanth Tovinkere.etc."Flow Graph Designer: A Tool for Designing and Analyzing Intel® Threading Building Blocks Flow Graphs".《2014 43rd International Conference on Parallel Processing Workshops》.2015,第149-158页. *

Also Published As

Publication number Publication date
CN110007967A (en) 2019-07-12

Similar Documents

Publication Publication Date Title
CN110007967B (en) Data processing method, device and equipment based on streaming framework
CN107392619B (en) Intelligent contract processing method and device
CN109344061B (en) Method, device, equipment and system for detecting abnormity of interface
CN108875519B (en) Object detection method, device and system and storage medium
WO2016206605A1 (en) Client terminal data collection method and apparatus
CN111552633A (en) Interface abnormal call testing method and device, computer equipment and storage medium
CN111159413A (en) Log clustering method, device, equipment and storage medium
CN110737818A (en) Network release data processing method and device, computer equipment and storage medium
CN111338692A (en) Vulnerability classification method and device based on vulnerability codes and electronic equipment
CN112328259A (en) Compiling time length processing method and device
CN107562426B (en) Method and system for collecting and analyzing Trace of browser in non-embedded cloud
CN111414619A (en) Data security detection method, device, equipment and readable storage medium
CN107391257B (en) Method, device and server for estimating memory capacity required by service
CN111339531A (en) Malicious code detection method and device, storage medium and electronic equipment
JP2017194892A (en) Test case production program and test case production method
KR101833220B1 (en) Deobfuscation assessing apparatus of application code and method of assessing deobfuscation of application code using the same
CN110716859A (en) Method for automatically pushing test cases for modified codes and related device
CN111124627A (en) Method, device, terminal and storage medium for determining application program caller
CN110471669B (en) Null pointer reference detection method and detection device
CN112181816B (en) Scene-based interface testing method and device, computer equipment and medium
CN111050179B (en) Video transcoding method and device
CN109408063B (en) Instruction pile inserting method and device based on virtual machine
CN114048136A (en) Test type determination method, device, server, medium and product
CN112799791A (en) Method and device for calling distributed lock, electronic equipment and storage medium
US20150309788A1 (en) Function module modularizing method in data distribution service and modularizing apparatus thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant