WO2021103409A1 - 一种数据生成方法、装置、电子设备及存储介质 - Google Patents
一种数据生成方法、装置、电子设备及存储介质 Download PDFInfo
- Publication number
- WO2021103409A1 WO2021103409A1 PCT/CN2020/086799 CN2020086799W WO2021103409A1 WO 2021103409 A1 WO2021103409 A1 WO 2021103409A1 CN 2020086799 W CN2020086799 W CN 2020086799W WO 2021103409 A1 WO2021103409 A1 WO 2021103409A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- target
- data
- hbase
- generated
- row key
- 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.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/33—Querying
- G06F16/335—Filtering based on additional data, e.g. user or group profiles
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/35—Clustering; Classification
- G06F16/355—Creation or modification of classes or clusters
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
- G06F8/42—Syntactic analysis
- G06F8/427—Parsing
Definitions
- This application relates to the technical field of data processing in artificial intelligence, and in particular to a data generation method, device, electronic equipment, and storage medium.
- a data generation method includes:
- a calculation engine is used to write the intermediate data file into the HBASE library to obtain the data to be generated.
- the present application provides a data generation device, the device includes:
- the acquiring unit is configured to acquire the trigger interface of the data generating instruction when the data generating instruction is received;
- the recognition unit is used to recognize all the text on the trigger interface by using text recognition technology
- the extraction unit is used to extract at least one keyword from all the texts to obtain the attribute data of the data to be generated;
- the encapsulation unit is used to encapsulate the attribute data using JSON technology to obtain the target string;
- the parsing unit is used to parse the target string using JSON technology to obtain target parameters
- the parsing unit is further configured to analyze the target parameter using a shallow semantic analysis method to obtain the target type of the target parameter;
- the retrieval unit is used to retrieve the row key generation strategy corresponding to the target type from the HBASE library
- a generating unit configured to generate a target row key of the target parameter in the HBASE library based on the row key generation strategy
- the obtaining unit is further configured to obtain the target column name from the target parameter
- the generating unit is further configured to generate an intermediate data file according to the target column name and the target row key;
- the writing unit is configured to use a calculation engine to write the intermediate data file into the HBASE library to obtain the data to be generated.
- This application provides an electronic device, which includes:
- Memory storing at least one instruction
- the processor executes the instructions stored in the memory to implement the data generation method.
- a computer-readable storage medium stores at least one instruction, and the at least one instruction is executed by a processor in an electronic device to implement the data generation method.
- this application can obtain the trigger interface of the data generation instruction, use text recognition technology to recognize all the text on the trigger interface, and extract all the text from the trigger interface.
- At least one keyword is used to obtain the attribute data of the data to be generated, the attribute data is encapsulated using JSON technology to obtain the target string, the target string is parsed using JSON technology to obtain the target parameters, and the shallow semantic analysis method is used to parse the data.
- the target parameter, the target type of the target parameter is obtained, the row key generation strategy corresponding to the target type is retrieved from the HBASE library, and the target parameter in the HBASE library is generated based on the row key generation strategy Target row key, obtain the target column name from the target parameter, generate an intermediate data file according to the target column name and the target row key, and write the intermediate data file into the HBASE library using a calculation engine, Obtaining the data to be generated can not only generate a large amount of data based on the HBASE library, but also improve the efficiency of data generation.
- Fig. 1 is a flowchart of a preferred embodiment of the data generation method of the present application.
- Fig. 2 is a functional module diagram of a preferred embodiment of the data generating device of the present application.
- FIG. 3 is a schematic structural diagram of an electronic device implementing a preferred embodiment of the data generation method of the present application.
- FIG. 1 it is a flowchart of a preferred embodiment of the data generation method of the present application. According to different needs, the order of the steps in the flowchart can be changed, and some steps can be omitted.
- the data generation method is applied to one or more electronic devices.
- the electronic device is a device that can automatically perform numerical calculation and/or information processing in accordance with pre-set or stored instructions. Its hardware includes but is not limited to Microprocessor, Application Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA), Digital Processor (Digital Signal Processor, DSP), embedded equipment, etc.
- ASIC Application Specific Integrated Circuit
- FPGA Field-Programmable Gate Array
- DSP Digital Processor
- embedded equipment etc.
- the electronic device may be any electronic product that can interact with a user with a human machine, for example, a personal computer, a tablet computer, a smart phone, a personal digital assistant (PDA), a game console, an interactive network television ( Internet Protocol Television, IPTV), smart wearable devices, etc.
- a personal computer for example, a personal computer, a tablet computer, a smart phone, a personal digital assistant (PDA), a game console, an interactive network television ( Internet Protocol Television, IPTV), smart wearable devices, etc.
- PDA personal digital assistant
- IPTV Internet Protocol Television
- smart wearable devices etc.
- the electronic device may also include a network device and/or user equipment.
- the network device includes, but is not limited to, a single network server, a server group composed of multiple network servers, or a cloud composed of a large number of hosts or network servers based on cloud computing.
- the network where the electronic device is located includes, but is not limited to, the Internet, a wide area network, a metropolitan area network, a local area network, a virtual private network (Virtual Private Network, VPN), etc.
- the data generation instruction may be triggered by the user, or it may be automatically triggered when certain conditions are met, which is not limited in the present application.
- the meeting certain conditions includes, but is not limited to: meeting a preset time and so on.
- the preset time may include a certain time point, or include a time period, etc., for example: the preset time may be 7 o'clock in the morning every day.
- the trigger interface is composed of an input text box and a submit button, and is mainly used to collect information.
- the input text box may have various forms, wherein the content of the input text box may include, but is not limited to: text fields, characters, and the like.
- S11 Recognize all the text on the trigger interface by using text recognition technology.
- all the characters include, but are not limited to: Chinese, characters, numbers, etc.
- the electronic device uses text recognition technology to recognize the trigger interface to obtain all the text on the trigger interface.
- the trigger interface includes an input text box and a submit button.
- S12 Extract at least one keyword from all the texts to obtain attribute data of the data to be generated.
- the attribute data may include, but is not limited to: the number of rows, table names, column names, file names, and so on.
- the electronic device extracts at least one keyword from all the words, and obtains the attribute data of the data to be generated includes:
- the electronic device uses a Chinese keyword extraction algorithm based on high-dimensional clustering technology to extract at least one keyword from all the texts to obtain attribute data of the data to be generated.
- the electronic device performs fast word segmentation on all the characters according to a pre-configured target dictionary to obtain the first word segmentation, calculates the target word frequency of the first word segmentation, and determines the first word segmentation whose target word frequency is greater than the preset word frequency Is an initial keyword, and the electronic device trims the initial keyword according to a preset small dictionary to obtain a final keyword, and determines the final keyword as the attribute data of the data to be generated.
- the target dictionary may include common keywords.
- the small dictionary may include, but is not limited to function words, stop words, etc.
- the attribute data of the data to be generated can be determined accurately and quickly.
- the target string is encapsulated by the attribute data, and its expression form is ⁇ tag: attribute data ⁇ .
- the electronic device adopts JSON technology to encapsulate the attribute data to obtain the target string including:
- the electronic device retrieves the target tag corresponding to each attribute data in the attribute data from the HBASE library, and further, the electronic device uses JSON technology to encapsulate each attribute data and the target tag corresponding to each attribute data , Get the target string.
- the JSON technology is a lightweight data exchange format.
- the JSON technology uses a text format completely independent of programming languages to store and represent data, which is easy to read and write, and is also easy to parse and generate by machines, and effectively improves network transmission efficiency.
- the HBASE library is a distributed, column-oriented open source database.
- attribute data 1 is a name
- attribute data 2 is a gender
- the electronic device retrieves the target tag corresponding to the name from the HBASE library as A, retrieves the target tag corresponding to the gender as B, and encapsulates the name and A , Obtain the target string of the attribute data 1 as ⁇ A: name ⁇ , encapsulate gender and B, and obtain the target string of the attribute data 2 as ⁇ B: gender ⁇
- the attribute data is encapsulated into the target character string, so that the attribute data can be transmitted to the back-end server for data processing along with the target character string.
- the target parameter includes, but is not limited to: table name, row number, column name, file name, and so on.
- the method before using JSON technology to parse the target string to obtain target parameters, the method further includes:
- the electronic device uses ajax (Asynchronous Javascript And XML) technology to transmit the target character string to the back-end server of the electronic device.
- ajax Asynchronous Javascript And XML
- the ajax technology is a technology for creating better, faster and more interactive Web applications.
- the electronic device adds the target character string to the post request, and uses the ajax technology to transmit the post request to the back-end server.
- the ajax technology is used to receive the target character string from the front-end page of the electronic device, and data can be exchanged with the back-end server without reloading the front-end page, thereby improving efficiency.
- the use of JSON technology to parse the target string to obtain target parameters includes:
- the electronic device acquires all target tags in the target character string, and further, the electronic device extracts data corresponding to each target tag in all target tags as the target parameter.
- the target character string of the attribute data 1 is ⁇ A: name ⁇
- the target character string of the attribute data 2 is ⁇ B: gender ⁇
- the electronic device obtains the target tag A
- the target tag B of the attribute data 2 extracts the name in the target string ⁇ A: name ⁇ according to the target tag A as a target parameter, and extracts the target character according to the target tag B
- the gender in the string ⁇ B: gender ⁇ is used as the target parameter.
- the JSON technology can be used to quickly and accurately deserialize the target string into the target parameters required by the backend.
- S15 Analyze the target parameter using a shallow semantic analysis method to obtain the target type of the target parameter.
- the electronic device adopts a shallow semantic analysis method to analyze the semantic relationship between the target parameters to obtain the application scenario of the target parameter. Further, the electronic device is based on The application scenario determines the target type of the target parameter.
- the target type may include, but is not limited to: transaction data type, statistical data type, general data type, and so on.
- the row key generation strategy includes, but is not limited to, one or a combination of the following:
- the row key generation strategy is to increment by a time stamp.
- the row key generation strategy is self-increment in sequence.
- S17 Generate a target row key of the target parameter in the HBASE library based on the row key generation strategy.
- the electronic device obtains the number of rows from the target parameter, and further, the electronic device imports the row key generation strategy into the HBASE library, according to the number of rows And the row key generation strategy to generate the target row key.
- the number of the target row keys is equal to the number of rows.
- the target row key can be quickly generated without manual operation.
- the target column name refers to the name of each column of data, and the target column name is stored in the target parameter obtained by JSON technology analysis. Further, the target column name may be Including, but not limited to: name, gender, ID number, date of birth, etc.
- the obtaining the target list name from the target parameter includes:
- the electronic device matches the target parameter with the column name stored in the HBASE library, and further, the electronic device confirms the target parameter matching the column name as the target column name.
- the target column name can be obtained, which facilitates subsequent generation of an intermediate data file based on the target column name.
- the intermediate data file is a set of sentences generated in the HBASE library, and at least one piece of data with a fixed format can be generated through the intermediate data file.
- the generating an intermediate data file according to the target column name and the target row key includes:
- the electronic device retrieves the target data corresponding to the target column name from the HBASE library, determines the target location according to the target column name and the target row key, and writes the target data to the The target location, the intermediate data file is obtained.
- the writing the target data into the target location to obtain the intermediate data file specifically includes:
- the electronic device writes the target data into the target location through the statement put ⁇ table>, ⁇ rowkey>, ⁇ family:column>, ⁇ value>, repeats the above steps, until the target location is written in all For the target data, all the statements executed above are assembled to generate the intermediate data file.
- the amount of data stored in the HBASE library is large, but the data is messy.
- the target data corresponding to the target column name can be retrieved from the HBASE library according to user needs, and the intermediate The data file, in view of this, since the data is written corresponding to the target location, the data generated by the intermediate data file will all have a fixed format.
- the method further includes:
- the electronic device sends the intermediate data file to the intermediate data layer, and uses the intermediate data layer to save the intermediate data file.
- the intermediate data layer is a directory dedicated to storing intermediate files in the Linux system.
- the intermediate data file is saved, which can avoid the loss of the intermediate data file due to errors in the process of generating the data to be generated, thereby affecting the efficiency of data generation.
- the data to be generated is a set of data with a fixed format and generated based on the HBASE library.
- the using a computing engine to write the intermediate data file into the HBASE library to obtain the data to be generated includes:
- the electronic device divides the intermediate data file into at least one data block, calculates the number of the at least one data block, and obtains the target number. Further, the electronic device An HBASE table is created in the HBASE library, the HBASE table is partitioned using the target number as the number of partitions, and the calculation engine is used to write the at least one data block into the partitioned HBASE table to obtain the Data to be generated.
- the intermediate data file can be quickly written into the HBASE library, which improves the data generation rate.
- the method further includes:
- the electronic device obtains the table name and generation time of the data to be generated, and according to the table name and the generation time, the electronic device generates prompt information, and further, the electronic device sends the prompt information to a designated The contact's terminal device.
- the prompt information may include, but is not limited to: the name of the table of the data to be generated, the number of rows of the data to be generated, the generation time of the data to be generated, and the like.
- the designated contact person may be the trigger of the data generation instruction.
- the method further includes:
- the electronic device uses symmetric encryption technology to encrypt the data to be generated to obtain a ciphertext, and when it is detected that the ciphertext is successfully decrypted, it displays the data to be generated.
- this application can obtain the trigger interface of the data generation instruction, use text recognition technology to recognize all the text on the trigger interface, and extract all the text from the trigger interface.
- At least one keyword is used to obtain the attribute data of the data to be generated, the attribute data is encapsulated using JSON technology to obtain the target string, the target string is parsed using JSON technology to obtain the target parameters, and the shallow semantic analysis method is used to parse the data.
- the target parameter, the target type of the target parameter is obtained, the row key generation strategy corresponding to the target type is retrieved from the HBASE library, and the target parameter in the HBASE library is generated based on the row key generation strategy Target row key, obtain the target column name from the target parameter, generate an intermediate data file according to the target column name and the target row key, and write the intermediate data file into the HBASE library using a calculation engine, Obtaining the data to be generated can not only generate a large amount of data based on the HBASE library, but also improve the efficiency of data generation.
- the data generation device 11 includes an acquisition unit 110, an identification unit 111, an extraction unit 112, an encapsulation unit 113, an analysis unit 114, an retrieval unit 115, a generation unit 116, a writing unit 117, a sending unit 118, an encryption unit 119, and a display unit.
- the module/unit referred to in this application refers to a series of computer program segments that can be executed by the processor 13 and can complete fixed functions, and are stored in the memory 12. In this embodiment, the functions of each module/unit will be described in detail in subsequent embodiments.
- the acquiring unit 110 acquires the trigger interface of the data generation instruction.
- the data generation instruction may be triggered by the user, or it may be automatically triggered when certain conditions are met, which is not limited in the present application.
- the meeting certain conditions includes, but is not limited to: meeting a preset time and so on.
- the preset time may include a certain time point, or include a time period, etc., for example: the preset time may be 7 o'clock in the morning every day.
- the trigger interface is composed of an input text box and a submit button, and is mainly used to collect information.
- the input text box may have various forms, wherein the content of the input text box may include, but is not limited to: text fields, characters, and the like.
- the recognition unit 111 uses text recognition technology to recognize all text on the trigger interface.
- all the characters include, but are not limited to: Chinese, characters, numbers, etc.
- the recognition unit 111 uses text recognition technology to recognize the trigger interface to obtain all the text on the trigger interface.
- the trigger interface includes an input text box and a submit button.
- the extracting unit 112 extracts at least one keyword from all the texts to obtain the attribute data of the data to be generated.
- the attribute data may include, but is not limited to: the number of rows, table names, column names, file names, and so on.
- the extracting unit 112 extracts at least one keyword from all the words, and obtaining the attribute data of the data to be generated includes:
- the extraction unit 112 uses a Chinese keyword extraction algorithm based on high-dimensional clustering technology to extract at least one keyword from all the texts to obtain attribute data of the data to be generated.
- the extraction unit 112 performs fast word segmentation of all the texts according to a pre-configured target dictionary to obtain the first word segmentation, calculates the target word frequency of the first word segmentation, and calculates the target word frequency of the first word segmentation whose frequency is greater than the preset word frequency Determined as an initial keyword, the extraction unit 112 trims the initial keyword according to a preset small dictionary to obtain a final keyword, and determines the final keyword as the attribute data of the data to be generated.
- the target dictionary may include common keywords.
- the small dictionary may include, but is not limited to function words, stop words, etc.
- the attribute data of the data to be generated can be determined accurately and quickly.
- the encapsulation unit 113 uses JSON (JavaScript Object Notation, JS object notation) technology to encapsulate the attribute data to obtain the target string.
- JSON JavaScript Object Notation, JS object notation
- the target string is encapsulated by the attribute data, and its expression form is ⁇ tag: attribute data ⁇ .
- the encapsulation unit 113 adopts JSON technology to encapsulate the attribute data to obtain the target string including:
- the encapsulation unit 113 retrieves the target tag corresponding to each attribute data in the attribute data from the HBASE library. Further, the encapsulation unit 113 uses JSON technology to encapsulate each attribute data and each attribute data corresponding to it. The target tag is used to obtain the target string.
- the JSON technology is a lightweight data exchange format.
- the JSON technology uses a text format completely independent of programming languages to store and represent data, which is easy to read and write, and is also easy to parse and generate by machines, and effectively improves network transmission efficiency.
- the HBASE library is a distributed, column-oriented open source database.
- the attribute data 1 is the name
- the attribute data 2 is the gender
- the encapsulation unit 113 retrieves the target tag corresponding to the name from the HBASE library as A, retrieves the target tag corresponding to the gender as B, and compares the name with A. Encapsulate, obtain the target string of the attribute data 1 as ⁇ A: name ⁇ , encapsulate the gender and B, obtain the target string of the attribute data 2 as ⁇ B: gender ⁇
- the attribute data is encapsulated into the target character string, so that the attribute data can be transmitted to the back-end server for data processing along with the target character string.
- the parsing unit 114 uses JSON technology to parse the target string to obtain target parameters.
- the target parameter includes, but is not limited to: table name, row number, column name, file name, and so on.
- the method before using JSON technology to parse the target string to obtain target parameters, the method further includes:
- the transmission unit 121 uses ajax (Asynchronous Javascript And XML) technology to transmit the target character string to the back-end server of the electronic device.
- ajax Asynchronous Javascript And XML
- the ajax technology is a technology for creating better, faster and more interactive Web applications.
- the transmission unit 121 adds the target character string to the post request, and uses the ajax technology to transmit the post request to the back-end server.
- the ajax technology is used to receive the target string from the front-end page of the electronic device, and data can be exchanged with the back-end server without reloading the front-end page, thereby improving efficiency.
- the parsing unit 114 uses JSON technology to parse the target string to obtain target parameters including:
- the parsing unit 114 obtains all target tags in the target string, and further, the parsing unit 114 extracts data corresponding to each target tag in all the target tags as the target parameter.
- the target character string of the attribute data 1 is ⁇ A: name ⁇
- the target character string of the attribute data 2 is ⁇ B: gender ⁇
- the parsing unit 114 obtains the target tag A of the attribute data 1
- the target tag B of the attribute data 2 extracts the name in the target string ⁇ A: name ⁇ according to the target tag A as a target parameter, and extracts the target according to the target tag B
- the gender in the string ⁇ B: gender ⁇ is used as the target parameter.
- the JSON technology can be used to quickly and accurately deserialize the target string into the target parameters required by the backend.
- the parsing unit 114 uses a shallow semantic analysis method to analyze the target parameter to obtain the target type of the target parameter.
- the parsing unit 114 adopts a shallow semantic analysis method to analyze the semantic relationship between the target parameters to obtain the application scenario of the target parameters. Further, the parsing unit 114 114 Determine the target type of the target parameter according to the application scenario.
- the target type may include, but is not limited to: transaction data type, statistical data type, general data type, and so on.
- the retrieval unit 115 retrieves the row key generation strategy corresponding to the target type from the HBASE library.
- the row key generation strategy includes, but is not limited to, one or a combination of the following:
- the row key generation strategy is to increment by a time stamp.
- the row key generation strategy is self-increment in sequence.
- the generating unit 116 generates the target row key of the target parameter in the HBASE library based on the row key generation strategy.
- the generating unit 116 obtains the number of rows from the target parameter. Further, the generating unit 116 imports the row key generation strategy into the HBASE library, according to the The number of rows and the row key generation strategy are used to generate the target row key.
- the number of the target row keys is equal to the number of rows.
- the target row key can be quickly generated without manual operation.
- the obtaining unit 110 obtains the target column name from the target parameter.
- the target column name refers to the name of each column of data, and the target column name is stored in the target parameter obtained by JSON technology analysis. Further, the target column name may be Including, but not limited to: name, gender, ID number, date of birth, etc.
- the obtaining unit 110 obtaining the target list name from the target parameter includes:
- the acquiring unit 110 matches the target parameter with the column name stored in the HBASE library, and further, the acquiring unit 110 confirms the target parameter matching the column name as the target column name.
- the target column name can be obtained, which facilitates subsequent generation of an intermediate data file based on the target column name.
- the generating unit 116 generates an intermediate data file according to the target column name and the target row key.
- the intermediate data file is a set of sentences generated in the HBASE library, and at least one piece of data with a fixed format can be generated through the intermediate data file.
- the generating unit 116 generating an intermediate data file according to the target column name and the target row key includes:
- the generating unit 116 retrieves the target data corresponding to the target column name from the HBASE library, determines the target position according to the target column name and the target row key, and writes the target data to the target data.
- the target location is described, and the intermediate data file is obtained.
- the generating unit 116 writes the target data into the target location, and obtaining the intermediate data file specifically includes:
- the generating unit 116 writes the target data into the target location through the statement put ⁇ table>, ⁇ rowkey>, ⁇ family:column>, ⁇ value>, repeats the above steps, until the target locations are all written For the target data, all the statements executed above are assembled to generate the intermediate data file.
- the amount of data stored in the HBASE library is large, but the data is messy.
- the target data corresponding to the target column name can be retrieved from the HBASE library according to user needs, and the intermediate The data file, in view of this, since the data is written corresponding to the target location, the data generated by the intermediate data file will all have a fixed format.
- the method further includes:
- the sending unit 118 sends the intermediate data file to the intermediate data layer, and further, the saving unit 122 uses the intermediate data layer to save the intermediate data file.
- the intermediate data layer is a directory dedicated to storing intermediate files in the Linux system.
- the intermediate data file is saved, which can avoid the loss of the intermediate data file due to errors in the process of generating the data to be generated, thereby affecting the efficiency of data generation.
- the writing unit 117 uses a calculation engine to write the intermediate data file into the HBASE library to obtain the data to be generated.
- the data to be generated is a set of data with a fixed format and generated based on the HBASE library.
- the writing unit 117 uses a calculation engine to write the intermediate data file into the HBASE library, and obtaining the data to be generated includes:
- the writing unit 117 divides the intermediate data file into at least one data block, calculates the number of the at least one data block, and obtains the target number. Further, the The writing unit 117 creates an HBASE table in the HBASE library, partitions the HBASE table using the target number as the number of partitions, and uses a calculation engine to write the at least one data block into the partitioned HBASE table , To obtain the data to be generated.
- the intermediate data file can be quickly written into the HBASE library, which improves the data generation rate.
- the method further includes:
- the obtaining unit 110 obtains the table name and generation time of the data to be generated, and according to the table name and the generation time, the generation unit 116 generates prompt information, and further, the sending unit 118 transmits the prompt Message to the terminal device of the designated contact.
- the prompt information may include, but is not limited to: the name of the table of the data to be generated, the number of rows of the data to be generated, the generation time of the data to be generated, and the like.
- the designated contact person may be the trigger of the data generation instruction.
- the method further includes:
- the encryption unit 119 uses symmetric encryption technology to encrypt the data to be generated to obtain a ciphertext. Further, when it is detected that the ciphertext is successfully decrypted, the display unit 120 displays the data to be generated.
- this application can obtain the trigger interface of the data generation instruction, use text recognition technology to recognize all the text on the trigger interface, and extract all the text from the trigger interface.
- At least one keyword is used to obtain the attribute data of the data to be generated, the attribute data is encapsulated using JSON technology to obtain the target string, the target string is parsed using JSON technology to obtain the target parameters, and the shallow semantic analysis method is used to parse the data.
- the target parameter, the target type of the target parameter is obtained, the row key generation strategy corresponding to the target type is retrieved from the HBASE library, and the target parameter in the HBASE library is generated based on the row key generation strategy Target row key, obtain the target column name from the target parameter, generate an intermediate data file according to the target column name and the target row key, and write the intermediate data file into the HBASE library using a calculation engine, Obtaining the data to be generated can not only generate a large amount of data based on the HBASE library, but also improve the efficiency of data generation.
- FIG. 3 it is a schematic diagram of the structure of an electronic device implementing a preferred embodiment of the data generation method of the present application.
- the electronic device 1 includes, but is not limited to, a memory 12, a processor 13, and a computer program stored in the memory 12 and running on the processor 13, such as Data generation program based on HBASE library.
- the schematic diagram is only an example of the electronic device 1 and does not constitute a limitation on the electronic device 1. It may include more or less components than those shown in the figure, or a combination of certain components, or different components. Components, for example, the electronic device 1 may also include an input/output device, a network access device, a bus, and the like.
- the processor 13 may be a central processing unit (Central Processing Unit, CPU), or other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc.
- the general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.
- the processor 13 is the computing core and control center of the electronic device 1 and connects the entire electronic device with various interfaces and lines. Each part of 1, and executes the operating system of the electronic device 1, and various installed applications, program codes, etc.
- the processor 13 executes the operating system of the electronic device 1 and various installed applications.
- the processor 13 executes the application program to implement the steps in the foregoing data generation method embodiments, such as steps S10, S11, S12, S13, S14, S15, S16, S17, S18, S19, and S19 shown in FIG. S20.
- the function of each module/unit in the foregoing device embodiments is implemented, for example: when a data generation instruction is received, the trigger interface of the data generation instruction is acquired; text recognition is adopted Technology recognizes all the text on the trigger interface; extracts at least one keyword from all the text to obtain the attribute data of the data to be generated; encapsulates the attribute data with JSON technology to obtain the target string; uses JSON technology to parse the data
- the target character string is used to obtain the target parameter;
- the shallow semantic analysis method is used to parse the target parameter to obtain the target type of the target parameter;
- the row key generation strategy corresponding to the target type is retrieved from the HBASE library; based on The row key generation strategy generates the target row key of the target parameter in the HBASE library; obtains the target column name from the target parameter; generates an intermediate data file according to the target column name and the target row key ;
- Use a calculation engine to write the intermediate data file into the HBASE library to obtain the data to be generated.
- the computer program may be divided into one or more modules/units, and the one or more modules/units are stored in the memory 12 and executed by the processor 13 to complete the present invention.
- the one or more modules/units may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program in the electronic device 1.
- the computer program can be divided into an acquisition unit 110, an identification unit 111, an extraction unit 112, an encapsulation unit 113, an analysis unit 114, an retrieval unit 115, a generation unit 116, a writing unit 117, a sending unit 118, and an encryption unit. 119, a display unit 120, a transmission unit 121, and a storage unit 122.
- the memory 12 may be used to store the computer program and/or module.
- the processor 13 runs or executes the computer program and/or module stored in the memory 12 and calls data stored in the memory 12, The various functions of the electronic device 1 are realized.
- the memory 12 may mainly include a storage program area and a storage data area.
- the storage program area may store an operating system, an application program required by at least one function (such as a sound playback function, an image playback function, etc.), etc.; the storage data area may Stores data, etc. created based on the use of electronic devices.
- the memory 12 may include a high-speed random access memory, and may also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), and a Secure Digital (SD) Card, Flash Card, at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device.
- a non-volatile memory such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), and a Secure Digital (SD) Card, Flash Card, at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device.
- the memory 12 may be an external memory and/or an internal memory of the electronic device 1. Further, the memory 12 may be a circuit with a storage function without a physical form in an integrated circuit, such as RAM (Random-Access Memory, random access memory), FIFO (First In First Out), and so on. Alternatively, the memory 12 may also be a memory in a physical form, such as a memory stick, a TF card (Trans-flash Card), and so on.
- the integrated module/unit of the electronic device 1 may be stored in a computer-readable storage medium, which may be non-volatile. , It can also be volatile.
- this application implements all or part of the processes in the above-mentioned embodiments and methods, and can also be completed by instructing relevant hardware through a computer program.
- the computer program can be stored in a computer-readable storage medium. When the program is executed by the processor, it can implement the steps of the foregoing method embodiments.
- the computer program includes computer program code
- the computer program code may be in the form of source code, object code, executable file, or some intermediate forms.
- the computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory) , Random Access Memory (RAM, Random Access Memory), electrical carrier signal, telecommunications signal, and software distribution media, etc.
- ROM Read-Only Memory
- RAM Random Access Memory
- electrical carrier signal telecommunications signal
- software distribution media etc.
- the content contained in the computer-readable medium can be appropriately added or deleted according to the requirements of the legislation and patent practice in the jurisdiction.
- the computer-readable medium Does not include electrical carrier signals and telecommunication signals.
- the memory 12 in the electronic device 1 stores multiple instructions to implement a data generation method
- the processor 13 can execute the multiple instructions to implement: when a data generation instruction is received, Acquire the trigger interface of the data generation instruction; use text recognition technology to identify all the text on the trigger interface; extract at least one keyword from all the text to obtain the attribute data of the data to be generated; use JSON technology to encapsulate the Attribute data to obtain the target string; use JSON technology to parse the target string to obtain target parameters; use shallow semantic analysis methods to parse the target parameters to obtain the target type of the target parameters; retrieve from the HBASE library The row key generation strategy corresponding to the target type; generate the target row key of the target parameter in the HBASE library based on the row key generation strategy; obtain the target column name from the target parameter; according to the target The column name and the target row key are used to generate an intermediate data file; the calculation engine is used to write the intermediate data file into the HBASE library to obtain the data to be generated.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Software Systems (AREA)
- Computational Linguistics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Machine Translation (AREA)
Abstract
Description
Claims (20)
- 一种数据生成方法,其中,所述方法包括:当接收到数据生成指令时,获取所述数据生成指令的触发界面;采用文字识别技术识别所述触发界面上的所有文字;从所述所有文字中提取至少一个关键词,得到待生成数据的属性数据;采用JSON技术封装所述属性数据,得到目标字符串;采用JSON技术解析所述目标字符串,得到目标参数;采用浅层式语义分析方法解析所述目标参数,得到所述目标参数的目标类型;从HBASE库中调取与所述目标类型对应的行键生成策略;基于所述行键生成策略生成所述目标参数在所述HBASE库中的目标行键;从所述目标参数中获取目标列名;根据所述目标列名及所述目标行键,生成中间数据文件;采用计算引擎将所述中间数据文件写入所述HBASE库中,得到所述待生成数据。
- 如权利要求1所述的数据生成方法,其中,所述采用JSON技术封装所述属性数据,得到目标字符串包括:从所述HBASE库中调取所述属性数据中每个属性数据对应的目标标签;采用JSON技术封装每个属性数据及每个属性数据对应的目标标签,得到所述目标字符串。
- 如权利要求1所述的数据生成方法,其中,所述采用JSON技术解析所述目标字符串,得到目标参数包括:获取所述目标字符串中的所有目标标签;提取所述所有目标标签中每个目标标签对应的数据,作为所述目标参数。
- 如权利要求1所述的数据生成方法,其中,所述根据所述目标列名及所述目标行键,生成中间数据文件包括:从所述HBASE库中调取出与所述目标列名对应的目标数据;根据所述目标列名及所述目标行键,确定目标位置;将所述目标数据写入所述目标位置,得到所述中间数据文件。
- 如权利要求1所述的数据生成方法,其中,所述采用计算引擎将所述中间数据文件写入所述HBASE库中,得到所述待生成数据包括:根据所述中间数据文件的文件大小,将所述中间数据文件划分为至少一个数据块;计算所述至少一个数据块的个数,得到目标个数;在所述HBASE库中创建HBASE表;以所述目标个数为分区个数对所述HBASE表进行分区;采用计算引擎将所述至少一个数据块写入分区后的HBASE表中,得到所述待生成数据。
- 如权利要求1所述的数据生成方法,其中,在得到待生成数据后,所述方法还包括:获取所述待生成数据的表名及生成时间;根据所述表名及所述生成时间,生成提示信息;发送所述提示信息至指定联系人的终端设备。
- 如权利要求1所述的数据生成方法,其中,在得到待生成数据后,所述方法还包括:采用对称加密技术对所述待生成数据进行加密,得到密文;当检测到所述密文解密成功时,显示所述待生成数据。
- 一种数据生成装置,其中,所述装置包括:获取单元,用于当接收到数据生成指令时,获取所述数据生成指令的触发界面;识别单元,用于采用文字识别技术识别所述触发界面上的所有文字;提取单元,用于从所述所有文字中提取至少一个关键词,得到待生成数据的属性数据;封装单元,用于采用JSON技术封装所述属性数据,得到目标字符串;解析单元,用于采用JSON技术解析所述目标字符串,得到目标参数;所述解析单元,还用于采用浅层式语义分析方法解析所述目标参数,得到所述目标参数的目标类型;调取单元,用于从HBASE库中调取与所述目标类型对应的行键生成策略;生成单元,用于基于所述行键生成策略生成所述目标参数在所述HBASE库中的目标行键;所述获取单元,还用于从所述目标参数中获取目标列名;所述生成单元,还用于根据所述目标列名及所述目标行键,生成中间数据文件;写入单元,用于采用计算引擎将所述中间数据文件写入所述HBASE库中,得到所述待生成数据。
- 如权利要求8所述的数据生成装置,其中,所述封装单元还用于从所述HBASE库中调取所述属性数据中每个属性数据对应的目标标签;及采用JSON技术封装每个属性数据及每个属性数据对应的目标标签,得到所述目标字符串。
- 一种电子设备,其中,所述电子设备包括:存储器,存储至少一个指令;及处理器,执行所述存储器中存储的指令以实现数据生成方法:其中,所述数据生成方法包括:当接收到数据生成指令时,获取所述数据生成指令的触发界面;采用文字识别技术识别所述触发界面上的所有文字;从所述所有文字中提取至少一个关键词,得到待生成数据的属性数据;采用JSON技术封装所述属性数据,得到目标字符串;采用JSON技术解析所述目标字符串,得到目标参数;采用浅层式语义分析方法解析所述目标参数,得到所述目标参数的目标类型;从HBASE库中调取与所述目标类型对应的行键生成策略;基于所述行键生成策略生成所述目标参数在所述HBASE库中的目标行键;从所述目标参数中获取目标列名;根据所述目标列名及所述目标行键,生成中间数据文件;采用计算引擎将所述中间数据文件写入所述HBASE库中,得到所述待生成数据。
- 如权利要求10所述的电子设备,其中,所述采用JSON技术封装所述属性数据,得到目标字符串的步骤包括:从所述HBASE库中调取所述属性数据中每个属性数据对应的目标标签;采用JSON技术封装每个属性数据及每个属性数据对应的目标标签,得到所述目标字符串。
- 如权利要求10所述的电子设备,其中,所述采用JSON技术解析所述目标字符串,得到目标参数的步骤包括:获取所述目标字符串中的所有目标标签;提取所述所有目标标签中每个目标标签对应的数据,作为所述目标参数。
- 如权利要求10所述的电子设备,其中,所述根据所述目标列名及所述目标行键,生成中间数据文件的步骤包括:从所述HBASE库中调取出与所述目标列名对应的目标数据;根据所述目标列名及所述目标行键,确定目标位置;将所述目标数据写入所述目标位置,得到所述中间数据文件。
- 如权利要求10所述的电子设备,其中,所述采用计算引擎将所述中间数据文件写入所述HBASE库中,得到所述待生成数据的步骤包括:根据所述中间数据文件的文件大小,将所述中间数据文件划分为至少一个数据块;计算所述至少一个数据块的个数,得到目标个数;在所述HBASE库中创建HBASE表;以所述目标个数为分区个数对所述HBASE表进行分区;采用计算引擎将所述至少一个数据块写入分区后的HBASE表中,得到所述待生成数据。
- 如权利要求10所述的电子设备,其中,在得到待生成数据后,所述方法还包括:获取所述待生成数据的表名及生成时间;根据所述表名及所述生成时间,生成提示信息;发送所述提示信息至指定联系人的终端设备。
- 一种计算机可读存储介质,其中,所述计算机可读存储介质中存储有至少一个指令,所述至少一个指令被电子设备中的处理器执行以实现数据生成方法,其中,所述数据生成方法包括以下步骤:当接收到数据生成指令时,获取所述数据生成指令的触发界面;采用文字识别技术识别所述触发界面上的所有文字;从所述所有文字中提取至少一个关键词,得到待生成数据的属性数据;采用JSON技术封装所述属性数据,得到目标字符串;采用JSON技术解析所述目标字符串,得到目标参数;采用浅层式语义分析方法解析所述目标参数,得到所述目标参数的目标类型;从HBASE库中调取与所述目标类型对应的行键生成策略;基于所述行键生成策略生成所述目标参数在所述HBASE库中的目标行键;从所述目标参数中获取目标列名;根据所述目标列名及所述目标行键,生成中间数据文件;采用计算引擎将所述中间数据文件写入所述HBASE库中,得到所述待生成数据。
- 如权利要求16所述的计算机可读存储介质,其中,所述采用JSON技术封装所述属性数据,得到目标字符串的步骤包括:从所述HBASE库中调取所述属性数据中每个属性数据对应的目标标签;采用JSON技术封装每个属性数据及每个属性数据对应的目标标签,得到所述目标字符串。
- 如权利要求16所述的计算机可读存储介质,其中,所述采用JSON技术解析所述目标字符串,得到目标参数的步骤包括:获取所述目标字符串中的所有目标标签;提取所述所有目标标签中每个目标标签对应的数据,作为所述目标参数。
- 如权利要求16所述的计算机可读存储介质,其中,所述根据所述目标列名及所述目标行键,生成中间数据文件的步骤包括:从所述HBASE库中调取出与所述目标列名对应的目标数据;根据所述目标列名及所述目标行键,确定目标位置;将所述目标数据写入所述目标位置,得到所述中间数据文件。
- 如权利要求16所述的计算机可读存储介质,其中,所述采用计算引擎将所述中间数据文件写入所述HBASE库中,得到所述待生成数据的步骤包括:根据所述中间数据文件的文件大小,将所述中间数据文件划分为至少一 个数据块;计算所述至少一个数据块的个数,得到目标个数;在所述HBASE库中创建HBASE表;以所述目标个数为分区个数对所述HBASE表进行分区;采用计算引擎将所述至少一个数据块写入分区后的HBASE表中,得到所述待生成数据。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201911174761.8 | 2019-11-26 | ||
| CN201911174761.8A CN111159386A (zh) | 2019-11-26 | 2019-11-26 | 一种数据生成方法、装置、电子设备及存储介质 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2021103409A1 true WO2021103409A1 (zh) | 2021-06-03 |
Family
ID=70556136
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2020/086799 Ceased WO2021103409A1 (zh) | 2019-11-26 | 2020-04-24 | 一种数据生成方法、装置、电子设备及存储介质 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN111159386A (zh) |
| WO (1) | WO2021103409A1 (zh) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114676129A (zh) * | 2020-12-25 | 2022-06-28 | 北京国双科技有限公司 | 一种数据库数据存储方法、装置、电子设备及存储介质 |
| CN113268761B (zh) * | 2021-07-20 | 2021-09-24 | 北京国电通网络技术有限公司 | 信息加密方法、装置、电子设备和计算机可读介质 |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103001824A (zh) * | 2012-11-14 | 2013-03-27 | 北京奇虎科技有限公司 | 一种监控多台服务器的监控系统及监控方法 |
| CN104239313A (zh) * | 2013-06-09 | 2014-12-24 | 百度在线网络技术(北京)有限公司 | 基于移动终端的屏幕中显示文字的搜索方法与移动终端 |
| CN107977448A (zh) * | 2017-12-12 | 2018-05-01 | 北京小米移动软件有限公司 | 加载多数据源数据的方法和装置 |
Family Cites Families (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8819770B2 (en) * | 2012-10-04 | 2014-08-26 | Microsoft Corporation | Data mapping using trust services |
| CN104778182B (zh) * | 2014-01-14 | 2018-03-02 | 博雅网络游戏开发(深圳)有限公司 | 基于HBase的数据导入方法和系统 |
| US10467130B2 (en) * | 2017-01-20 | 2019-11-05 | Wipro Limited | Method of generating and transforming test data and a system therefor |
| CN109815122A (zh) * | 2018-12-15 | 2019-05-28 | 深圳壹账通智能科技有限公司 | 测试数据生成方法、装置、电子设备及存储介质 |
| CN109766388B (zh) * | 2018-12-28 | 2021-02-09 | 广州市申迪计算机系统有限公司 | 一种将数据存入HBase的方法和系统 |
| CN110221967A (zh) * | 2019-05-20 | 2019-09-10 | 深圳壹账通智能科技有限公司 | 测试数据构造方法、装置、计算机设备和存储介质 |
| CN110324143B (zh) * | 2019-05-24 | 2022-03-11 | 平安科技(深圳)有限公司 | 数据传输方法、电子设备及存储介质 |
| CN110347722A (zh) * | 2019-07-11 | 2019-10-18 | 软通智慧科技有限公司 | 基于HBase的数据获取方法、装置、设备及存储介质 |
-
2019
- 2019-11-26 CN CN201911174761.8A patent/CN111159386A/zh active Pending
-
2020
- 2020-04-24 WO PCT/CN2020/086799 patent/WO2021103409A1/zh not_active Ceased
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103001824A (zh) * | 2012-11-14 | 2013-03-27 | 北京奇虎科技有限公司 | 一种监控多台服务器的监控系统及监控方法 |
| CN104239313A (zh) * | 2013-06-09 | 2014-12-24 | 百度在线网络技术(北京)有限公司 | 基于移动终端的屏幕中显示文字的搜索方法与移动终端 |
| CN107977448A (zh) * | 2017-12-12 | 2018-05-01 | 北京小米移动软件有限公司 | 加载多数据源数据的方法和装置 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN111159386A (zh) | 2020-05-15 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN113836235B (zh) | 基于数据中台的数据处理方法及其相关设备 | |
| WO2021218143A1 (zh) | 数据同步方法、装置、服务器及存储介质 | |
| WO2021151270A1 (zh) | 图像结构化数据提取方法、装置、设备及存储介质 | |
| CN112015900A (zh) | 医学属性知识图谱构建方法、装置、设备及介质 | |
| CN111158795A (zh) | 报表生成方法、装置、介质及电子设备 | |
| CN111414122B (zh) | 一种智能文本处理方法、装置、电子设备及存储介质 | |
| CN107729319A (zh) | 用于输出信息的方法和装置 | |
| CN108304378A (zh) | 文本相似度计算方法、装置、计算机设备和存储介质 | |
| US11790174B2 (en) | Entity recognition method and apparatus | |
| CN112434062A (zh) | 准实时数据处理方法、装置、服务器及存储介质 | |
| CN113051231A (zh) | 文件解析方法、装置、计算机设备和存储介质 | |
| CN119646016A (zh) | 数据查询方法、装置、电子设备、介质及程序产品 | |
| WO2021189766A1 (zh) | 数据可视化方法及相关设备 | |
| WO2021103409A1 (zh) | 一种数据生成方法、装置、电子设备及存储介质 | |
| US20210109960A1 (en) | Electronic apparatus and controlling method thereof | |
| CN116360769A (zh) | 代码生成方法、装置、设备及存储介质 | |
| CN116303428A (zh) | 一种数据处理方法和装置 | |
| CN119226380B (zh) | 基于大语言模型快速筛选的数据库代码提取方法及系统 | |
| CN111933241B (zh) | 医疗数据解析方法、装置、电子设备及存储介质 | |
| CN119669180A (zh) | 数据处理方法、装置、计算机设备及存储介质 | |
| US12050634B2 (en) | Method and apparatus for distributing content across platforms, device and storage medium | |
| CN114329164B (zh) | 用于处理数据的方法、装置、设备、介质和产品 | |
| CN114171149B (zh) | 电子病历的处理方法、装置、存储介质及电子设备 | |
| CN117952126A (zh) | 术语领域贡献度确定方法、装置、存储介质及电子设备 | |
| CN116450724A (zh) | 数据处理方法、装置、计算机设备及存储介质 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 20893890 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 20893890 Country of ref document: EP Kind code of ref document: A1 |
|
| 32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 230922) |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 20893890 Country of ref document: EP Kind code of ref document: A1 |