WO2021103409A1 - 一种数据生成方法、装置、电子设备及存储介质 - Google Patents

一种数据生成方法、装置、电子设备及存储介质 Download PDF

Info

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
Application number
PCT/CN2020/086799
Other languages
English (en)
French (fr)
Inventor
吴名先
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
OneConnect Smart Technology Co Ltd
Original Assignee
OneConnect Smart Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by OneConnect Smart Technology Co Ltd filed Critical OneConnect Smart Technology Co Ltd
Publication of WO2021103409A1 publication Critical patent/WO2021103409A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/335Filtering based on additional data, e.g. user or group profiles
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/35Clustering; Classification
    • G06F16/355Creation or modification of classes or clusters
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • G06F8/427Parsing

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

本申请提供一种数据生成方法、装置、电子设备及存储介质。所述数据生成方法能够当接收到数据生成指令时,获取所述数据生成指令的触发界面,识别所述触发界面上的所有文字,并提取待生成数据的属性数据,封装所述属性数据,得到目标字符串,解析所述目标字符串,得到目标参数,进一步地,解析所述目标参数,得到目标类型,从HBASE库中调取与所述目标类型对应的行键生成策略,进而生成所述目标参数在所述HBASE库中的目标行键,从所述目标参数中获取目标列名,根据所述目标列名及所述目标行键,生成中间数据文件,将所述中间数据文件写入所述HBASE库中,得到所述待生成数据,能够基于HBASE库进行数据处理,生成大量的数据,还能够提高数据的生成效率。

Description

一种数据生成方法、装置、电子设备及存储介质
本申请要求于2019年11月26日提交中国专利局、申请号为201911174761.8,发明名称为“一种数据生成方法、装置、电子设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及人工智能中的数据处理技术领域,尤其涉及一种数据生成方法、装置、电子设备及存储介质。
背景技术
在大数据的测试项目中,往往需要大量的测试数据,然而,发明人意识到,在现有的技术方案中,基于传统的数据库生成的数据量不足以支撑大数据的测试项目,同时,由于传统的数据库底层运行了大量的算法,导致数据生成的效率较低。因此,如何高效生成海量数据成了亟待解决的问题。
发明内容
鉴于以上内容,有必要提供一种数据生成方法、装置、电子设备及存储介质,能够基于HBASE库生成大量的数据,还能够提高数据的生成效率。
一种数据生成方法,所述方法包括:
当接收到数据生成指令时,获取所述数据生成指令的触发界面;
采用文字识别技术识别所述触发界面上的所有文字;
从所述所有文字中提取至少一个关键词,得到待生成数据的属性数据;
采用JSON技术封装所述属性数据,得到目标字符串;
采用JSON技术解析所述目标字符串,得到目标参数;
采用浅层式语义分析方法解析所述目标参数,得到所述目标参数的目标类型;
从HBASE库中调取与所述目标类型对应的行键生成策略;
基于所述行键生成策略生成所述目标参数在所述HBASE库中的目标行键;
从所述目标参数中获取目标列名;
根据所述目标列名及所述目标行键,生成中间数据文件;
采用计算引擎将所述中间数据文件写入所述HBASE库中,得到所述待生成数据。
本申请提供一种数据生成装置,所述装置包括:
获取单元,用于当接收到数据生成指令时,获取所述数据生成指令的触发界面;
识别单元,用于采用文字识别技术识别所述触发界面上的所有文字;
提取单元,用于从所述所有文字中提取至少一个关键词,得到待生成数据的属性数据;
封装单元,用于采用JSON技术封装所述属性数据,得到目标字符串;
解析单元,用于采用JSON技术解析所述目标字符串,得到目标参数;
所述解析单元,还用于采用浅层式语义分析方法解析所述目标参数,得到所述目标参数的目标类型;
调取单元,用于从HBASE库中调取与所述目标类型对应的行键生成策略;
生成单元,用于基于所述行键生成策略生成所述目标参数在所述HBASE库中的目标行键;
所述获取单元,还用于从所述目标参数中获取目标列名;
所述生成单元,还用于根据所述目标列名及所述目标行键,生成中间数据文件;
写入单元,用于采用计算引擎将所述中间数据文件写入所述HBASE库中,得到所述待生成数据。
本申请提供一种电子设备,所述电子设备包括:
存储器,存储至少一个指令;及
处理器,执行所述存储器中存储的指令以实现所述数据生成方法。
一种计算机可读存储介质,所述计算机可读存储介质中存储有至少一个指令,所述至少一个指令被电子设备中的处理器执行以实现所述数据生成方法。
由以上技术方案可以看出,本申请能够当接收到数据生成指令时,获取所述数据生成指令的触发界面,采用文字识别技术识别所述触发界面上的所有文字,从所述所有文字中提取至少一个关键词,得到待生成数据的属性数据,采用JSON技术封装所述属性数据,得到目标字符串,采用JSON技术解析所述目标字符串,得到目标参数,采用浅层式语义分析方法解析所述目标参数,得到所述目标参数的目标类型,从HBASE库中调取与所述目标类型对应的行键生成策略,基于所述行键生成策略生成所述目标参数在所述HBASE库中的目标行键,从所述目标参数中获取目标列名,根据所述目标列名及所述目标行键,生成中间数据文件,采用计算引擎将所述中间数据文件写入所述HBASE库中,得到所述待生成数据,不仅能够基于HBASE库生成大量的数据,还能够提高数据的生成效率。
附图说明
图1是本申请数据生成方法的较佳实施例的流程图。
图2是本申请数据生成装置的较佳实施例的功能模块图。
图3是本申请实现数据生成方法的较佳实施例的电子设备的结构示意图。
具体实施方式
如图1所示,是本申请数据生成方法的较佳实施例的流程图。根据不同的需求,该流程图中步骤的顺序可以改变,某些步骤可以省略。
所述数据生成方法应用于一个或者多个电子设备中,所述电子设备是一种能够按照事先设定或存储的指令,自动进行数值计算和/或信息处理的设备,其硬件包括但不限于微处理器、专用集成电路(Application Specific Integrated Circuit,ASIC)、可编程门阵列(Field-Programmable Gate Array,FPGA)、数字处理器(Digital Signal Processor,DSP)、嵌入式设备等。
所述电子设备可以是任何一种可与用户进行人机交互的电子产品,例如,个人计算机、平板电脑、智能手机、个人数字助理(Personal Digital Assistant,PDA)、游戏机、交互式网络电视(Internet Protocol Television,IPTV)、智能式穿戴式设备等。
所述电子设备还可以包括网络设备和/或用户设备。其中,所述网络设备包括,但不限于单个网络服务器、多个网络服务器组成的服务器组或基于云计算(Cloud Computing)的由大量主机或网络服务器构成的云。
所述电子设备所处的网络包括但不限于互联网、广域网、城域网、局域网、虚拟专用网络(Virtual Private Network,VPN)等。
S10,当接收到数据生成指令时,获取所述数据生成指令的触发界面。
在本申请的至少一个实施例中,所述数据生成指令可以由用户触发,也可以在满足一定条件时自动触发,本申请不限制。
其中,所述满足一定条件包括,但不限于:满足预设时间等。
所述预设时间可以包括确定的时间点,或者包括一个时间段等,例如:所述预设时间可以是每天早上七点。
在本申请的至少一个实施例中,所述触发界面是由输入文本框及提交按钮组成的,主要用于搜集信息。根据用户需求,所述输入文本框可以有多种形式,其中,所述输入文本框中的内容可以包括,但不限于:文本字段、字符等。
S11,采用文字识别技术识别所述触发界面上的所有文字。
在本申请的至少一个实施例中,所述所有文字包括,但不限于:中文、字符、数字等。
在本申请的至少一个实施例中,所述电子设备采用文字识别技术识别所述触发界面,得到触发界面上的所有文字。
其中,所述触发界面包括输入文本框及提交按钮。
S12,从所述所有文字中提取至少一个关键词,得到待生成数据的属性数据。
在本申请的至少一个实施例中,所述属性数据可以包括,但不限于:行数、表名、列名、文件名等。
在本申请的至少一个实施例中,所述电子设备从所述所有文字中提取至少一个关键词,得到待生成数据的属性数据包括:
所述电子设备采用基于高维聚类技术的中文关键词提取算法从所述所有文字中提取至少一个关键词,得到待生成数据的属性数据。
具体地,所述电子设备依据预先配置的目标词典对所述所有文字进行快速分词得到第一分词,计算所述第一分词的目标词频,将所述目标词频大于预设词频的第一分词确定为初始关键词,所述电子设备根据预设小词典,对所述初始关键词进行修剪,得到最终关键词,将所述最终关键词确定为待生成数据的属性数据。
其中,所述目标词典可以包括常见的关键词。
进一步地,所述小词典可以包括,但不限于虚词、停用词等。
通过对所述初始关键词进行修剪,进而准确、快速地确定出所述待生成数据的所述属性数据。
S13,采用JSON(JavaScript Object Notation,JS对象简谱)技术封装所述属性数据,得到目标字符串。
在本申请的至少一个实施例中,所述目标字符串是由所述属性数据封装而来的,其表现形式为{标签:属性数据}。
在本申请的至少一个实施例中,所述电子设备采用JSON技术封装所述属性数据,得到目标字符串包括:
所述电子设备从所述HBASE库中调取所述属性数据中每个属性数据对应的目标标签,进一步地,所述电子设备采用JSON技术封装每个属性数据及每个属性数据对应的目标标签,得到所述目标字符串。
其中,所述JSON技术是一种轻量级的数据交换格式。所述JSON技术采用完全独立于编程语言的文本格式来存储和表示数据,易于阅读和编写,同时也易于机器解析和生成,并有效地提升网络传输效率。
进一步地,所述HBASE库是一个分布式的、面向列的开源数据库。
例如:属性数据1为姓名,属性数据2为性别,所述电子设备从HBASE库中调取到姓名对应的目标标签为A,调取到性别对应的目标标签为B,将姓名与A进行封装,得到所述属性数据1的目标字符串为{A:姓名},将性别与B进行封装,得到所述属性数据2的目标字符串为{B:性别}
通过上述实施方式,将所述属性数据封装为所述目标字符串,使所述属性数据能够随着所述目标字符串传入到后端服务器进行数据处理。
S14,采用JSON技术解析所述目标字符串,得到目标参数。
在本申请的至少一个实施例中,所述目标参数包括,但不限于:表名、行数、列名、文件名等。
在本申请的至少一个实施例中,在采用JSON技术解析所述目标字符串, 得到目标参数之前,所述方法还包括:
所述电子设备采用ajax(Asynchronous Javascript And XML)技术将所述目标字符串传输至所述电子设备的后端服务器。
其中,所述ajax技术是一种用于创建更好更快以及交互性更强的Web应用程序的技术。
具体地,所述电子设备将所述目标字符串添加到post请求中,并采用ajax技术传输所述post请求至后端服务器中。
通过上述实施方式,采用ajax技术接收来自所述电子设备前端页面的所述目标字符串,能够在不重载前端页面的情况下,与后端服务器交换数据,进而提高效率。
在本申请的至少一个实施例中,所述采用JSON技术解析所述目标字符串,得到目标参数包括:
所述电子设备获取所述目标字符串中的所有目标标签,进一步地,所述电子设备提取所述所有目标标签中每个目标标签对应的数据,作为所述目标参数。
例如:所述属性数据1的目标字符串为{A:姓名},所述属性数据2的目标字符串为{B:性别},所述电子设备获取到所述属性数据1的目标标签A、所述属性数据2的目标标签B,根据所述目标标签A,提取出所述目标字符串{A:姓名}中的姓名,作为目标参数,根据所述目标标签B,提取出所述目标字符串{B:性别}中的性别,作为目标参数。
通过上述实施方式,采用JSON技术能够快速、准确地将所述目标字符串反序列化为所述后端需要的目标参数。
S15,采用浅层式语义分析方法解析所述目标参数,得到所述目标参数的目标类型。
在本申请的至少一个实施例中,所述电子设备采用浅层式语义分析方法,解析所述目标参数之间的语义关系,得到所述目标参数的应用场景,进一步地,所述电子设备根据所述应用场景确定所述目标参数的目标类型。
其中,所述目标类型可以包括,但不限于:事务数据类型、统计数据类型、通用数据类型等。
S16,从HBASE库中调取与所述目标类型对应的行键生成策略。
在本申请的至少一个实施例中,所述行键生成策略包括,但不限于以下一种或者多种的组合:
(1)当所述目标类型为事务数据类型时,所述行键生成策略为按时间戳的方式递加。
(2)当所述目标类型为通用数据类型时,所述行键生成策略为按序列进行自增。
S17,基于所述行键生成策略生成所述目标参数在所述HBASE库中的目标行键。
在本申请的至少一个实施例中,所述电子设备从所述目标参数中获取行数,进一步地,所述电子设备将所述行键生成策略导入所述HBASE库中,根据所述行数及所述行键生成策略,生成所述目标行键。
其中,所述目标行键的个数等于所述行数。
通过上述实施方式,在无需人为操作下,能够快速地生成所述目标行键。
S18,从所述目标参数中获取目标列名。
在本申请的至少一个实施例中,所述目标列名指每列数据的名称,所述目标列名存储于经JSON技术解析得到的所述目标参数中,进一步地,所述目标列名可以包括,但不限于:姓名、性别、身份证号码、出生日期等。
在本申请的至少一个实施例中,所述从所述目标参数中获取目标列名包括:
所述电子设备将所述目标参数与所述HBASE库中存储的列名进行匹配,进一步地,所述电子设备将与所述列名匹配的目标参数确认为所述目标列名。
通过上述实施方式,能够获取到所述目标列名,便于后续根据所述目标列名生成中间数据文件。
S19,根据所述目标列名及所述目标行键,生成中间数据文件。
在本申请的至少一个实施例中,所述中间数据文件是在所述HBASE库中生成的语句集合,通过所述中间数据文件能够生成具有固定格式的至少一个数据。
在本申请的至少一个实施例中,所述根据所述目标列名及所述目标行键,生成中间数据文件包括:
所述电子设备从所述HBASE库中调取出与所述目标列名对应的目标数据,根据所述目标列名及所述目标行键,确定目标位置,将所述目标数据写入所述目标位置,得到中间数据文件。
其中,所述将所述目标数据写入所述目标位置,得到中间数据文件具体包括:
所述电子设备通过语句put<table>,<rowkey>,<family:column>,<value>将所述目标数据写入所述目标位置,重复上述步骤,直至所述目标位置均被写入所述目标数据,将上述执行的所有语句集合,生成所述中间数据文件。
所述HBASE库中存储的数据量很大,但是数据杂乱,通过本实施方式,能够根据用户需求从所述HBASE库中调取出与所述目标列名对应的目标数据,并生成所述中间数据文件,鉴于此,由于数据是对应目标位置写入的,因此,通过所述中间数据文件生成的数据都将具有固定格式。
在本申请的至少一个实施例中,在生成中间数据文件之后,所述方法还包括:
所述电子设备将所述中间数据文件发送到中间数据层,并利用所述中间数据层保存所述中间数据文件。
其中,所述中间数据层是linux系统专用于存放中间文件的目录。
通过上述实施方式,对所述中间数据文件进行保存,能够避免在待生成数据生成的过程中出现错误而丢失所述中间数据文件,进而影响数据生成效率。
S20,采用计算引擎将所述中间数据文件写入所述HBASE库中,得到所述待生成数据。
在本申请的至少一个实施例中,所述待生成数据是一组具有固定格式的,且基于所述HBASE库生成的数据。
在本申请的至少一个实施例中,所述采用计算引擎将所述中间数据文件写入所述HBASE库中,得到所述待生成数据包括:
根据所述中间数据文件的文件大小,所述电子设备将所述中间数据文件划分为至少一个数据块,计算所述至少一个数据块的个数,得到目标个数,进一步地,所述电子设备在所述HBASE库中创建HBASE表,以所述目标个数为分区个数对所述HBASE表进行分区,采用计算引擎将所述至少一个数据块写入分区后的HBASE表中,得到所述待生成数据。
通过上述实施方式,由于采用了计算引擎,因此能够快速将所述中间数据文件写入HBASE库,提高了数据生成速率。
在本申请的至少一个实施例中,在得到待生成数据后,所述方法还包括:
所述电子设备获取所述待生成数据的表名及生成时间,根据所述表名及所述生成时间,所述电子设备生成提示信息,进一步地,所述电子设备发送所述提示信息至指定联系人的终端设备。
其中,所述提示信息可以包括,但不限于:待生成数据的表名、待生成数据的行数、待生成数据的生成时间等。
进一步地,所述指定联系人可以是所述数据生成指令的触发者。
通过上述实施方式,能够在所述待生成数据生成后,提醒所述指定联系人进行数据的查收。
在本申请的至少一个实施例中,在得到待生成数据后,所述方法还包括:
所述电子设备采用对称加密技术对所述待生成数据进行加密,得到密文,当检测到所述密文解密成功时,显示所述待生成数据。
通过上述实施方式,能够避免所述待生成数据被篡改,提高数据的安全性。
由以上技术方案可以看出,本申请能够当接收到数据生成指令时,获取所述数据生成指令的触发界面,采用文字识别技术识别所述触发界面上的所有文字,从所述所有文字中提取至少一个关键词,得到待生成数据的属性数据,采用JSON技术封装所述属性数据,得到目标字符串,采用JSON技术解析所述目标字符串,得到目标参数,采用浅层式语义分析方法解析所述目标参数,得到所述目标参数的目标类型,从HBASE库中调取与所述目标类型对应的行键生成策略,基于所述行键生成策略生成所述目标参数在所述HBASE库中的目标行键,从所述目标参数中获取目标列名,根据所述目标列 名及所述目标行键,生成中间数据文件,采用计算引擎将所述中间数据文件写入所述HBASE库中,得到所述待生成数据,不仅能够基于HBASE库生成大量的数据,还能够提高数据的生成效率。
如图2所示,是本申请数据生成装置的较佳实施例的功能模块图。所述数据生成装置11包括获取单元110、识别单元111、提取单元112、封装单元113、解析单元114、调取单元115、生成单元116、写入单元117、发送单元118、加密单元119、显示单元120、传输单元121以及保存单元122。本申请所称的模块/单元是指一种能够被处理器13所执行,并且能够完成固定功能的一系列计算机程序段,其存储在存储器12中。在本实施例中,关于各模块/单元的功能将在后续的实施例中详述。
当接收到数据生成指令时,获取单元110获取所述数据生成指令的触发界面。
在本申请的至少一个实施例中,所述数据生成指令可以由用户触发,也可以在满足一定条件时自动触发,本申请不限制。
其中,所述满足一定条件包括,但不限于:满足预设时间等。
所述预设时间可以包括确定的时间点,或者包括一个时间段等,例如:所述预设时间可以是每天早上七点。
在本申请的至少一个实施例中,所述触发界面是由输入文本框及提交按钮组成的,主要用于搜集信息。根据用户需求,所述输入文本框可以有多种形式,其中,所述输入文本框中的内容可以包括,但不限于:文本字段、字符等。
识别单元111采用文字识别技术识别所述触发界面上的所有文字。
在本申请的至少一个实施例中,所述所有文字包括,但不限于:中文、字符、数字等。
在本申请的至少一个实施例中,所述识别单元111采用文字识别技术识别所述触发界面,得到触发界面上的所有文字。
其中,所述触发界面包括输入文本框及提交按钮。
提取单元112从所述所有文字中提取至少一个关键词,得到待生成数据的属性数据。
在本申请的至少一个实施例中,所述属性数据可以包括,但不限于:行数、表名、列名、文件名等。
在本申请的至少一个实施例中,所述提取单元112从所述所有文字中提取至少一个关键词,得到待生成数据的属性数据包括:
所述提取单元112采用基于高维聚类技术的中文关键词提取算法从所述所有文字中提取至少一个关键词,得到待生成数据的属性数据。
具体地,所述提取单元112依据预先配置的目标词典对所述所有文字进行快速分词得到第一分词,计算所述第一分词的目标词频,将所述目标词频大于预设词频的第一分词确定为初始关键词,所述提取单元112根据预设小 词典,对所述初始关键词进行修剪,得到最终关键词,将所述最终关键词确定为待生成数据的属性数据。
其中,所述目标词典可以包括常见的关键词。
进一步地,所述小词典可以包括,但不限于虚词、停用词等。
通过对所述初始关键词进行修剪,进而准确、快速地确定出所述待生成数据的所述属性数据。
封装单元113采用JSON(JavaScript Object Notation,JS对象简谱)技术封装所述属性数据,得到目标字符串。
在本申请的至少一个实施例中,所述目标字符串是由所述属性数据封装而来的,其表现形式为{标签:属性数据}。
在本申请的至少一个实施例中,所述封装单元113采用JSON技术封装所述属性数据,得到目标字符串包括:
所述封装单元113从所述HBASE库中调取所述属性数据中每个属性数据对应的目标标签,进一步地,所述封装单元113采用JSON技术封装每个属性数据及每个属性数据对应的目标标签,得到所述目标字符串。
其中,所述JSON技术是一种轻量级的数据交换格式。所述JSON技术采用完全独立于编程语言的文本格式来存储和表示数据,易于阅读和编写,同时也易于机器解析和生成,并有效地提升网络传输效率。
进一步地,所述HBASE库是一个分布式的、面向列的开源数据库。
例如:属性数据1为姓名,属性数据2为性别,所述封装单元113从HBASE库中调取到姓名对应的目标标签为A,调取到性别对应的目标标签为B,将姓名与A进行封装,得到所述属性数据1的目标字符串为{A:姓名},将性别与B进行封装,得到所述属性数据2的目标字符串为{B:性别}
通过上述实施方式,将所述属性数据封装为所述目标字符串,使所述属性数据能够随着所述目标字符串传入到后端服务器进行数据处理。
解析单元114采用JSON技术解析所述目标字符串,得到目标参数。
在本申请的至少一个实施例中,所述目标参数包括,但不限于:表名、行数、列名、文件名等。
在本申请的至少一个实施例中,在采用JSON技术解析所述目标字符串,得到目标参数之前,所述方法还包括:
传输单元121采用ajax(Asynchronous Javascript And XML)技术将所述目标字符串传输至所述电子设备的后端服务器。
其中,所述ajax技术是一种用于创建更好更快以及交互性更强的Web应用程序的技术。
具体地,所述传输单元121将所述目标字符串添加到post请求中,并采用ajax技术传输所述post请求至后端服务器中。
通过上述实施方式,采用ajax技术接收来自电子设备前端页面的所述目标字符串,能够在不重载前端页面的情况下,与后端服务器交换数据,进而 提高效率。
在本申请的至少一个实施例中,所述解析单元114采用JSON技术解析所述目标字符串,得到目标参数包括:
所述解析单元114获取所述目标字符串中的所有目标标签,进一步地,所述解析单元114提取所述所有目标标签中每个目标标签对应的数据,作为所述目标参数。
例如:所述属性数据1的目标字符串为{A:姓名},所述属性数据2的目标字符串为{B:性别},所述解析单元114获取到所述属性数据1的目标标签A、所述属性数据2的目标标签B,根据所述目标标签A,提取出所述目标字符串{A:姓名}中的姓名,作为目标参数,根据所述目标标签B,提取出所述目标字符串{B:性别}中的性别,作为目标参数。
通过上述实施方式,采用JSON技术能够快速、准确地将所述目标字符串反序列化为所述后端需要的目标参数。
所述解析单元114采用浅层式语义分析方法解析所述目标参数,得到所述目标参数的目标类型。
在本申请的至少一个实施例中,所述解析单元114采用浅层式语义分析方法,解析所述目标参数之间的语义关系,得到所述目标参数的应用场景,进一步地,所述解析单元114根据所述应用场景确定所述目标参数的目标类型。
其中,所述目标类型可以包括,但不限于:事务数据类型、统计数据类型、通用数据类型等。
调取单元115从HBASE库中调取与所述目标类型对应的行键生成策略。
在本申请的至少一个实施例中,所述行键生成策略包括,但不限于以下一种或者多种的组合:
(1)当所述目标类型为事务数据类型时,所述行键生成策略为按时间戳的方式递加。
(2)当所述目标类型为通用数据类型时,所述行键生成策略为按序列进行自增。
生成单元116基于所述行键生成策略生成所述目标参数在所述HBASE库中的目标行键。
在本申请的至少一个实施例中,所述生成单元116从所述目标参数中获取行数,进一步地,所述生成单元116将所述行键生成策略导入所述HBASE库中,根据所述行数及所述行键生成策略,生成所述目标行键。
其中,所述目标行键的个数等于所述行数。
通过上述实施方式,在无需人为操作下,能够快速地生成所述目标行键。
所述获取单元110从所述目标参数中获取目标列名。
在本申请的至少一个实施例中,所述目标列名指每列数据的名称,所述目标列名存储于经JSON技术解析得到的所述目标参数中,进一步地,所述 目标列名可以包括,但不限于:姓名、性别、身份证号码、出生日期等。
在本申请的至少一个实施例中,所述获取单元110从所述目标参数中获取目标列名包括:
所述获取单元110将所述目标参数与所述HBASE库中存储的列名进行匹配,进一步地,所述获取单元110将与所述列名匹配的目标参数确认为所述目标列名。
通过上述实施方式,能够获取到所述目标列名,便于后续根据所述目标列名生成中间数据文件。
所述生成单元116根据所述目标列名及所述目标行键,生成中间数据文件。
在本申请的至少一个实施例中,所述中间数据文件是在所述HBASE库中生成的语句集合,通过所述中间数据文件能够生成具有固定格式的至少一个数据。
在本申请的至少一个实施例中,所述生成单元116根据所述目标列名及所述目标行键,生成中间数据文件包括:
所述生成单元116从所述HBASE库中调取出与所述目标列名对应的目标数据,根据所述目标列名及所述目标行键,确定目标位置,将所述目标数据写入所述目标位置,得到中间数据文件。
其中,所述生成单元116将所述目标数据写入所述目标位置,得到中间数据文件具体包括:
所述生成单元116通过语句put<table>,<rowkey>,<family:column>,<value>将所述目标数据写入所述目标位置,重复上述步骤,直至所述目标位置均被写入所述目标数据,将上述执行的所有语句集合,生成所述中间数据文件。
所述HBASE库中存储的数据量很大,但是数据杂乱,通过本实施方式,能够根据用户需求从所述HBASE库中调取出与所述目标列名对应的目标数据,并生成所述中间数据文件,鉴于此,由于数据是对应目标位置写入的,因此,通过所述中间数据文件生成的数据都将具有固定格式。
在本申请的至少一个实施例中,在生成中间数据文件之后,所述方法还包括:
发送单元118将所述中间数据文件发送到中间数据层,进一步地,保存单元122利用所述中间数据层保存所述中间数据文件。
其中,所述中间数据层是linux系统专用于存放中间文件的目录。
通过上述实施方式,对所述中间数据文件进行保存,能够避免在待生成数据生成的过程中出现错误而丢失所述中间数据文件,进而影响数据生成效率。
写入单元117采用计算引擎将所述中间数据文件写入所述HBASE库中,得到所述待生成数据。
在本申请的至少一个实施例中,所述待生成数据是一组具有固定格式的,且基于所述HBASE库生成的数据。
在本申请的至少一个实施例中,所述写入单元117采用计算引擎将所述中间数据文件写入所述HBASE库中,得到所述待生成数据包括:
根据所述中间数据文件的文件大小,所述写入单元117将所述中间数据文件划分为至少一个数据块,计算所述至少一个数据块的个数,得到目标个数,进一步地,所述写入单元117在所述HBASE库中创建HBASE表,以所述目标个数为分区个数对所述HBASE表进行分区,采用计算引擎将所述至少一个数据块写入分区后的HBASE表中,得到所述待生成数据。
通过上述实施方式,由于采用了计算引擎,因此能够快速将所述中间数据文件写入HBASE库,提高了数据生成速率。
在本申请的至少一个实施例中,在得到待生成数据后,所述方法还包括:
所述获取单元110获取所述待生成数据的表名及生成时间,根据所述表名及所述生成时间,所述生成单元116生成提示信息,进一步地,所述发送单元118发送所述提示信息至指定联系人的终端设备。
其中,所述提示信息可以包括,但不限于:待生成数据的表名、待生成数据的行数、待生成数据的生成时间等。
进一步地,所述指定联系人可以是所述数据生成指令的触发者。
通过上述实施方式,能够在所述待生成数据生成后,提醒所述指定联系人进行数据的查收。
在本申请的至少一个实施例中,在得到待生成数据后,所述方法还包括:
加密单元119采用对称加密技术对所述待生成数据进行加密,得到密文,进一步地,当检测到所述密文解密成功时,显示单元120显示所述待生成数据。
通过上述实施方式,能够避免所述待生成数据被篡改,提高数据的安全性。
由以上技术方案可以看出,本申请能够当接收到数据生成指令时,获取所述数据生成指令的触发界面,采用文字识别技术识别所述触发界面上的所有文字,从所述所有文字中提取至少一个关键词,得到待生成数据的属性数据,采用JSON技术封装所述属性数据,得到目标字符串,采用JSON技术解析所述目标字符串,得到目标参数,采用浅层式语义分析方法解析所述目标参数,得到所述目标参数的目标类型,从HBASE库中调取与所述目标类型对应的行键生成策略,基于所述行键生成策略生成所述目标参数在所述HBASE库中的目标行键,从所述目标参数中获取目标列名,根据所述目标列名及所述目标行键,生成中间数据文件,采用计算引擎将所述中间数据文件写入所述HBASE库中,得到所述待生成数据,不仅能够基于HBASE库生成大量的数据,还能够提高数据的生成效率。
如图3所示,是本申请实现数据生成方法的较佳实施例的电子设备的结 构示意图。
在本申请的一个实施例中,所述电子设备1包括,但不限于,存储器12、处理器13,以及存储在所述存储器12中并可在所述处理器13上运行的计算机程序,例如基于HBASE库的数据生成程序。
本领域技术人员可以理解,所述示意图仅仅是电子设备1的示例,并不构成对电子设备1的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如所述电子设备1还可以包括输入输出设备、网络接入设备、总线等。
所述处理器13可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等,所述处理器13是所述电子设备1的运算核心和控制中心,利用各种接口和线路连接整个电子设备1的各个部分,及执行所述电子设备1的操作系统以及安装的各类应用程序、程序代码等。
所述处理器13执行所述电子设备1的操作系统以及安装的各类应用程序。所述处理器13执行所述应用程序以实现上述各个数据生成方法实施例中的步骤,例如图1所示的步骤S10、S11、S12、S13、S14、S15、S16、S17、S18、S19、S20。
或者,所述处理器13执行所述计算机程序时实现上述各装置实施例中各模块/单元的功能,例如:当接收到数据生成指令时,获取所述数据生成指令的触发界面;采用文字识别技术识别所述触发界面上的所有文字;从所述所有文字中提取至少一个关键词,得到待生成数据的属性数据;采用JSON技术封装所述属性数据,得到目标字符串;采用JSON技术解析所述目标字符串,得到目标参数;采用浅层式语义分析方法解析所述目标参数,得到所述目标参数的目标类型;从HBASE库中调取与所述目标类型对应的行键生成策略;基于所述行键生成策略生成所述目标参数在所述HBASE库中的目标行键;从所述目标参数中获取目标列名;根据所述目标列名及所述目标行键,生成中间数据文件;采用计算引擎将所述中间数据文件写入所述HBASE库中,得到所述待生成数据。
示例性的,所述计算机程序可以被分割成一个或多个模块/单元,所述一个或者多个模块/单元被存储在所述存储器12中,并由所述处理器13执行,以完成本申请。所述一个或多个模块/单元可以是能够完成特定功能的一系列计算机程序指令段,该指令段用于描述所述计算机程序在所述电子设备1中的执行过程。例如,所述计算机程序可以被分割成获取单元110、识别单元111、提取单元112、封装单元113、解析单元114、调取单元115、生成单元 116、写入单元117、发送单元118、加密单元119、显示单元120、传输单元121以及保存单元122。
所述存储器12可用于存储所述计算机程序和/或模块,所述处理器13通过运行或执行存储在所述存储器12内的计算机程序和/或模块,以及调用存储在存储器12内的数据,实现所述电子设备1的各种功能。所述存储器12可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据电子设备的使用所创建的数据等。此外,存储器12可以包括高速随机存取存储器,还可以包括非易失性存储器,例如硬盘、内存、插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)、至少一个磁盘存储器件、闪存器件、或其他非易失性固态存储器件。
所述存储器12可以是电子设备1的外部存储器和/或内部存储器。进一步地,所述存储器12可以是集成电路中没有实物形式的具有存储功能的电路,如RAM(Random-Access Memory,随机存取存储器)、FIFO(First In First Out,)等。或者,所述存储器12也可以是具有实物形式的存储器,如内存条、TF卡(Trans-flash Card)等等。
所述电子设备1集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中,计算机可读存储介质可以是非易失性,也可以是易失性。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,也可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。
其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质等。需要说明的是,所述计算机可读介质包含的内容可以根据司法管辖区内立法和专利实践的要求进行适当的增减,例如在某些司法管辖区,根据立法和专利实践,计算机可读介质不包括电载波信号和电信信号。
结合图1,所述电子设备1中的所述存储器12存储多个指令以实现一种数据生成方法,所述处理器13可执行所述多个指令从而实现:当接收到数据生成指令时,获取所述数据生成指令的触发界面;采用文字识别技术识别所述触发界面上的所有文字;从所述所有文字中提取至少一个关键词,得到待生成数据的属性数据;采用JSON技术封装所述属性数据,得到目标字符串;采用JSON技术解析所述目标字符串,得到目标参数;采用浅层式语义分析 方法解析所述目标参数,得到所述目标参数的目标类型;从HBASE库中调取与所述目标类型对应的行键生成策略;基于所述行键生成策略生成所述目标参数在所述HBASE库中的目标行键;从所述目标参数中获取目标列名;根据所述目标列名及所述目标行键,生成中间数据文件;采用计算引擎将所述中间数据文件写入所述HBASE库中,得到所述待生成数据。
具体地,所述处理器13对上述指令的具体实现方法可参考图1对应实施例中相关步骤的描述,在此不赘述。
最后应说明的是,以上实施例仅用以说明本发明的技术方案而非限制,尽管参照较佳实施例对本发明进行了详细说明,本领域的普通技术人员应当理解,可以对本发明的技术方案进行修改或等同替换,而不脱离本发明技术方案的精神和范围。

Claims (20)

  1. 一种数据生成方法,其中,所述方法包括:
    当接收到数据生成指令时,获取所述数据生成指令的触发界面;
    采用文字识别技术识别所述触发界面上的所有文字;
    从所述所有文字中提取至少一个关键词,得到待生成数据的属性数据;
    采用JSON技术封装所述属性数据,得到目标字符串;
    采用JSON技术解析所述目标字符串,得到目标参数;
    采用浅层式语义分析方法解析所述目标参数,得到所述目标参数的目标类型;
    从HBASE库中调取与所述目标类型对应的行键生成策略;
    基于所述行键生成策略生成所述目标参数在所述HBASE库中的目标行键;
    从所述目标参数中获取目标列名;
    根据所述目标列名及所述目标行键,生成中间数据文件;
    采用计算引擎将所述中间数据文件写入所述HBASE库中,得到所述待生成数据。
  2. 如权利要求1所述的数据生成方法,其中,所述采用JSON技术封装所述属性数据,得到目标字符串包括:
    从所述HBASE库中调取所述属性数据中每个属性数据对应的目标标签;
    采用JSON技术封装每个属性数据及每个属性数据对应的目标标签,得到所述目标字符串。
  3. 如权利要求1所述的数据生成方法,其中,所述采用JSON技术解析所述目标字符串,得到目标参数包括:
    获取所述目标字符串中的所有目标标签;
    提取所述所有目标标签中每个目标标签对应的数据,作为所述目标参数。
  4. 如权利要求1所述的数据生成方法,其中,所述根据所述目标列名及所述目标行键,生成中间数据文件包括:
    从所述HBASE库中调取出与所述目标列名对应的目标数据;
    根据所述目标列名及所述目标行键,确定目标位置;
    将所述目标数据写入所述目标位置,得到所述中间数据文件。
  5. 如权利要求1所述的数据生成方法,其中,所述采用计算引擎将所述中间数据文件写入所述HBASE库中,得到所述待生成数据包括:
    根据所述中间数据文件的文件大小,将所述中间数据文件划分为至少一个数据块;
    计算所述至少一个数据块的个数,得到目标个数;
    在所述HBASE库中创建HBASE表;
    以所述目标个数为分区个数对所述HBASE表进行分区;
    采用计算引擎将所述至少一个数据块写入分区后的HBASE表中,得到所述待生成数据。
  6. 如权利要求1所述的数据生成方法,其中,在得到待生成数据后,所述方法还包括:
    获取所述待生成数据的表名及生成时间;
    根据所述表名及所述生成时间,生成提示信息;
    发送所述提示信息至指定联系人的终端设备。
  7. 如权利要求1所述的数据生成方法,其中,在得到待生成数据后,所述方法还包括:
    采用对称加密技术对所述待生成数据进行加密,得到密文;
    当检测到所述密文解密成功时,显示所述待生成数据。
  8. 一种数据生成装置,其中,所述装置包括:
    获取单元,用于当接收到数据生成指令时,获取所述数据生成指令的触发界面;
    识别单元,用于采用文字识别技术识别所述触发界面上的所有文字;
    提取单元,用于从所述所有文字中提取至少一个关键词,得到待生成数据的属性数据;
    封装单元,用于采用JSON技术封装所述属性数据,得到目标字符串;
    解析单元,用于采用JSON技术解析所述目标字符串,得到目标参数;
    所述解析单元,还用于采用浅层式语义分析方法解析所述目标参数,得到所述目标参数的目标类型;
    调取单元,用于从HBASE库中调取与所述目标类型对应的行键生成策略;
    生成单元,用于基于所述行键生成策略生成所述目标参数在所述
    HBASE库中的目标行键;
    所述获取单元,还用于从所述目标参数中获取目标列名;
    所述生成单元,还用于根据所述目标列名及所述目标行键,生成中间数据文件;
    写入单元,用于采用计算引擎将所述中间数据文件写入所述HBASE库中,得到所述待生成数据。
  9. 如权利要求8所述的数据生成装置,其中,所述封装单元还用于从所述HBASE库中调取所述属性数据中每个属性数据对应的目标标签;及采用JSON技术封装每个属性数据及每个属性数据对应的目标标签,得到所述目标字符串。
  10. 一种电子设备,其中,所述电子设备包括:
    存储器,存储至少一个指令;及
    处理器,执行所述存储器中存储的指令以实现数据生成方法:
    其中,所述数据生成方法包括:
    当接收到数据生成指令时,获取所述数据生成指令的触发界面;
    采用文字识别技术识别所述触发界面上的所有文字;
    从所述所有文字中提取至少一个关键词,得到待生成数据的属性数据;
    采用JSON技术封装所述属性数据,得到目标字符串;
    采用JSON技术解析所述目标字符串,得到目标参数;
    采用浅层式语义分析方法解析所述目标参数,得到所述目标参数的目标类型;
    从HBASE库中调取与所述目标类型对应的行键生成策略;
    基于所述行键生成策略生成所述目标参数在所述HBASE库中的目标行键;
    从所述目标参数中获取目标列名;
    根据所述目标列名及所述目标行键,生成中间数据文件;
    采用计算引擎将所述中间数据文件写入所述HBASE库中,得到所述待生成数据。
  11. 如权利要求10所述的电子设备,其中,所述采用JSON技术封装所述属性数据,得到目标字符串的步骤包括:
    从所述HBASE库中调取所述属性数据中每个属性数据对应的目标标签;
    采用JSON技术封装每个属性数据及每个属性数据对应的目标标签,得到所述目标字符串。
  12. 如权利要求10所述的电子设备,其中,所述采用JSON技术解析所述目标字符串,得到目标参数的步骤包括:
    获取所述目标字符串中的所有目标标签;
    提取所述所有目标标签中每个目标标签对应的数据,作为所述目标参数。
  13. 如权利要求10所述的电子设备,其中,所述根据所述目标列名及所述目标行键,生成中间数据文件的步骤包括:
    从所述HBASE库中调取出与所述目标列名对应的目标数据;
    根据所述目标列名及所述目标行键,确定目标位置;
    将所述目标数据写入所述目标位置,得到所述中间数据文件。
  14. 如权利要求10所述的电子设备,其中,所述采用计算引擎将所述中间数据文件写入所述HBASE库中,得到所述待生成数据的步骤包括:
    根据所述中间数据文件的文件大小,将所述中间数据文件划分为至少一个数据块;
    计算所述至少一个数据块的个数,得到目标个数;
    在所述HBASE库中创建HBASE表;
    以所述目标个数为分区个数对所述HBASE表进行分区;
    采用计算引擎将所述至少一个数据块写入分区后的HBASE表中,得到所述待生成数据。
  15. 如权利要求10所述的电子设备,其中,在得到待生成数据后,所述方法还包括:
    获取所述待生成数据的表名及生成时间;
    根据所述表名及所述生成时间,生成提示信息;
    发送所述提示信息至指定联系人的终端设备。
  16. 一种计算机可读存储介质,其中,所述计算机可读存储介质中存储有至少一个指令,所述至少一个指令被电子设备中的处理器执行以实现数据生成方法,其中,所述数据生成方法包括以下步骤:
    当接收到数据生成指令时,获取所述数据生成指令的触发界面;
    采用文字识别技术识别所述触发界面上的所有文字;
    从所述所有文字中提取至少一个关键词,得到待生成数据的属性数据;
    采用JSON技术封装所述属性数据,得到目标字符串;
    采用JSON技术解析所述目标字符串,得到目标参数;
    采用浅层式语义分析方法解析所述目标参数,得到所述目标参数的目标类型;
    从HBASE库中调取与所述目标类型对应的行键生成策略;
    基于所述行键生成策略生成所述目标参数在所述HBASE库中的目标行键;
    从所述目标参数中获取目标列名;
    根据所述目标列名及所述目标行键,生成中间数据文件;
    采用计算引擎将所述中间数据文件写入所述HBASE库中,得到所述待生成数据。
  17. 如权利要求16所述的计算机可读存储介质,其中,所述采用JSON技术封装所述属性数据,得到目标字符串的步骤包括:
    从所述HBASE库中调取所述属性数据中每个属性数据对应的目标标签;
    采用JSON技术封装每个属性数据及每个属性数据对应的目标标签,得到所述目标字符串。
  18. 如权利要求16所述的计算机可读存储介质,其中,所述采用JSON技术解析所述目标字符串,得到目标参数的步骤包括:
    获取所述目标字符串中的所有目标标签;
    提取所述所有目标标签中每个目标标签对应的数据,作为所述目标参数。
  19. 如权利要求16所述的计算机可读存储介质,其中,所述根据所述目标列名及所述目标行键,生成中间数据文件的步骤包括:
    从所述HBASE库中调取出与所述目标列名对应的目标数据;
    根据所述目标列名及所述目标行键,确定目标位置;
    将所述目标数据写入所述目标位置,得到所述中间数据文件。
  20. 如权利要求16所述的计算机可读存储介质,其中,所述采用计算引擎将所述中间数据文件写入所述HBASE库中,得到所述待生成数据的步骤包括:
    根据所述中间数据文件的文件大小,将所述中间数据文件划分为至少一 个数据块;
    计算所述至少一个数据块的个数,得到目标个数;
    在所述HBASE库中创建HBASE表;
    以所述目标个数为分区个数对所述HBASE表进行分区;
    采用计算引擎将所述至少一个数据块写入分区后的HBASE表中,得到所述待生成数据。
PCT/CN2020/086799 2019-11-26 2020-04-24 一种数据生成方法、装置、电子设备及存储介质 Ceased WO2021103409A1 (zh)

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)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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的数据获取方法、装置、设备及存储介质

Patent Citations (3)

* Cited by examiner, † Cited by third party
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