Disclosure of Invention
The invention provides a data identification method, a device, an electronic device and a computer readable storage medium of a record carrier, and mainly aims to solve the problems of unsmooth, delay and even failure of data identification caused by network, system computing power and the like in the data identification process.
To achieve the above object, the present invention provides a data identification method for a record carrier, comprising:
receiving a data identification instruction, and analyzing the data identification instruction to obtain a record carrier, wherein the record carrier comprises original data;
converting the original data into structural data according to a pre-constructed structured text;
constructing a transmission communication channel for transmitting the structural data, and binding a data re-pushing mechanism in the transmission communication channel;
connecting the record carrier using the transmission communication channel, acquiring the structure data from the record carrier using the transmission communication channel when the connection is successful, and performing data monitoring on the structure data in acquiring the structure data;
if it is monitored that the transmission communication channel does not acquire the structural data from the record carrier, utilizing the data push mechanism to push the structural data to the transmission communication channel;
and returning to the sender of the data identification instruction until the transmission communication channel acquires the structural data.
Optionally, the converting the original data into structural data according to a pre-constructed structured text includes:
according to the data type of the original data, establishing a mapping relation for converting the original data into the structural data;
sequentially converting the original data into mapping data by utilizing the mapping relation;
and generating a hollow structure data table according to the arrangement rule of the structured text, and filling the mapping data in the hollow structure data table to obtain the structure data.
Optionally, the constructing a transmission communication channel for transmitting the structure data includes:
step A: receiving a channel requirement instruction, and establishing a channel definition program by using the channel requirement instruction;
and B: generating a channel to be tested according to the channel definition program;
and C: constructing a channel transmission test case according to the structural data;
step D: utilizing the channel transmission test case to test whether the transmission in the channel to be tested is successful;
step E: if the channel transmission test case test fails to transmit in the channel to be tested, modifying the channel definition program and returning to the step A;
step F: and if the channel transmission test case test is successfully transmitted in the channel to be tested, obtaining the transmission communication channel.
Optionally, the constructing a channel transmission test case according to the structure data includes:
designing a transmission state code according to the address of the channel to be tested and the parameter request mode;
and taking the transmission state code and the structural data as the incoming parameters of a pre-constructed test script to obtain the test case.
Optionally, the connecting the record carrier by using the transmission communication channel further comprises:
pushing a test message to a pre-constructed test server by using the transmission communication channel, wherein the test server does not receive the test message;
when the test server fails to receive the test message, caching the test message in the transmission communication channel by using the data re-pushing mechanism, and continuously pushing the test message to the test server in a polling mode;
and ending the pushing of the test message until the cache time threshold value of the test message is reached or the pushing times reaches the pushing threshold value, and finishing the re-pushing test of the data re-pushing mechanism.
Optionally, said connecting said record carrier using said transport communication channel comprises:
acquiring an interface address where the record carrier is located;
binding the interface address with the transmission communication channel;
and sending the test message to the record carrier by using the transmission communication channel, and completing the connection between the transmission communication channel and the record carrier if the record carrier is successfully received.
Optionally, the using the data pushing mechanism to push the structure data to the transmission communication channel includes:
buffering the structure data into the record carrier;
extracting said structure data from said record carrier using said data-push mechanism based on said interface address;
and pushing the structure data to the transmission communication channel.
In order to solve the above problems, the present invention also provides a data recognition apparatus for a record carrier, the apparatus comprising:
the original data processing module is used for receiving a data identification instruction, analyzing the data identification instruction to obtain a record carrier, wherein the record carrier comprises original data, and converting the original data into structural data according to a pre-constructed structured text;
the push mechanism binding module is used for constructing a transmission communication channel for transmitting the structural data and binding a data push mechanism in the transmission communication channel;
a data monitoring module, configured to connect the record carrier using the transmission communication channel, and when the connection is successful, collect the structure data from the record carrier using the transmission communication channel, and perform data monitoring on the structure data in collecting the structure data;
and the data transmission module is used for utilizing the data re-pushing mechanism to re-push the structural data to the transmission communication channel until the transmission communication channel acquires the structural data and returning the structural data to the sender of the data identification instruction if the transmission communication channel is monitored not to acquire the structural data from the record carrier.
In order to solve the above problem, the present invention also provides an electronic device, including:
a memory storing at least one instruction; and
a processor executing instructions stored in the memory to implement the method of data identification of a record carrier as claimed in any one of the preceding claims.
In order to solve the above problem, the present invention further provides a computer-readable storage medium including a storage data area and a storage program area, the storage data area storing created data, the storage program area storing a computer program; wherein the computer program when executed by a processor implements a method of data recognition of a record carrier as claimed in any one of the preceding claims.
Compared with the prior art, the technical scheme of the invention firstly converts the original data in the record carrier into the structural data in a structural form according to the data identification instruction, and prevents the subsequent steps of data searching, transmitting and the like from being influenced due to different recording forms of the data recorded by different record carriers. Therefore, the data identification method, the data identification device and the computer readable storage medium of the record carrier can solve the problems of unsmooth data identification, delay and even failure caused by network, system computing power and the like in the data identification process.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The embodiment of the present application provides a data identification method for a record carrier, and the execution subject of the data identification method for the record carrier includes but is not limited to at least one of a server, a terminal and other electronic devices that can be configured to execute the method provided by the embodiment of the present application. In other words, the data identification method of the record carrier may be performed by software or hardware installed in the terminal device or the server device, and the software may be a block chain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like.
Referring to fig. 1, a flowchart of a data identification method for a record carrier according to an embodiment of the present invention is shown. In this embodiment, the data identification method of the record carrier comprises:
s1, receiving a data identification command, and analyzing the data identification command to obtain a record carrier, wherein the record carrier comprises original data.
In an embodiment of the present invention, the record carrier comprises a storage hard disk, a system, a computer, and the like, which are responsible for recording, storing, and updating data, such as a personnel information recording system, a supplier information recording system, and the like. However, different systems store different data forms, so that it is difficult to unify data from one system to another, such as the personal information recording system a and the personal information recording system B, which certainly record different personal information, so that data recorded by different record carriers are all referred to as original data.
The data identification instruction may be issued by a user, for example, the user wants to know the related information of a part of persons in the person information recording system, so as to issue the data identification instruction.
And S2, converting the original data into structural data according to the pre-constructed structured text.
As can be seen from the above, different record carriers need to convert original data into a unified structured text because the way of recording data is different, and in detail, referring to fig. 2, the converting the original data into the structured data according to the pre-constructed structured text includes:
s21, establishing a mapping relation for converting the original data into the structural data according to the data type of the original data;
s22, sequentially converting the original data into mapping data by utilizing the mapping relation;
and S23, generating a hollow structure data table according to the arrangement rule of the structured text, and filling the mapping data in the hollow structure data table to obtain the structure data.
In the embodiment of the invention, the mapping relation comprises structure mapping and grammar mapping. The structural mapping is to reconstruct a simple corresponding relationship according to a corresponding relationship of original data on a hierarchical structure, and if the original data has main data and sub data differences on the hierarchical structure, wherein the main data has 3 groups, and each group of main data has 5 groups of sub data, the mapping data obtained through the mapping relationship can be represented as "2/1" to represent the 2 nd sub data in the first group of main data.
The grammar mapping refers to changing the relation of the encoding rule, the attribute rule and the like of the original data, for example, the original encoding format of the employee information is ANSI-name, and the original encoding format is changed into the name after the mapping relation.
Further, the title, the line title, the column title and the like of the structured text are all fixed, so that the empty structure data table can be generated by using the fixed title, the line title, the column title and the like, and the corresponding mapping data is filled in sequence according to the title, thereby generating the structure data.
S3, constructing a transmission communication channel for transmitting the structure data, and binding a data recurrence mechanism in the transmission communication channel.
In order to quickly transmit the structural data and improve transmission security, the embodiment of the present invention does not directly utilize an internet transmission manner, but first constructs a transmission communication channel, and in detail, the constructing of the transmission communication channel for transmitting the structural data includes:
step A: receiving a channel requirement instruction, and establishing a channel definition program by using the channel requirement instruction;
and B: generating a channel to be tested according to the channel definition program;
and C: constructing a channel transmission test case according to the structural data;
step D: utilizing the channel transmission test case to test whether the transmission in the channel to be tested is successful;
step E: if the channel transmission test case test fails to transmit in the channel to be tested, modifying the channel definition program and returning to the step A;
step F: and if the channel transmission test case test is successfully transmitted in the channel to be tested, obtaining the transmission communication channel.
In the embodiment of the invention, the channel definition program is a pre-programmed code set and comprises an address of a transmission communication channel and a parameter request mode, wherein the parameter request mode comprises a request parameter type, a request parameter, a return parameter and other functions and class sets.
Further, because the data types of different structural data are different, the invention constructs a corresponding test case according to the structural data obtained in real time, and in detail, the constructing a channel transmission test case according to the structural data includes:
designing a transmission state code according to the address of the channel to be tested and the parameter request mode;
and taking the transmission state code and the structural data as the incoming parameters of a pre-constructed test script to obtain the test case.
In the embodiment of the invention, the test script is generally a script program which is pre-written by a programmer, and only needs to be correspondingly given parameters according to the input parameter specification of the program in the script, wherein the transmission state code and the structure data are generally input parameters which must be given, and after the test case is obtained, the test case is used for testing the channel to be tested until the transmission communication channel is obtained after the test is passed.
Further, the data re-pushing mechanism is a re-sending mechanism constructed to prevent data transmission failure, and in an embodiment of the present invention, the connecting the record carrier by using the transmission communication channel further includes:
pushing a test message to a pre-constructed test server by using the transmission communication channel, wherein the test server does not receive the test message;
when the test server fails to receive the test message, caching the test message in the transmission communication channel by using the data re-pushing mechanism, and continuously pushing the test message to the test server in a polling mode;
and ending the pushing of the test message until the cache time threshold value of the test message is reached or the pushing times reaches the pushing threshold value, and finishing the re-pushing test of the data re-pushing mechanism.
In the embodiment of the present invention, the test server presets that the test message sent by the transmission communication channel will not be received, so that after the test message is pushed to the test server, the test server has no response (response timeout predetermined time, such as 15 seconds, 30 seconds, etc.) or the test server returns a response code 501, 502, 503, 504 to the transmission communication channel, which indicates that the pushing of the test message fails, and therefore the data re-pushing mechanism will cache the test message in the transmission communication channel.
Further, the cache time threshold value can be set to be 5 minutes, 10 minutes and the like, the pushing times can be set to be 5 times, 10 times and the like, when the cache time threshold value or the pushing threshold value is reached, the data re-pushing mechanism is indicated to run normally, and the test on the data re-pushing mechanism is completed.
S4, connecting the record carrier by using the transmission communication channel, when the connection is successful, collecting the structure data from the record carrier by using the transmission communication channel, and performing data monitoring on the structure data in collecting the structure data.
In the embodiment of the present invention, referring to fig. 3, said connecting the record carrier by using the transmission communication channel includes:
s41, obtaining the interface address of the record carrier;
s42, binding the interface address and the transmission communication channel;
s43, sending the test message to the record carrier by using the transmission communication channel, and if the record carrier is successfully received, completing the connection between the transmission communication channel and the record carrier.
In the embodiment of the present invention, since the record carrier needs to share data, an interface address is generally exposed for a data user to call, and therefore, the record carrier can be used as a transmission destination of the transmission communication channel according to the interface address, and after the test message is sent, the connection between the transmission communication channel and the record carrier can be realized.
In the embodiment of the present invention, a manner in which the transmission communication channel collects the structure data from the record carrier is the same as a manner in which the transmission communication channel sends the test message, and is not described herein again.
S5, if it is monitored that the structure data is not collected from the record carrier by the transmission communication channel, using the data push mechanism to push the structure data to the transmission communication channel.
In this embodiment of the present invention, referring to fig. 4, the utilizing the data push mechanism to push the structure data to the transmission communication channel includes:
s51, buffering the structure data into the record carrier;
s52, extracting the structure data from the record carrier by using the data push mechanism based on the interface address;
and S53, pushing the structure data to the transmission communication channel.
In the embodiment of the present invention, since the data retrusion mechanism only binds to the transmission communication channel and does not bind to the record carrier, before the structural data is extracted from the record carrier by using the data retrusion mechanism, the data retrusion mechanism needs to be bound to the record carrier, and regarding the binding of the data retrusion mechanism to the record carrier, the binding is the same as the binding of the data retrusion mechanism to the transmission communication channel, and a test after the binding is also included, which is not described herein again.
And S6, until the transmission communication channel collects the structural data, and returns the structural data to the sender of the data identification instruction.
In another embodiment of the present invention, when the number of times of the re-push or the buffering time reaches a specified threshold, a situation that the re-push of the structure data also fails may occur, so that when the re-push of the structure data still fails, the whole technical implementation process needs to be re-checked to achieve timely error correction and timely remediation.
In addition, if the transmission communication channel acquires the structural data, the structural data can be returned to the sender of the data identification instruction according to the IP address of the data identification instruction, so that the data identification of the record carrier is completed.
The embodiment of the invention firstly converts the original data in the record carrier into the structural data in a structural form according to the data identification instruction, prevents the steps of subsequent data searching, transmission and the like from being influenced due to different recording forms of the data recorded by different record carriers, in the embodiment of the invention, after the data is searched, the data is not directly transmitted to the user by using the network, but a transmission communication channel with higher safety is constructed, meanwhile, a data push mechanism is added in the transmission communication channel, when the data transmission to the user fails, the data push mechanism is used for repeatedly pushing, the data is ensured to be safely and efficiently transmitted to the user, the invention therefore provides a method, an apparatus and a computer-readable storage medium for data identification of a record carrier, the phenomenon that data identification is blocked, delayed and even failed due to network, system computing power and other reasons in the data identification process can be solved.
Fig. 5 shows a block schematic diagram of a data recognition device for a record carrier according to the invention.
The data recognition device 100 of the record carrier according to the invention can be installed in an electronic device. Depending on the implemented functionality, the data recognition means of the record carrier may comprise a raw data processing module 101, a pushback mechanism binding module 102, a data monitoring module 103 and a data transmission module 104. The module of the present invention, which may also be referred to as a unit, refers to a series of computer program segments that can be executed by a processor of an electronic device and that can perform a fixed function, and that are stored in a memory of the electronic device.
In the present embodiment, the functions regarding the respective modules/units are as follows:
the original data processing module 101 is configured to receive a data identification instruction, analyze the data identification instruction to obtain a record carrier, where the record carrier includes original data, and convert the original data into structural data according to a pre-constructed structured text;
the pushing mechanism binding module 102 is configured to construct a transmission communication channel for transmitting the structure data, and bind a data pushing mechanism in the transmission communication channel;
the data monitoring module 103 is configured to connect the record carrier through the transmission communication channel, acquire the structure data from the record carrier through the transmission communication channel when the connection is successful, and perform data monitoring on the structure data in acquiring the structure data;
the data transmission module 104 is configured to, if it is monitored that the transmission communication channel does not acquire the structural data from the record carrier, use the data re-pushing mechanism to re-push the structural data to the transmission communication channel until the transmission communication channel acquires the structural data, and return the structural data to the sender of the data identification instruction.
Each module in the data identification apparatus 100 of the record carrier provided in the embodiment of the present invention can use the same means as the data identification method of the record carrier, and the specific implementation steps are not repeated herein, and the technical effect generated by the functions of each module/unit is the same as the technical effect of the data identification method of the record carrier, i.e. the phenomena of data identification blocking, delay and even failure caused by network and system computing power in the data identification process can be solved.
Fig. 6 is a schematic diagram of an electronic device implementing the data recognition method for a record carrier according to the present invention.
The electronic device 1 may comprise a processor 10, a memory 11 and a bus, and may further comprise a computer program, such as a data recognition program 12 of a record carrier, stored in the memory 11 and executable on the processor 10.
The memory 11 includes at least one type of readable storage medium, which includes flash memory, removable hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device 1, such as a removable hard disk of the electronic device 1. The memory 11 may also be an external storage device of the electronic device 1 in other embodiments, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the electronic device 1. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device 1. The memory 11 may be used not only for storing application software installed in the electronic device 1 and various types of data, such as codes of the data identification program 12 of the record carrier, etc., but also for temporarily storing data that has been output or is to be output.
The processor 10 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same or different functions, including one or more Central Processing Units (CPUs), microprocessors, digital Processing chips, graphics processors, and combinations of various control chips. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects various components of the whole electronic device by using various interfaces and lines, and executes various functions and processes data of the electronic device 1 by running or executing programs or modules (e.g., executing a data recognition program of a record carrier, etc.) stored in the memory 11 and calling data stored in the memory 11.
The bus may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is arranged to enable connection communication between the memory 11 and at least one processor 10 or the like.
Fig. 6 only shows an electronic device with components, and it will be understood by a person skilled in the art that the structure shown in fig. 6 does not constitute a limitation of the electronic device 1, and may comprise fewer or more components than shown, or a combination of certain components, or a different arrangement of components.
For example, although not shown, the electronic device 1 may further include a power supply (such as a battery) for supplying power to each component, and preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so as to implement functions of charge management, discharge management, power consumption management, and the like through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. The electronic device 1 may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
Further, the electronic device 1 may further include a network interface, and optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a bluetooth interface, etc.), which are generally used for establishing a communication connection between the electronic device 1 and other electronic devices.
Optionally, the electronic device 1 may further comprise a user interface, which may be a Display (Display), an input unit (such as a Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable for displaying information processed in the electronic device 1 and for displaying a visualized user interface, among other things.
It is to be understood that the described embodiments are for purposes of illustration only and that the scope of the appended claims is not limited to such structures.
The data identification program 12 of the record carrier stored by the memory 11 in the electronic device 1 is a combination of instructions that, when executed in the processor 10, may implement:
receiving a data identification instruction, and analyzing the data identification instruction to obtain a record carrier, wherein the record carrier comprises original data;
converting the original data into structural data according to a pre-constructed structured text;
constructing a transmission communication channel for transmitting the structural data, and binding a data re-pushing mechanism in the transmission communication channel;
connecting the record carrier using the transmission communication channel, acquiring the structure data from the record carrier using the transmission communication channel when the connection is successful, and performing data monitoring on the structure data in acquiring the structure data;
if it is monitored that the transmission communication channel does not acquire the structural data from the record carrier, utilizing the data push mechanism to push the structural data to the transmission communication channel;
and returning to the sender of the data identification instruction until the transmission communication channel acquires the structural data.
Further, the integrated modules/units of the electronic device 1, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. The computer-readable medium may include: any entity or device capable of carrying said computer program code, recording medium, U-disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM).
Further, the computer usable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to the use of the blockchain node, and the like.
The present invention also provides a computer-readable storage medium, storing a computer program which, when executed by a processor of an electronic device, may implement:
receiving a data identification instruction, and analyzing the data identification instruction to obtain a record carrier, wherein the record carrier comprises original data;
converting the original data into structural data according to a pre-constructed structured text;
constructing a transmission communication channel for transmitting the structural data, and binding a data re-pushing mechanism in the transmission communication channel;
connecting the record carrier using the transmission communication channel, acquiring the structure data from the record carrier using the transmission communication channel when the connection is successful, and performing data monitoring on the structure data in acquiring the structure data;
if it is monitored that the transmission communication channel does not acquire the structural data from the record carrier, utilizing the data push mechanism to push the structural data to the transmission communication channel;
and returning to the sender of the data identification instruction until the transmission communication channel acquires the structural data.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method can be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof.
The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any accompanying claims should not be construed as limiting the claim concerned.
Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the system claims may also be implemented by one unit or means in software or hardware. The terms second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.