Data collection method, device, equipment and computer readable storage medium
By generating collection codes and determining target data tables, associations and searches of irrelevant data tables are avoided, the problem of low data collection efficiency is solved, and resource saving and search speed are improved.
Patent Information
- Application Number
- CN201910761596.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-08-15
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2039-08-15
AI Technical Summary
When collecting data in the existing technology, it is necessary to associate and search irrelevant data tables, resulting in resource consumption and reduced efficiency.
By receiving the demand field information in the demand collection document, the preset basic code is called to generate the collection code, the target fields and data tables are determined, the target data table is formed and filtered, and the association and search of irrelevant data tables are avoided.
It improves data collection efficiency, saves resources, reduces the amount of comparison data, and improves search speed.
Smart Images

Figure CN110502513B
Abstract
Description
Technical Field
[0001] The present invention mainly relates to the field of data processing technology, and in particular, to a data acquisition method, device, equipment and computer-readable storage medium. Background Art
[0002] At present, in order to standardize data management, each data in the database is stored by type. The same type of data is stored in the same data table, while different data is stored in different data tables. When collecting data, whether the type of the collected data is single or multiple, the data tables in the database are first associated, and then the data to be collected is searched from the associated data tables for collection.
[0003] However, in the method of searching and collecting data through associated data tables, there are data tables in the associated data tables that are irrelevant to the required collected data; at the same time, due to the association of irrelevant data tables, it is necessary to search the irrelevant data tables when performing the search operation; the association and search operations of irrelevant data tables consume resources and reduce the efficiency of data collection. Summary of the invention
[0004] The main purpose of the present invention is to provide a data collection method, device, equipment and computer-readable storage medium, aiming to solve the problem that in the prior art, when collecting data, the association and search operations on irrelevant data tables consume resources and reduce the efficiency of data collection.
[0005] To achieve the above object, the present invention provides a data collection method, which comprises the following steps:
[0006] When a demand collection document is received, the demand field information in the demand collection document is read, and a preset basic code is called to add the demand field information to a connection statement of the preset basic code to generate a collection code;
[0007] Controlling the acquisition code to run, generating running results, and determining the target fields corresponding to the required field information and the data tables corresponding to the target fields according to the running results;
[0008] According to the number of the data tables, the data tables are formed into target data tables, and the target data tables are screened to collect data corresponding to the required field information.
[0009] Preferably, the step of determining the target fields corresponding to the required field information and the data tables corresponding to the target fields according to the operation results includes:
[0010] Reading a comparison result of the required field information in the running result and the full field in the preset basic code, and determining a target field in the full field corresponding to the required field information according to the comparison result;
[0011] The data table name corresponding to each of the target fields in the operation result is read, and the data table corresponding to each of the target fields is determined according to the data table name.
[0012] Preferably, the step of forming the data table into a target data table according to the number of the data tables comprises:
[0013] Determine whether the data table name corresponding to each target field is unique, if so, determine that the number of the data table is single, otherwise, determine that the number of the data table is multiple;
[0014] When the number of the data tables is single, the single data table is determined as the target data table;
[0015] When there are multiple data tables, the correlation identifiers storing the correlations of various types of data in the multiple data tables are read, and the correlation identifiers are generated as association identifiers, and the multiple data tables are associated to form a target data table.
[0016] Preferably, the step of screening the target data table and collecting data corresponding to the required field information includes:
[0017] Reading the screening range information in the demand collection document, and performing a primary screening on the target data table according to the screening range information to generate primary screening data;
[0018] According to the data table corresponding to each of the target fields, each of the initially screened data is screened again to generate re-screened data, and the re-screened data is set as data corresponding to the required field information for collection.
[0019] Preferably, the step of setting the re-screened data to be data corresponding to the required field information for collection includes:
[0020] Determine whether the target data table carries the association identifier, and if so, associate the re-screened data according to the association identifier, and set the associated re-screened data as data corresponding to the required field information for collection;
[0021] If the association identifier is not carried, the re-screened data is set to be collected as data corresponding to the required field information.
[0022] Preferably, the step of adding the required field information to the connection statement in the preset basic code to generate the acquisition code includes:
[0023] Determine a connection statement in the preset basic code according to a preset connection identifier, and detect a variable position in the connection statement according to a preset variable identifier;
[0024] Add the required field information to the variable position, replace the variable in the variable position, and detect whether the required field information is all added to the variable position;
[0025] If both are added to the variable position, the preset basic code is updated to the acquisition code.
[0026] Preferably, before the step of controlling the acquisition code to run and generating the running result, the step includes:
[0027] Comparing the acquisition code with a preset form rule to determine whether each statement in the acquisition code complies with the preset form rule, wherein the preset form rule is used to determine the correctness of the acquisition code;
[0028] If all the statements conform to the preset formal rules, the step of controlling the execution of the acquisition code and generating the execution result is executed;
[0029] If there are abnormal sentences in the sentences that do not conform to the preset format rule, prompt modification information is output based on the abnormal sentences.
[0030] In addition, to achieve the above object, the present invention further provides a data acquisition device, the data acquisition device comprising:
[0031] A reading module, configured to read the demand field information in the demand collection document when receiving the demand collection document, and call the preset basic code to add the demand field information to the connection statement of the preset basic code to generate the collection code;
[0032] A control module, used to control the execution of the acquisition code, generate an execution result, and determine the target field corresponding to the required field information and the data table corresponding to each of the target fields according to the execution result;
[0033] The collection module is used to form a target data table from the data table according to the number of the data tables, and to screen the target data table to collect data corresponding to the required field information.
[0034] In addition, to achieve the above-mentioned purpose, the present invention also provides a data acquisition device, the data acquisition device comprising: a memory, a processor, a communication bus and a data acquisition program stored in the memory;
[0035] The communication bus is used to realize the connection and communication between the processor and the memory;
[0036] The processor is used to execute the data acquisition program to implement the following steps:
[0037] When a demand collection document is received, the demand field information in the demand collection document is read, and a preset basic code is called to add the demand field information to a connection statement of the preset basic code to generate a collection code;
[0038] Controlling the acquisition code to run, generating running results, and determining the target fields corresponding to the required field information and the data tables corresponding to the target fields according to the running results;
[0039] According to the number of the data tables, the data tables are formed into target data tables, and the target data tables are screened to collect data corresponding to the required field information.
[0040] In addition, to achieve the above-mentioned object, the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors for:
[0041] When a demand collection document is received, the demand field information in the demand collection document is read, and a preset basic code is called to add the demand field information to a connection statement of the preset basic code to generate a collection code;
[0042] Controlling the acquisition code to run, generating running results, and determining the target fields corresponding to the required field information and the data tables corresponding to the target fields according to the running results;
[0043] According to the number of the data tables, the data tables are formed into target data tables, and the target data tables are screened to collect data corresponding to the required field information.
[0044] The data collection method of this embodiment, when receiving a demand collection document, first reads the demand field information therein, then calls the preset basic code, and adds the demand field information to the connection statement of the preset basic code to generate a collection code; thereafter, the collection code is controlled to run, the running result is generated, and the target field corresponding to the demand field information and the data table corresponding to each target field are determined according to the running result; then, according to the number of data tables, the data table is formed into a target data table, and the target data table is screened to realize the data collection corresponding to the demand field information. This scheme forms the data to be collected into a demand collection document, and the demand field information therein represents the type of data to be collected; the collection code formed by adding the demand field information to the preset basic code is used to search for the demand field information to determine the data table where the demand field information is located; then, the data table is formed into a target data table for screening, and the data corresponding to the demand field information is collected. Because the target data table is formed by the data table where the required field information to be collected is located, the association and search operations on data tables that are not related to the collected data are avoided, resources are saved, and the efficiency of data collection is improved; at the same time, the collection code formed by the preset basic code only compares and searches the required field information at runtime, so the amount of compared data is small and the search speed is fast. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 is a flow chart of a first embodiment of a data collection method of the present invention;
[0046] Figure 2 It is a functional module schematic diagram of the first embodiment of the data acquisition device of the present invention;
[0047] Figure 3 It is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present invention.
[0048] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0049] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0050] The invention provides a data collection method.
[0051] Please refer to Figure 1 , Figure 1 The flowchart of the first embodiment of the data collection method of the present invention is shown in FIG. In this embodiment, the data collection method includes:
[0052] Step S10, when a demand collection document is received, the demand field information in the demand collection document is read, and a preset basic code is called, the demand field information is added to a connection statement of the preset basic code, and a collection code is generated;
[0053] The data collection method of the present invention is applied to a server and is suitable for collecting various types of data through the server. In order to facilitate the collection of various types of data, a document collection mechanism is set; a collection personnel with data collection requirements sets a demand collection document, and sets the demand field information representing the data type to be collected, such as fields such as policy number and insured person; and the screening range information representing the range of the data to be collected, such as time range, organization range, list code range, salesperson code range, etc., into a blank document to form a demand collection document and upload it to the server. When the server receives the demand collection document, the demand field information therein is first read to determine the data type to be collected through the read demand field information. At the same time, a preset basic code is also pre-set, and the preset basic code contains all the fields stored in the database and the table name of the data table where each field is located; it represents each field in the database and the data table name corresponding to each field. In addition, a connection statement is also set in the preset basic code. When the demand collection document is received and data collection is required, the preset basic code is called, and the read demand field information is added to the connection statement of the preset basic code. The preset basic code after adding the required field information to the connection statement is actually a code for searching the data table where the required field information is located, and it is used as a collection code to collect the required data represented by the required field information. Considering that there are many code statements involved in the preset basic code, it is necessary to first distinguish the connection statement from it, and the distinguishing operation can be performed through the connection identifier; specifically, the required field information is added to the connection statement in the preset basic code, and the steps of generating the collection code include:
[0054] Step S11, determining a connection statement in the preset basic code according to a preset connection identifier, and detecting a variable position in the connection statement according to a preset variable identifier;
[0055] A connection identifier representing a connection statement is preset, and during the development of the preset basic code, the connection identifier is added to the connection statement therein. In the process of adding the required field information, the code statement where the preset connection identifier is located in the preset basic code is first detected, and the code statement where it is located is the connection statement. In addition, the connection statement contains multiple codes, and the multiple codes contain conventional codes that support the operation of the connection statement and realize its functions, as well as variable codes used to replace the required field information to query the required field information. Conventional codes have a non-replaceable characteristic, while variable codes have a replaceable characteristic, and the variable codes are represented by a preset variable identifier. After determining the connection statement in the preset basic code, the code with the preset variable identifier is detected, and the code with the preset variable identifier is the variable code; the position of the variable code in the connection statement is determined as the variable position in the connection statement to query the required field information.
[0056] Step S12, adding the required field information to the variable position, replacing the variable in the variable position, and detecting whether the required field information is all added to the variable position;
[0057] Step S13: If all are added to the variable position, the preset basic code is updated to the acquisition code.
[0058] Furthermore, the variable code in the variable position is the variable that needs to be replaced. After determining the variable position in the connection statement, each field in the requirement field information is added to the variable position to replace the variable therein. Because the requirement field information involves many fields, separators such as " / ", ";", etc. can be pre-set to distinguish each requirement field information; when adding, first delete the variable in the variable position, and then add each requirement field information to the variable position one by one, and separate them with separators to ensure the independence of each field in the requirement field information. In addition, during the adding process, it is detected whether each field in the requirement field information is added to the variable position to prevent omissions; this detection can be performed based on the number of fields and field repeatability of the requirement field information, that is, to determine whether the number of fields of the added requirement field information is consistent with the number of fields read from the requirement collection document, and to determine whether there is repeated requirement field information in the added requirement field information. When there is no duplicated required field information in the added required field information, and the number of fields is consistent, it means that all fields in the required field information are added to the variable position; otherwise, if there is duplicated required field information, or the number of fields is inconsistent, it means that there is required field information that has not been added to the variable position, and it is necessary to continue adding until all fields in the required field information are added to the variable position. After detecting that all fields in the required field information are added to the variable position, the preset basic code with the required field information added is updated to the collection code to query the data table corresponding to the required field information, and then collect the data that needs to be collected corresponding to the required field information from the data table.
[0059] Step S20, controlling the acquisition code to run, generating a running result, and determining the target field corresponding to the required field information and the data table corresponding to each of the target fields according to the running result;
[0060] Furthermore, after generating the collection code with the required field information added, the server sends an operation instruction to the collection code to control the collection code to run; the collection code runs according to its own pre-set logic, searches for the fields corresponding to the required field information, and generates an operation result. The server reads the operation result and determines the target field corresponding to the required field information and the data table corresponding to each target field based on the search result. The preset basic code contains all the fields stored in the database. The operation of the collection code is a process of comparing each field in the required field information with all the fields, and searching for the fields corresponding to each field in the required field information from all the fields; the operation result generated by the operation includes the comparison result of the comparison, and the server can determine the target fields corresponding to the required field information based on the comparison result; specifically, the steps of determining the target field corresponding to the required field information and the data table corresponding to each target field according to the operation result include:
[0061] Step S21, reading a comparison result of the required field information in the running result and the full field in the preset basic code, and determining a target field in the full field corresponding to the required field information according to the comparison result;
[0062] Furthermore, all fields stored in the database included in the preset basic code are used as the full fields in the preset basic code, and the required field information is compared with the full fields through the acquisition code operation to find the fields corresponding to each required field information in the full fields; thereafter, a search identifier is assigned to each corresponding field found, and the comparison result in the operation result is generated as a target field. After reading the operation result, the server reads the comparison result therein, and determines the target field corresponding to the required field information through the search identifier in the comparison result.
[0063] Step S22, reading the data table name corresponding to each of the target fields in the operation result, and determining the data table corresponding to each of the target fields according to the data table name.
[0064] Furthermore, in addition to all the fields stored in the database, the preset basic code also includes the table name of the data table where each field is located, and there is a corresponding relationship between each field and the table name of the data table where each field is located; if the fields included are W1 and W2, and the table name of the data table where W1 is located is M1, and the table name of the data table where W2 is located is M2, then there is a corresponding relationship between W1 and M1, and between W2 and M2. In the running result generated by the acquisition code running, in addition to the comparison results representing the target fields corresponding to each required field information, it also includes the table name corresponding to each target field to represent the data table where each target field is located. The table name corresponding to each target field in the running result is read as the data table name, and the data table corresponding to each target field is determined based on the data table name. Because different data tables have different table names, the data table represented by the data table name is the data table corresponding to each target field, representing the data table where each target field is located.
[0065] Step S30, according to the number of the data tables, forming the data tables into target data tables, and screening the target data tables to collect data corresponding to the required field information.
[0066] Understandably, since the required field information represents a large number of data types that need to be collected, there are many target fields corresponding to the required field information. The multiple target fields may be located in the same data table or in multiple different data tables; that is, the data table corresponding to the target field may be single or multiple. In order to facilitate data collection, the single or multiple data tables are formed into a target data table, and the target data table is screened to collect data corresponding to the required field information, that is, the data required to be collected in the demand collection document. Because the data table may be single or multiple, when forming the target data table, different operations need to be performed based on the difference in quantity; specifically, according to the number of data tables, the steps of forming the data table into the target data table include:
[0067] Step S31, determining whether the data table name corresponding to each target field is unique, if it is unique, determining that the number of the data table is single, otherwise determining that the number of the data table is multiple;
[0068] Furthermore, since different data tables have different table names, we can first determine whether the number of data tables is single or multiple through the uniqueness of the data table names; that is, judge whether the data table name corresponding to each target field is unique. If there is only one corresponding data table name, that is, it is unique, then the number of data tables is single; if there are multiple corresponding data table names, that is, they are not unique, then the number of data tables is multiple.
[0069] Step S32, when the number of the data tables is only one, determining the single data table as the target data table;
[0070] Furthermore, when it is determined that the data table name is unique and the number of data tables is single, it means that the data that need to be collected in the demand collection document are all in this single data table; that is, all the data that need to be collected can be collected through this single data table, and the single data table containing all the data that need to be collected is used as the target data table.
[0071] Step S33, when there are multiple data tables, read the correlation identifiers storing the correlations of various types of data in the multiple data tables, generate the correlation identifiers as association identifiers, associate the multiple data tables, and form a target data table.
[0072] If it is determined that the data table name is not unique and there are multiple data tables corresponding to the target field, it means that the data required to be collected by the demand collection document exists in multiple different data tables, and the required various data need to be collected from multiple data tables. At this time, the relevant identifiers between the multiple data tables are read, and the relevant identifiers represent the correlation between the various types of data stored in each data table. For example, the corresponding data table includes an insured information table and an insured amount table, wherein the insured information table includes the policy number insured by the insured, and the insured amount is the amount insured for each policy, which is correlated with the policy number of each policy; thus, the policy number is the relevant identifier between the insured information table and the insured amount table. The read relevant identifier is generated as an association identifier, and the multiple data tables are associated with the association identifier to generate a target data table; that is, the association identifier is assigned to each corresponding data table to establish an association relationship between the multiple data tables to form a target data table representing the various data required to be collected by the demand collection document. For example, if the required field information in the demand collection document is a1, a2, and a3, and if it is determined that the data tables where a1, a2, and a3 are located are A, B, and C respectively, then association identifiers are assigned to data tables A, B, and C, and the three are associated to form a target data table to collect the required field data from the three; and if it is determined that the data table where a1, a2, and a3 are located is D, then D is directly set as the target data table to collect the required field data from it.
[0073] Understandably, there are many data involved in the target data table, including various types of data required to be collected by the demand collection document, as well as other types of data; for example, the data required to be collected by the demand collection document is data stored after January 1, 2018, while the target data table may include data before this date. Therefore, in order to collect data that meets the requirements, it is necessary to filter the target data table according to the filter range information in the demand collection document that represents the range of the data to be collected; specifically, the steps of filtering the target data table and collecting data corresponding to the required field information include:
[0074] Step S34, reading the screening range information in the demand collection document, and performing a primary screening on the target data table according to the screening range information to generate primary screening data;
[0075] Furthermore, the screening range information in the demand collection document is first read to determine the range corresponding to the data to be collected through the read screening range information; then the target data table is initially screened according to the read screening range information, and the initial screening data that meets the requirements corresponding to the screening range information is screened out from the target data table. The initial screening data obtained by the initial screening varies according to the different screening range information. For example, when the screening range information is a time range, the initial screening data screened out is all the data generated in the target data table within the time range; and when the screening range information is a salesperson code, the initial screening data screened out is all the data corresponding to the salesperson code in the target data table.
[0076] Step S35, re-screening each of the initially screened data according to the data table corresponding to each of the target fields, generating re-screened data, and setting the re-screened data as data corresponding to the required field information for collection.
[0077] Furthermore, the first screening data obtained by the first screening is all data that meets the requirements of the screening range information, and the data includes data corresponding to each target field and data not corresponding to each target field; therefore, it is necessary to screen the first screening data again according to each target field to screen out the data corresponding to each target field. Since there is a corresponding relationship between each target field and the demand field information, the data corresponding to each target field screened out by the second screening is actually the data corresponding to the demand field information, that is, the data required to be collected by the demand collection document. Since the data table corresponding to each target field may be single or multiple, and the single or multiple data tables form the target data table, the first screening data obtained by the first screening of the target data table may also come from a single data table or multiple data tables. When the data table corresponding to each target field is single, the single data table directly forms the target data table, and the first screening data comes from the single data table; when the data table corresponding to each target field is multiple, the multiple data tables are associated to form the target data table, and the first screening data comes from the multiple data tables.
[0078] When re-screening the initially screened data according to each target field, it is necessary to perform the re-screening according to the data table corresponding to each target field; when the data table corresponding to each target field is a single data table and the initially screened data comes from the single data table, the initially screened data is directly re-screened according to each target field to obtain the re-screened data. When the data tables corresponding to each target field are multiple data tables and the initially screened data comes from the multiple data tables, the data tables are re-screened according to the data tables corresponding to each target field to obtain the re-screened data. For example, if the target fields include two categories, namely, the name of the insured and the insured amount, the corresponding data tables are the insured information table and the insured amount table, respectively, and the screening range information is data between July 1, 2018 and December 31, 2018; thus, the insured information table and the insured amount table are initially screened according to the required field information to obtain the initially screened data with a time range between July 1, 2018 and December 31, 2018. Then, according to the correspondence between each target field and each data table, the initial screening data from the policyholder information table is screened again to obtain the secondary screening data corresponding to the policyholder's name; at the same time, the initial screening data from the insured amount table is screened again to obtain the secondary screening data corresponding to the insured amount. Since the secondary screening data is the data that meets the requirements of the required field information and the screening range information in the demand collection document, it is the data that needs to be collected; therefore, the secondary screening data is set as the data corresponding to the required field information for collection to meet the collection requirements of the demand collection document.
[0079] Considering that when each target data table is formed by multiple data tables, the re-screened data obtained by re-screening also comes from multiple data tables; when collecting the re-screened data, it is necessary to first associate the re-screened data from multiple data tables. Specifically, the steps of setting the re-screened data to data corresponding to the required field information for collection include:
[0080] Step S351, determining whether the target data table carries the association identifier, if it carries the association identifier, associating the re-screened data according to the association identifier, and setting the associated re-screened data as data corresponding to the required field information for collection;
[0081] Understandably, when associating the re-screened data from multiple data tables, it is necessary to first determine whether the re-screened data is from multiple data tables; if it is from multiple data tables, then the association is performed, otherwise no association is performed. Because when the target data table is formed by multiple data tables, each data table is assigned an association identifier; thus, the target data table can be determined by the association identifier whether it is formed by multiple data tables, and then the re-screened data can be determined whether it is from multiple data tables. Specifically, it is determined whether the target data table carries an association identifier. If it carries an association identifier, it means that the target data table is formed by multiple data tables, and the initial screening data obtained by the initial screening of the target data table is from multiple data tables, so that the re-screened data obtained by re-screening the initial screening data is also from multiple data tables. The re-screened data from multiple data tables is associated according to the association identifier, that is, the re-screened data from each data table is assigned an association identifier to establish an association relationship between each re-screened data; each re-screened data is collected according to each association identifier, so as to realize the collection of each data required in the demand collection document.
[0082] Step S352: If the association identifier is not carried, the re-screened data is set to be collected as data corresponding to the required field information.
[0083] Furthermore, when it is determined that the target data table does not carry an associated identifier, it means that the target data table is formed by a single data table, and the primary screening data obtained by the primary screening of the target data table is derived from the single data table, so that the secondary screening data obtained by the secondary screening of the primary screening data is also derived from the single data table. The secondary screening data derived from the single data table is directly set as the data corresponding to the required field information, and the data is collected to meet the collection requirements of the demand collection document.
[0084] The data collection method of this embodiment, when receiving a demand collection document, first reads the demand field information therein, then calls the preset basic code, and adds the demand field information to the connection statement of the preset basic code to generate a collection code; thereafter, the collection code is controlled to run, the running result is generated, and the target field corresponding to the demand field information and the data table corresponding to each target field are determined according to the running result; then, according to the number of data tables, the data table is formed into a target data table, and the target data table is screened to realize the data collection corresponding to the demand field information. This scheme forms the data to be collected into a demand collection document, and the demand field information therein represents the type of data to be collected; the collection code formed by adding the demand field information to the preset basic code is used to search for the demand field information to determine the data table where the demand field information is located; then, the data table is formed into a target data table for screening, and the data corresponding to the demand field information is collected. Because the target data table is formed by the data table where the required field information to be collected is located, the association and search operations on data tables that are not related to the collected data are avoided, resources are saved, and the efficiency of data collection is improved; at the same time, the collection code formed by the preset basic code only compares and searches the required field information at runtime, so the amount of compared data is small and the search speed is fast.
[0085] Furthermore, in another embodiment of the data collection method of the present invention, before the step of controlling the collection code to run and generating the running result, the step includes:
[0086] Step S40, comparing the acquisition code with a preset form rule to determine whether each statement in the acquisition code complies with the preset form rule, wherein the preset form rule is used to determine the correctness of the acquisition code;
[0087] Understandably, the acquisition code needs to be run and generate corresponding operation results when the logical rules are correct. In order to ensure the correctness of the acquisition code logical rules, the present embodiment pre-sets preset formal rules that represent the correct logical rules; the preset formal rules include multiple sub-rules for regulating the case of characters, symbol usage, etc. in the acquisition code, such as the sub-rule for regulating the use of symbols: the symbols existing in each code statement appear separately, and symbols that appear continuously are abnormal code statements. Before controlling the operation of the acquisition code, each statement in the acquisition code is compared with the preset formal rules one by one to determine whether each statement in the acquisition code complies with the preset rules.
[0088] Step S50, if all the statements conform to the preset form rule, then the step of controlling the collection code to run and generating the running result is executed;
[0089] Step S60: If there are abnormal sentences in the sentences that do not conform to the preset format rule, output prompt modification information based on the abnormal sentences.
[0090] Furthermore, if it is determined through comparison that each statement complies with the preset rules, it means that the logical rules of the acquisition code are correct, and the acquisition code is controlled to run to generate the running results. If it is determined through comparison that there are statements in each statement that do not comply with the preset formal rules, the non-compliant statements are abnormal statements with abnormal logical rules and need to be corrected; the code line number where the abnormal statement is located is added to the prompt modification information output to prompt the developer to modify the abnormal statement. After the abnormal statements in each statement of the acquisition code have been modified and each statement in the acquisition code corresponds to the preset formal rules, the acquisition code is controlled to run and generate the running results; the target field and the data table corresponding to the target field are determined through the running results, and then the data table is formed into a target data table, from which the data required to be collected by the demand collection document is collected.
[0091] In addition, please refer to Figure 2 The present invention provides a data acquisition device. In a first embodiment of the data acquisition device of the present invention, the data acquisition device comprises:
[0092] The reading module 10 is used for, when receiving a demand collection document, reading the demand field information in the demand collection document, calling a preset basic code, adding the demand field information to a connection statement of the preset basic code, and generating a collection code;
[0093] The control module 20 is used to control the collection code to run, generate running results, and determine the target fields corresponding to the required field information and the data tables corresponding to the target fields according to the running results;
[0094] The collection module 30 is used to form a target data table from the data tables according to the number of the data tables, and to screen the target data table to collect data corresponding to the required field information.
[0095] The data collection device of this embodiment, when receiving a demand collection document, the reading module 10 first reads the demand field information therein, then calls the preset basic code, and adds the demand field information to the connection statement of the preset basic code to generate a collection code; thereafter, the control module 20 controls the collection code to run, generates a running result, and determines the target field corresponding to the demand field information and the data table corresponding to each target field according to the running result; then the collection module 30 forms the data table into a target data table according to the number of data tables, and screens the target data table to realize the data collection corresponding to the demand field information. This scheme forms the data to be collected into a demand collection document, and the demand field information therein represents the type of data to be collected; the collection code formed by adding the demand field information to the preset basic code is used to search for the demand field information to determine the data table where the demand field information is located; then the data table is formed into a target data table for screening, and the data corresponding to the demand field information is collected. Because the target data table is formed by the data table where the required field information to be collected is located, the association and search operations on data tables that are not related to the collected data are avoided, resources are saved, and the efficiency of data collection is improved; at the same time, the collection code formed by the preset basic code only compares and searches the required field information at runtime, so the amount of compared data is small and the search speed is fast.
[0096] Furthermore, in another embodiment of the data acquisition device of the present invention, the control module further includes:
[0097] A reading unit, used for reading a comparison result of the required field information in the running result and the full field in the preset basic code, and determining a target field in the full field corresponding to the required field information according to the comparison result;
[0098] The first determining unit is used to read the data table name corresponding to each of the target fields in the operation result, and determine the data table corresponding to each of the target fields according to the data table name.
[0099] Furthermore, in another embodiment of the data acquisition device of the present invention, the acquisition module further includes:
[0100] A judging unit, used for judging whether the data table name corresponding to each of the target fields is unique, and if so, judging that the number of the data table is single, otherwise judging that the number of the data table is multiple;
[0101] a second determining unit, configured to determine the single data table as a target data table when the number of the data tables is single;
[0102] The association unit is used to read the correlation identifiers storing the correlation of various types of data in the multiple data tables when there are multiple data tables, generate the correlation identifiers as association identifiers, and associate the multiple data tables to form a target data table.
[0103] Furthermore, in another embodiment of the data acquisition device of the present invention, the acquisition module further includes:
[0104] A generating unit, configured to read the screening range information in the demand collection document, and perform a primary screening on the target data table according to the screening range information to generate primary screening data;
[0105] The collection unit is used to re-screen each of the initially screened data according to the data table corresponding to each of the target fields, generate re-screened data, and set the re-screened data as data corresponding to the required field information for collection.
[0106] Furthermore, in another embodiment of the data acquisition device of the present invention, the acquisition unit is also used for:
[0107] Determine whether the target data table carries the association identifier, and if so, associate the re-screened data according to the association identifier, and set the associated re-screened data as data corresponding to the required field information for collection;
[0108] If the association identifier is not carried, the re-screened data is set to be collected as data corresponding to the required field information.
[0109] Furthermore, in another embodiment of the data acquisition device of the present invention, the reading module further includes:
[0110] A detection unit, configured to determine a connection statement in the preset basic code according to a preset connection identifier, and to detect a variable position in the connection statement according to a preset variable identifier;
[0111] An adding unit, used for adding the required field information to the variable position, replacing the variable in the variable position, and detecting whether the required field information is all added to the variable position;
[0112] An updating unit is used to update the preset basic code to the acquisition code if both are added to the variable position.
[0113] Furthermore, in another embodiment of the data acquisition device of the present invention, the data acquisition device further includes:
[0114] A comparison module, used to compare the acquisition code with a preset form rule to determine whether each statement in the acquisition code complies with the preset form rule, wherein the preset form rule is used to determine the correctness of the acquisition code;
[0115] An execution module, configured to execute the steps of controlling the execution of the acquisition code and generating an execution result if each of the statements conforms to the preset formal rules;
[0116] The output module is used to output prompt modification information based on the abnormal sentence if there is an abnormal sentence that does not conform to the preset format rule in each of the sentences.
[0117] Among them, each virtual function module of the above data acquisition device is stored in Figure 3 In the memory 1005 of the data acquisition device shown in the figure, when the processor 1001 executes the data acquisition program, the Figure 2 The functions of each module in the illustrated embodiment.
[0118] Reference Figure 3 , Figure 3 It is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present invention.
[0119] The data acquisition device in the embodiment of the present invention may be a PC (personal computer), or may be a terminal device such as a smart phone, a tablet computer, an e-book reader, a portable computer, etc.
[0120] like Figure 3 As shown, the data acquisition device may include: a processor 1001, such as a CPU (Central Processing Unit), a memory 1005, and a communication bus 1002. The communication bus 1002 is used to realize the connection and communication between the processor 1001 and the memory 1005. The memory 1005 may be a high-speed RAM (random access memory) or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may optionally be a storage device independent of the aforementioned processor 1001.
[0121] Optionally, the data acquisition device may also include a user interface, a network interface, a camera, an RF (Radio Frequency) circuit, a sensor, an audio circuit, a WiFi (Wireless Fidelity) module, etc. The user interface may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface may also include a standard wired interface and a wireless interface. The network interface may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface).
[0122] Those skilled in the art will understand that Figure 3 The data acquisition device structure shown in the figure does not constitute a limitation on the data acquisition device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0123] like Figure 3 As shown, the memory 1005 as a computer-readable storage medium may include an operating system, a network communication module and a data acquisition program. The operating system is a program that manages and controls the hardware and software resources of the data acquisition device, and supports the operation of the data acquisition program and other software and / or programs. The network communication module is used to realize the communication between the components inside the memory 1005, and the communication with other hardware and software in the data acquisition device.
[0124] exist Figure 3 In the data acquisition device shown, the processor 1001 is used to execute the data acquisition program stored in the memory 1005 to implement the steps in each embodiment of the above data acquisition method.
[0125] The present invention provides a computer-readable storage medium, which stores one or more programs. The one or more programs can also be executed by one or more processors to implement the steps in each embodiment of the above-mentioned data acquisition method.
[0126] It should also be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of more restrictions, an element defined by the sentence "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
[0127] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0128] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a computer-readable storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.
[0129] The above description is only a preferred embodiment of the present invention, and does not limit the patent scope of the present invention. All equivalent structural changes made by using the contents of the present invention specification and drawings under the concept of the present invention, or directly / indirectly applied in other related technical fields are included in the patent protection scope of the present invention.
Claims
1. A data collection method, It is characterized in that The data collection method comprises the following steps: When a demand collection document is received, the demand field information in the demand collection document is read, and a preset basic code is called to add the demand field information to a connection statement of the preset basic code to generate a collection code, wherein the connection statement includes a plurality of codes, and the plurality of codes include conventional codes for supporting the connection statement to run and realize its functions, and variable codes for replacing the demand field information to query the demand field information; Controlling the acquisition code to run, generating running results, and determining the target fields corresponding to the required field information and the data tables corresponding to the target fields according to the running results; According to the number of the data tables, the data tables are formed into target data tables, and the target data tables are screened to collect data corresponding to the required field information; The step of determining the target fields corresponding to the required field information and the data tables corresponding to the target fields according to the operation results includes: Reading a comparison result of the required field information in the running result and the full field in the preset basic code, and determining a target field in the full field corresponding to the required field information according to the comparison result; Read the data table name corresponding to each of the target fields in the operation result, and determine the data table corresponding to each of the target fields according to the data table name; The step of adding the required field information to the connection statement in the preset basic code to generate the acquisition code includes: Determine a connection statement in the preset basic code according to a preset connection identifier, and detect a variable position in the connection statement according to a preset variable identifier; Add the required field information to the variable position, replace the variable in the variable position, and detect whether the required field information is all added to the variable position; If both are added to the variable position, the preset basic code is updated to the acquisition code; The step of controlling the acquisition code to run and generating the running result includes: Comparing the acquisition code with a preset form rule to determine whether each statement in the acquisition code complies with the preset form rule, wherein the preset form rule is used to determine the correctness of the acquisition code; If all the statements conform to the preset formal rules, the step of controlling the execution of the acquisition code and generating the execution result is executed; If there are abnormal sentences in the sentences that do not conform to the preset format rule, prompt modification information is output based on the abnormal sentences.
2. The data collection method according to claim 1, It is characterized in that The step of forming the data tables into target data tables according to the number of the data tables comprises: Determine whether the data table name corresponding to each target field is unique, if so, determine that the number of the data table is single, otherwise, determine that the number of the data table is multiple; When the number of the data tables is single, the single data table is determined as the target data table; When there are multiple data tables, the correlation identifiers storing the correlations of various types of data in the multiple data tables are read, and the correlation identifiers are generated as association identifiers, and the multiple data tables are associated to form a target data table.
3. The data collection method according to claim 2, It is characterized in that The step of screening the target data table and collecting data corresponding to the required field information includes: Reading the screening range information in the demand collection document, and performing a primary screening on the target data table according to the screening range information to generate primary screening data; According to the data table corresponding to each of the target fields, each of the initially screened data is screened again to generate re-screened data, and the re-screened data is set as data corresponding to the required field information for collection.
4. The data collection method according to claim 3, It is characterized in that The step of setting the re-screened data to be data corresponding to the required field information for collection includes: Determine whether the target data table carries the association identifier, and if so, associate the re-screened data according to the association identifier, and set the associated re-screened data as data corresponding to the required field information for collection; If the association identifier is not carried, the re-screened data is set to be collected as data corresponding to the required field information.
5. A data acquisition device, It is characterized in that The data acquisition device comprises: A reading module, configured to read the demand field information in the demand collection document when receiving the demand collection document, and call the preset basic code to add the demand field information to the connection statement of the preset basic code to generate the collection code; A control module, used to control the execution of the acquisition code, generate an execution result, and determine the target field corresponding to the required field information and the data table corresponding to each of the target fields according to the execution result; A collection module, used for forming a target data table from the data table according to the number of the data tables, screening the target data table, and collecting data corresponding to the required field information; The data acquisition device is used to achieve: Reading a comparison result of the required field information in the running result and the full field in the preset basic code, and determining a target field in the full field corresponding to the required field information according to the comparison result; Read the data table name corresponding to each of the target fields in the operation result, and determine the data table corresponding to each of the target fields according to the data table name; The data acquisition device is also used to achieve: Determine a connection statement in the preset basic code according to a preset connection identifier, and detect a variable position in the connection statement according to a preset variable identifier; Add the required field information to the variable position, replace the variable in the variable position, and detect whether the required field information is all added to the variable position; If both are added to the variable position, the preset basic code is updated to the acquisition code; The data acquisition device is also used to achieve: Comparing the acquisition code with a preset form rule to determine whether each statement in the acquisition code complies with the preset form rule, wherein the preset form rule is used to determine the correctness of the acquisition code; If all the statements conform to the preset formal rules, the step of controlling the execution of the acquisition code and generating the execution result is executed; If there are abnormal sentences in the sentences that do not conform to the preset format rule, prompt modification information is output based on the abnormal sentences.
6. A data acquisition device, It is characterized in that The data acquisition device comprises: a memory, a processor, a communication bus and a data acquisition program stored in the memory; The communication bus is used to realize the connection and communication between the processor and the memory; The processor is used to execute the data acquisition program to implement the steps of the data acquisition method according to any one of claims 1 to 4.
7. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a data acquisition program, and when the data acquisition program is executed by a processor, the steps of the data acquisition method according to any one of claims 1 to 4 are implemented.
