Disclosure of Invention
The invention mainly aims to provide a data analysis method, a data analysis device, terminal equipment and a computer readable storage medium, and aims to solve the technical problems that when the existing data analysis method is adopted to analyze data in the prior art, the data analysis speed is low and the data analysis efficiency is low.
In order to achieve the above object, the present invention provides a data analysis method for a terminal device, the method comprising the following steps:
receiving data to be analyzed;
obtaining a first target analysis program based on the target system operating environment and a preset algorithm set of the terminal equipment;
analyzing the data to be analyzed by utilizing the first target analysis program to obtain a first analysis result;
and outputting the first analysis result.
Optionally, the step of obtaining a first target analysis program based on the target system operating environment and the preset algorithm set of the terminal device includes:
when the target system operating environment meets a preset condition, judging whether a historical analysis program matched with the target system operating environment exists or not;
when no historical analysis program matched with the target system operation environment exists, acquiring a target analysis algorithm corresponding to the target system operation environment from the preset algorithm set, wherein the preset algorithm set comprises analysis algorithms corresponding to different system operation environments meeting the preset conditions;
and obtaining the first target analysis program based on the target analysis algorithm.
Optionally, the method further includes:
when the target system operation environment does not meet the preset condition, acquiring target configuration parameters corresponding to the target system operation environment in the preset algorithm set, wherein the preset algorithm set also comprises configuration parameters corresponding to different system operation environments which do not meet the preset condition;
configuring a preset analysis program by using the target configuration parameters to obtain a second target analysis program;
analyzing the data to be analyzed by using the second target analysis program to obtain a second analysis result;
and outputting the second analysis result.
Optionally, after the step of determining whether there is a historical analysis program matching the target system operating environment when the target system operating environment meets the preset condition, the method further includes:
when a historical analysis program matched with the running environment of the target system exists, analyzing the data to be analyzed by using the historical analysis program to obtain a third analysis result;
and outputting the third analysis result.
Optionally, the step of obtaining the first target analysis program based on the target analysis algorithm includes:
compiling the target analysis algorithm into a first target analysis program in a wasm format by using an emmake emcc compiler of WebAssembly.
Optionally, before the step of obtaining the target analysis algorithm corresponding to the target system operating environment from the preset algorithm set when there is no historical analysis program matching the target system operating environment, the method further includes:
acquiring a preset system operating environment and a preset analysis algorithm;
based on the preset analysis algorithm, obtaining a preset sub-analysis algorithm of a first preset language and preset configuration parameters of a second preset language;
establishing a first mapping relation between a first subsystem operating environment meeting the preset condition in the preset system operating environment and the preset sub-analysis algorithm;
establishing a second mapping relation between a second subsystem operating environment which does not meet the preset condition in the preset system operating environment and the preset configuration parameter;
and obtaining the preset algorithm set based on the preset system operating environment, the preset sub-analysis algorithm, the preset configuration parameter, the first mapping relation and the second mapping relation.
Optionally, the first target analysis program includes a plurality of programs; the step of analyzing the data to be analyzed by using the first target analysis program to obtain a first analysis result includes:
performing parallel analysis on the data to be analyzed by using a plurality of first target analysis programs to obtain a plurality of sub-analysis results;
obtaining the first analysis result based on the plurality of sub-analysis results.
In addition, in order to achieve the above object, the present invention further provides a data analysis apparatus for a terminal device, the apparatus comprising:
the receiving module is used for receiving data to be analyzed;
the acquisition module is used for acquiring a first target analysis program based on the target system operating environment and a preset algorithm set of the terminal equipment;
the analysis module is used for analyzing the data to be analyzed by utilizing the first target analysis program to obtain a first analysis result;
and the output module is used for outputting the first analysis result.
In addition, to achieve the above object, the present invention further provides a terminal device, including: a memory, a processor and a data analysis program stored on the memory and running on the processor, the data analysis program when executed by the processor implementing the steps of the data analysis method as claimed in any one of the preceding claims.
Furthermore, to achieve the above object, the present invention also proposes a computer-readable storage medium having stored thereon a data analysis program which, when executed by a processor, implements the steps of the data analysis method as described in any one of the above.
The technical scheme of the invention provides a data analysis method, which is used for terminal equipment and receives data to be analyzed; obtaining a first target analysis program based on the target system operating environment and a preset algorithm set of the terminal equipment; analyzing the data to be analyzed by utilizing the first target analysis program to obtain a first analysis result; and outputting the first analysis result. In the conventional data analysis method, a terminal device (front end) transmits data to be analyzed to a back end, and the back end performs data analysis to obtain an analysis result, wherein the data to be analyzed needs to be transmitted between the front end and the back end, so that the analysis efficiency is low, and the analysis speed is slow.
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.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a terminal device in a hardware system operating environment according to an embodiment of the present invention.
The terminal device may be a User Equipment (UE) such as a Mobile phone, a smart phone, a laptop, a digital broadcast receiver, a Personal Digital Assistant (PDA), a tablet computer (PAD), a handheld device, a vehicle mounted device, a wearable device, a computing device or other processing device connected to a wireless modem, a Mobile Station (MS), etc. The terminal device may be referred to as a user terminal, a portable terminal, a desktop terminal, etc.
In general, a terminal device includes: at least one processor 301, a memory 302, and a data analysis program stored on the memory and executable on the processor, the data analysis program configured to implement the steps of the data analysis method as previously described.
The processor 301 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and so on. The processor 301 may be implemented in at least one hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), and a PLA (Programmable Logic Array). The processor 301 may also include a main processor and a coprocessor, where the main processor is a processor for processing data in an awake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor 301 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content required to be displayed on the display screen. The processor 301 may further include an AI (Artificial Intelligence) processor for processing operations related to the data analysis method, so that the data analysis method model can be trained and learned autonomously, improving efficiency and accuracy.
Memory 302 may include one or more computer-readable storage media, which may be non-transitory. Memory 302 may also include high speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer readable storage medium in memory 302 is used to store at least one instruction for execution by processor 301 to implement the data analysis methods provided by method embodiments herein.
In some embodiments, the terminal may further include: a communication interface 303 and at least one peripheral device. The processor 301, the memory 302 and the communication interface 303 may be connected by a bus or signal lines. Various peripheral devices may be connected to communication interface 303 via a bus, signal line, or circuit board. Specifically, the peripheral device includes: at least one of radio frequency circuitry 304, a display screen 305, and a power source 306.
The communication interface 303 may be used to connect at least one peripheral device related to I/O (Input/Output) to the processor 301 and the memory 302. In some embodiments, processor 301, memory 302, and communication interface 303 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 301, the memory 302 and the communication interface 303 may be implemented on a single chip or circuit board, which is not limited in this embodiment.
The Radio Frequency circuit 304 is used for receiving and transmitting RF (Radio Frequency) signals, also called electromagnetic signals. The radio frequency circuitry 304 communicates with communication networks and other communication devices via electromagnetic signals. The rf circuit 304 converts an electrical signal into an electromagnetic signal to transmit, or converts a received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 304 comprises: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber identity module card, and so forth. The radio frequency circuitry 304 may communicate with other terminals via at least one wireless communication protocol. The wireless communication protocols include, but are not limited to: metropolitan area networks, various generation mobile communication networks (2G, 3G, 4G, and 5G), Wireless local area networks, and/or WiFi (Wireless Fidelity) networks. In some embodiments, the rf circuit 304 may further include NFC (Near Field Communication) related circuits, which are not limited in this application.
The display screen 305 is used to display a UI (User Interface). The UI may include graphics, text, icons, video, and any combination thereof. When the display screen 305 is a touch display screen, the display screen 305 also has the ability to capture touch signals on or over the surface of the display screen 305. The touch signal may be input to the processor 301 as a control signal for processing. At this point, the display screen 305 may also be used to provide virtual buttons and/or a virtual keyboard, also referred to as soft buttons and/or a soft keyboard. In some embodiments, the display screen 305 may be one, the front panel of the electronic device; in other embodiments, the display screens 305 may be at least two, respectively disposed on different surfaces of the electronic device or in a folded design; in still other embodiments, the display screen 305 may be a flexible display screen disposed on a curved surface or a folded surface of the electronic device. Even further, the display screen 305 may be arranged in a non-rectangular irregular figure, i.e. a shaped screen. The Display screen 305 may be made of LCD (liquid crystal Display), OLED (Organic Light-Emitting Diode), and the like.
The power supply 306 is used to power various components in the electronic device. The power source 306 may be alternating current, direct current, disposable or rechargeable. When the power source 306 includes a rechargeable battery, the rechargeable battery may support wired or wireless charging. The rechargeable battery may also be used to support fast charge technology.
Those skilled in the art will appreciate that the configuration shown in fig. 1 does not constitute a limitation of the terminal device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
Furthermore, an embodiment of the present invention further provides a computer-readable storage medium, on which a data analysis program is stored, and the data analysis program, when executed by a processor, implements the steps of the data analysis method as described above. Therefore, a detailed description thereof will be omitted. In addition, the beneficial effects of the same method are not described in detail. For technical details not disclosed in embodiments of the computer-readable storage medium referred to in the present application, reference is made to the description of embodiments of the method of the present application. It is determined that the program instructions may be deployed to be executed on one terminal device, or on multiple terminal devices located at one site, or distributed across multiple sites and interconnected by a communication network, as examples.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The computer-readable storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
Based on the hardware structure, the embodiment of the data analysis method is provided.
Referring to fig. 2, fig. 2 is a schematic flow chart of a first embodiment of a data analysis method of the present invention, where the method is used for a terminal device, and the method includes the following steps:
step S11: data to be analyzed is received.
The execution subject of the present invention is a terminal device, the terminal device is installed with a data analysis program, and when the terminal device executes the data analysis program, the data analysis method of the present invention is implemented. The terminal device is typically a head-end device, i.e. a device to be subjected to data analysis.
In the existing data analysis method, terminal equipment sends data to be analyzed to back-end equipment (such as a server and the like), and the back-end equipment analyzes the data to be analyzed to obtain an analysis result; in this embodiment, the terminal device directly analyzes the data to be analyzed to obtain an analysis result (the first analysis result, the second analysis result, or the third analysis result), and does not need to send the data to be analyzed to the back-end device for analysis.
It is to be understood that the data to be analyzed may be any form of data, and the present invention is not limited thereto.
Step S12: and obtaining a first target analysis program based on the target system operating environment and the preset algorithm set of the terminal equipment.
Step S13: and analyzing the data to be analyzed by utilizing the first target analysis program to obtain a first analysis result.
Step S14: and outputting the first analysis result.
It should be noted that the system operation environment of the terminal device is the target system operation environment, and the system operation environment of the terminal device may be any type of system operation environment, which is not limited in the present invention. The preset algorithm set comprises analysis algorithms corresponding to different system operating environments meeting the preset conditions, and the preset algorithm set further comprises configuration parameters corresponding to different system operating environments not meeting the preset conditions. The preset condition may refer to that the system operating environment supports C language and/or C + + language.
Further, step S12 includes: when the target system operating environment meets a preset condition, judging whether a historical analysis program matched with the target system operating environment exists or not; when no historical analysis program matched with the target system operation environment exists, acquiring a target analysis algorithm corresponding to the target system operation environment from the preset algorithm set, wherein the preset algorithm set comprises analysis algorithms corresponding to different system operation environments meeting the preset conditions; and obtaining the first target analysis program based on the target analysis algorithm. Wherein the step of obtaining the first target analysis program based on the target analysis algorithm comprises: compiling the target analysis algorithm into a first target analysis program in a wasm format by using an emmake emcc compiler of WebAssembly.
It should be noted that, when the target system operating environment meets the preset condition, the target system supports C language and C + + language. Firstly, whether a history analysis program matched with the operation environment of the target system exists in the terminal equipment is judged, the history analysis program is an analysis program for analyzing the history data, the history analysis program is not unloaded after analyzing the history data to be analyzed, the history analysis program can be continuously used for data analysis, and the data to be analyzed can be analyzed by the history analysis program.
If no historical analysis program matched with the target system operation environment exists, an analysis algorithm matched with the target system operation environment, namely a target analysis algorithm, needs to be obtained from a preset algorithm set. When the languages supported by the target system operating environments are different, the target analysis algorithms corresponding to the same analysis process are also different.
For example, when the terminal device performs an analysis algorithm a on data to be analyzed, the target system operating environment meets a preset condition, and the target system operating environment only supports the C language version, the target analysis algorithm obtained in the preset algorithm set is an analysis algorithm a1 in the C language corresponding to the analysis algorithm a; when the target system operating environment meets the preset condition and only supports the C + + language, the target analysis algorithm obtained in the preset algorithm set is the analysis algorithm A2 in the C + + language corresponding to the A analysis algorithm, and the A1 and the A2 are different.
Specifically, the preset algorithm set may be obtained as follows: acquiring a preset system operating environment and a preset analysis algorithm; based on the preset analysis algorithm, obtaining a preset sub-analysis algorithm of a first preset language and preset configuration parameters of a second preset language; establishing a first mapping relation between a first subsystem operating environment meeting the preset condition in the preset system operating environment and the preset sub-analysis algorithm; establishing a second mapping relation between a second subsystem operating environment which does not meet the preset condition in the preset system operating environment and the preset configuration parameter; and obtaining the preset algorithm set based on the preset system operating environment, the preset sub-analysis algorithm, the preset configuration parameter, the first mapping relation and the second mapping relation.
It should be noted that the preset system operation environment should be as many types as possible so as to support more types of language environments, for example, the preset system operation environment relates to a system operation environment supporting C language, C + + language, JS language, Python language, and the like. The preset analysis algorithm may refer to a set of analysis algorithms involved in analyzing data, and generally, the preset analysis algorithm includes a plurality of analysis algorithms, and the plurality of analysis algorithms may include a plurality of analysis algorithms that can be parallel or a plurality of analysis algorithms that cannot be parallel; in order to perform a comprehensive analysis on the data, the kinds of preset analysis algorithms should be more.
In addition, each analysis algorithm in the preset analysis algorithms needs to obtain a preset sub-analysis algorithm of a first preset language (the first preset language includes two languages, namely C + + language and C language) corresponding to the preset analysis algorithm (the preset sub-analysis algorithm includes an analysis algorithm of the C + + language and an analysis algorithm of the C language corresponding to the analysis algorithm); meanwhile, it is also required to obtain preset configuration parameters of a second preset language (the second preset language includes a JS language and a Python language) corresponding to the analysis algorithm (the preset configuration parameters include a configuration parameter of the JS language and a configuration parameter of the Python language corresponding to the analysis algorithm). At this time, the first subsystem operating environment is a system operating environment which meets the preset condition in the preset system operating environment, and the second subsystem operating environment is a system operating environment which does not meet the preset condition in the preset system operating environment.
It can be understood that, usually, one analysis algorithm corresponds to the preset sub-analysis algorithm in the C + + language and the preset sub-analysis algorithm in the C language, and the preset sub-analysis algorithm corresponding to the analysis algorithm is only converted in the language and does not change the analysis process; the analysis algorithm also corresponds to the configuration parameters of the JS language and the configuration parameters of the Python language, in other words, one analysis algorithm corresponds to the analysis algorithm of 2 languages and the configuration parameters of 2 languages.
For example, the preset algorithm set relates to a D analysis algorithm and an E analysis algorithm, in a system operation environment supporting C language, the preset sub-analysis algorithm corresponding to C language of the D analysis algorithm is a D1 algorithm, in a system operation environment supporting C + + language, the preset sub-analysis algorithm corresponding to C + + language of the D analysis algorithm is a D2 algorithm, in a system operation environment supporting JS language, the preset configuration parameter corresponding to JS language of the D analysis algorithm is D3, and in a system operation environment supporting Python language, the preset configuration parameter corresponding to Python language of the D analysis algorithm is D4. Similarly, a preset sub-analysis algorithm E1 algorithm in the C language, a preset sub-analysis algorithm E2 algorithm in the C + + language, a preset configuration parameter E3 in the JS language and a preset configuration parameter E4 in the Python language corresponding to the E analysis algorithm are obtained. At this time, the obtained preset algorithm set includes 2 configuration parameters and 2 language analysis algorithms corresponding to the D analysis algorithm, and also includes 2 configuration parameters and 2 language analysis algorithms corresponding to the E analysis algorithm.
Further, when a history analysis program matched with the running environment of the target system exists, analyzing the data to be analyzed by using the history analysis program to obtain a third analysis result; and outputting the third analysis result.
If the historical analysis program exists, the data to be analyzed can be analyzed by directly utilizing the historical analysis program without compiling. In addition, the output of the third analysis result may be a display of the terminal device, and the present invention is not limited thereto.
Further, when the target system operating environment does not meet the preset condition, acquiring a target configuration parameter corresponding to the target system operating environment from the preset algorithm set, wherein the preset algorithm set also comprises configuration parameters corresponding to different system operating environments not meeting the preset condition; configuring a preset analysis program by using the target configuration parameters to obtain a second target analysis program; analyzing the data to be analyzed by using the second target analysis program to obtain a second analysis result; and outputting the second analysis result.
It should be noted that, when the target system operating environment does not satisfy the preset condition, the target system operating environment does not support the C language and the C + + language, generally, the target system operating environment at this time supports the JS language or the Python language, directly obtains the target configuration parameter corresponding to the target system operating environment in the preset algorithm set, and uses the target configuration parameter to perform a preset analysis on a preset analysis program (JS version analysis handler or Python version analysis handler) to obtain a second target analysis program, and uses the second target analysis program to analyze the data to be analyzed to obtain a second analysis result. When the languages of the target system operating environments are different, the target configuration parameters corresponding to the same analysis process are also different.
For example, for an analysis algorithm F, in the system runtime environment supporting the JS language, the target configuration parameter is F1, and in the system runtime environment supporting the Python language, the target configuration parameters are F2, F1, and F2 are different. The method comprises the steps that the terminal equipment carries out B analysis algorithm on data to be analyzed, when the target system operation environment does not meet preset conditions and only supports the JS language version, the target configuration parameters obtained in a preset algorithm set are configuration parameters B1 of the JS language corresponding to the B analysis algorithm; when the target system operating environment does not meet the preset condition and only supports the Python language, the target configuration parameters acquired in the preset algorithm set are the configuration parameters B2 of the Python language corresponding to the B analysis algorithm, and B1 is different from B2.
Generally, when data to be analyzed is analyzed, a preset algorithm set comprises a plurality of analysis algorithms; when multiple types of data analysis can be run in parallel, multiple types of analysis algorithms that can be run in parallel can simultaneously perform the above steps to obtain multiple first target analysis programs or multiple second target analysis programs. Taking a first target analysis program as an example, the first target analysis program comprises a plurality of target analysis programs; the step of analyzing the data to be analyzed by using the first target analysis program to obtain a first analysis result includes: performing parallel analysis on the data to be analyzed by using a plurality of first target analysis programs to obtain a plurality of sub-analysis results; obtaining the first analysis result based on the plurality of sub-analysis results. When there are a plurality of second target analysis programs, the operation method refers to the description, and details are not described herein.
The target analysis programs can run in parallel, the analysis speed of the data to be analyzed is high, and the analysis efficiency of the data to be analyzed is high.
In addition, the preset algorithm set comprises a plurality of analysis algorithms, and when the plurality of types of data analysis cannot be executed in parallel, the data analysis can be executed only according to a certain analysis sequence step by step, the steps are executed respectively to obtain a plurality of first target analysis programs (or second target analysis programs), the first target analysis programs (or second target analysis programs) are executed respectively according to the certain analysis sequence, a plurality of analysis results corresponding to the steps are obtained, and the final first analysis result (or second analysis result) is obtained based on the analysis results.
In a specific application, all kinds of analysis algorithms in a preset algorithm set need to be traversed to obtain a plurality of first target analysis programs (or a plurality of second target analysis programs) with relatively complete quantity and functions, and after a plurality of analysis results corresponding to the plurality of first target analysis programs (or the plurality of second target analysis programs) are obtained, a first analysis result (or a second analysis result) is obtained based on the plurality of analysis results.
It can be understood that when the target system operating environment of the terminal device meets the preset condition and the target system operating environment supports both C language and C + + language, a target analysis algorithm with high efficiency needs to be selected from the preset algorithm set; similarly, when the target system operation environment of the terminal device does not meet the preset condition, the target system operation environment does not support the C language and the C + + language, and supports the JS language or the python language, it is necessary to select a target configuration parameter with high efficiency from the preset algorithm set to continue configuring the preset analysis program.
The technical scheme of the invention provides a data analysis method, which is used for terminal equipment and receives data to be analyzed; obtaining a first target analysis program based on the target system operating environment and a preset algorithm set of the terminal equipment; analyzing the data to be analyzed by utilizing the first target analysis program to obtain a first analysis result; and outputting the first analysis result. In the conventional data analysis method, a terminal device (front end) transmits data to be analyzed to a back end, and the back end performs data analysis to obtain an analysis result, wherein the data to be analyzed needs to be transmitted between the front end and the back end, so that the analysis efficiency is low, and the analysis speed is slow.
Referring to fig. 3, fig. 3 is a block diagram of a first embodiment of a data analysis apparatus according to the present invention, where the apparatus is used for a terminal device, and the apparatus includes:
a receiving module 10, configured to receive data to be analyzed;
an obtaining module 20, configured to obtain a first target analysis program based on a target system operating environment and a preset algorithm set of the terminal device;
the analysis module 30 is configured to analyze the data to be analyzed by using the first target analysis program to obtain a first analysis result;
and the output module 40 is used for outputting the first analysis result.
The above description is only an alternative embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications and equivalents of the present invention, which are made by the contents of the present specification and the accompanying drawings, or directly/indirectly applied to other related technical fields, are included in the scope of the present invention.