CN111222070B - Data processing method, device, equipment and storage medium - Google Patents

Data processing method, device, equipment and storage medium Download PDF

Info

Publication number
CN111222070B
CN111222070B CN201911402337.4A CN201911402337A CN111222070B CN 111222070 B CN111222070 B CN 111222070B CN 201911402337 A CN201911402337 A CN 201911402337A CN 111222070 B CN111222070 B CN 111222070B
Authority
CN
China
Prior art keywords
data
content
target
field
file
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.)
Active
Application number
CN201911402337.4A
Other languages
Chinese (zh)
Other versions
CN111222070A (en
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.)
Shenzhen Wugu Network Technology Co ltd
Original Assignee
Shenzhen Wugu Network 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 Shenzhen Wugu Network Technology Co ltd filed Critical Shenzhen Wugu Network Technology Co ltd
Priority to CN201911402337.4A priority Critical patent/CN111222070B/en
Publication of CN111222070A publication Critical patent/CN111222070A/en
Application granted granted Critical
Publication of CN111222070B publication Critical patent/CN111222070B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Quality & Reliability (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The method, the device, the equipment and the storage medium for processing the data are suitable for the technical field of data processing, the target file is obtained by analyzing after the data file is obtained, the webpage form is generated, the data in the webpage form is verified by setting a verification rule at a client, and when the data verification fails, the data are correspondingly marked in the webpage form to prompt a user to modify the error data, so that the verification of the data can be realized at a browser end, the consumed time is effectively reduced, and the processing efficiency is improved.

Description

Data processing method, device, equipment and storage medium
Technical Field
The application belongs to the technical field of data processing, and particularly relates to a data processing method, a device, equipment and a storage medium.
Background
For the way of submitting data files to web pages, currently, the industry usually leads in data files in a form interface of a web page of a browser through a user, then submits the data files to a server background, and the server background program verifies the uploaded data files, so that the verification does not return an error prompt to the browser. However, the data file is uploaded to the webpage and then submitted to the server, and after the server fails to check, the server is required to return error prompt information to the webpage of the browser to prompt, and after the user is prompted to modify the data file offline, the data file is submitted again.
In summary, the current data submitting method has the problems of long time consumption and low submitting efficiency.
Disclosure of Invention
The embodiment of the application provides a data processing method, a device, equipment and a storage medium, which can solve the problems of long time consumption and low submitting work efficiency in the prior art of submitting data files to a server on a webpage.
In a first aspect, an embodiment of the present application provides a data processing method, including:
acquiring a data file;
analyzing the data file to obtain target data, and generating a target file according to the target data;
generating a web page form according to the target file;
checking the data in the webpage form according to a preset check rule;
if the data in the webpage form fails to be checked, the error data is marked in the webpage form.
In one embodiment, the web page form includes a header portion and a data content portion, the header portion including at least one header field, each header field corresponding to a list of data content fields;
the generating the web page list according to the target file comprises the following steps:
analyzing the target file to obtain header data and content data;
Writing the header data into a header field of the header portion;
writing the content data into a data content field of the data content portion.
In an embodiment, after said writing said content data in the data content field of the data content part, further comprising:
if a new adding instruction is received, adding a new line in the web page form, and converting each data content field of the new adding line into a first editable field;
and writing first data input by a user in the first editable field into a corresponding field of the newly added row, wherein the first data is first row content data in the target file.
In an embodiment, after said writing said content data in the data content field of the data content part, further comprising:
receiving a replacement instruction, wherein the replacement instruction is used for replacing header data in a header field selected by a user with target header data;
acquiring a data content field corresponding to a header field selected by a user, and converting the data content field into a second editable field;
verifying the content data in the second editable field;
if the content data in the second editable field does not accord with the verification rule, marking the second editable field corresponding to the error data and indicating a user to modify the error data;
Modification data entered by a user in the second editable field is received.
In an embodiment, after the receiving the replacing instruction, the replacing instruction is configured to replace header data in a header field selected by a user with target header data, the method further includes:
generating a unique identifier identifying each of said data content fields;
establishing an association relationship between the unique identifier and the content data in the data content field;
submitting the content data and the unique identification to a server.
In one embodiment, after the marking of the error data in the web page form if the data verification in the web page form fails, the method further includes:
and if the data verification of the webpage form passes, submitting the webpage form to a server.
In an embodiment, the data processing method further includes:
if the uploading failure message sent by the server is received, marking error data correspondingly according to the uploading failure message;
and if the uploading progress message sent by the server is received, determining the uploading progress according to the uploading progress message.
In a second aspect, an embodiment of the present application provides a data processing apparatus, including:
The acquisition module is used for acquiring the data file;
the analysis module is used for analyzing the data file to obtain target data and generating a target file according to the target data;
the generation module is used for generating a web page form according to the target file;
the verification module is used for verifying the data in the webpage form according to a preset verification rule;
and the marking module is used for marking error data in the webpage form if the data verification in the webpage form fails.
In a third aspect, an embodiment of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the data processing method according to any one of the first aspects when the processor executes the computer program.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium storing a computer program which, when executed by a processor, implements a data processing method according to any one of the first aspects.
In a fifth aspect, embodiments of the present application provide a computer program product for, when run on a terminal device, causing the terminal device to perform the data processing method of any one of the first aspects above.
It will be appreciated that the advantages of the second to fifth aspects may be found in the relevant description of the first aspect, and are not described here again.
Compared with the prior art, the embodiment of the application has the beneficial effects that: after the data file is obtained, the data file is analyzed to obtain a target file concurrent webpage form, and the data in the webpage form is verified by setting a verification rule at the client, and when the data verification fails, the data is correspondingly marked in the webpage form to prompt a user to modify the error data, so that the data can be verified at the browser, the consumed time is effectively reduced, and the processing efficiency is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required for the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic flow chart of an implementation of a data processing method according to an embodiment of the present application;
Fig. 2 is a schematic view of an application scenario provided in an embodiment of the present application;
FIG. 3 is a flow chart of one implementation of a data processing method provided in another embodiment of the present application;
FIG. 4 is a flow chart illustrating an implementation of a data processing method according to a further embodiment of the present application
FIG. 5 is a schematic diagram of a data processing apparatus according to an embodiment of the present application;
fig. 6 is a schematic diagram of a terminal device provided in an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system configurations, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It should be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
The data processing method provided by the embodiment of the application can be applied to terminal equipment such as tablet computers, notebook computers, ultra-mobile personal computer (UMPC) and netbooks, and the specific type of the terminal equipment is not limited. For convenience of explanation, the terminal device used in the embodiments of the present application is defined as a computer device.
Referring to fig. 1, fig. 1 shows a flowchart of an implementation of a data processing method according to an embodiment of the present invention, which is described in detail below:
s101, acquiring a data file.
In an application, the data file may be a table file or a programming language file, where the table file may be a table file made by using an electronic table software (Excel) and a table file made by using a micro Word processor (Word document); the programming language file may be a code file that can be recognized by a browser, and the browser may display the recognized language file content on a web page. Among them, the format types of the data file include, but are not limited to: xls, xlsx, xlt, xlsm, et, ett, json, xml, csv, tsv, ods, the software version for making the form data file is not limited. For convenience of description, the data file may be a table data file made by Excel software.
In application, a user can obtain a data file stored in a hard disk or a memory of the computer device through the computer device. Illustratively, the user inputs an uploading website to be accessed in an address bar of the browser, the background server returns hypertext markup language (html) data to the browser according to the input website, and the browser parses the hypertext markup language data to generate a page of the uploading data (i.e. renders a web page according to the hypertext markup language data). The browser also receives a language file (Java Script) of an executable program sent by the background server, generates a button for displaying an upload file according to the language file of the executable program, and JavaScript is a client-side scripting language which is driven based on objects and events and has relative safety, and is also a scripting language widely used for browser webpages, is commonly used for adding dynamic functions to html webpages, and responds to various operations of users. For example, referring to fig. 2, clicking the upload file button may access a data file directory stored in the computer system, and after the user selects a data file to be uploaded, the browser obtains the data file selected by the user and displays an application icon of the data file on a web interface of the browser. The browser needs to preset the authority of accessing the hard disk or the memory of the computer device, for example, a storage directory path capable of acquiring the local file is preset in the browser, which is not limited. The user can click a button for uploading files in the page, after the user selects the data files, the browser generates file uploading instructions, and the table data file catalogue stored in the computer system is acquired and displayed according to the received file uploading instructions for the user to select.
S102, analyzing the data file to obtain target data, and generating a target file according to the target data.
In the application, when the data file is uploaded to the browser, the browser can analyze the data file. For example, the browser reads the content in the data file through a file text reading (FileReader) program to obtain binary data corresponding to the target data, and then writes the target data into a code file of the target language to form the target file. Wherein the target language is a hypertext markup language (html language) recognizable by the browser. The file format of the target file can be a data exchange format (json), the data exchange format (json) has an independent programming language, the independent programming language can be directly used for representing data, the browser can write the target data obtained through analysis into the programming language, and the file formed after the analysis is the target file. For example, the json file contains a code of "value=1", where "1" is the target data, and "value" in the target file is a code representing the target data "1".
S103, generating a web page form according to the target file.
In application, the webpage form refers to a data form displayed on a visual interface of a browser, and when the browser analyzes the target file, the browser can correspondingly generate the webpage form and display target data obtained when the target file is analyzed in the form in the webpage form.
Specifically, the browser generates a corresponding webpage form by analyzing the programming language in the target file. Illustratively, in the programming language described above, both tr tags and td tags appear in pairs, beginning with < tr > and ending with < tr >; starting with < td > and ending with < td > in the td tag. Wherein code information between tr tags represents one line of target data in the table data, and code information between td tags represents target data information of a certain cell in the table data. When analyzing the programming languages in the target file, the programming languages are sequentially read from top to bottom and from left to right, so that the browser can identify the target data in the target file and generate a web page form in the visual interface.
S104, checking the data in the webpage form according to a preset check rule.
In the application, the preset verification rule may be a verification rule corresponding to each column of data preset in the background server, where the user logs in the background server through a browser in advance. For example, the verification rule includes, but is not limited to, common rules such as data uniqueness, number format, must fill in, data range interval, date format, time range, etc., which are not limited. After the user inputs the uploading website to be accessed through the address bar of the webpage of the browser, the corresponding server can be accessed, at the moment, the server can send the corresponding hypertext markup language to the browser, the hypertext markup language comprises the verification rules corresponding to each column of data, the browser can generate an executable program component comprising the verification rules after receiving and analyzing the hypertext markup language, the browser can automatically run the executable program component when writing target data into the webpage form, and at the moment, the executable program component can call the verification rules comprising the executable program component to verify the target data in the webpage form. It should be noted that, the browser generates a corresponding executable program component according to the verification rule of each column of data of the web form. The user can drag the executable program component to a certain header cell in the webpage form in a dragging mode and the like, when the executable program component is dragged to the header cell, the corresponding program can be automatically operated, the corresponding verification rule is called to verify each data in the corresponding column of the header cell one by one, and the aim of verifying target data in a browser is fulfilled.
S105, if the data verification in the web page list fails, marking error data in the web page list.
In the application, if the data check fails, the data in the uploaded data file is indicated to have errors. At this time, the error data may be marked when the verification fails. The marking may be marking the cells in the page table where the error data is located with a preset color, or marking the error data using highlighting such as thickening, so that it can be easily found by the user, thereby modifying the error data. The unit cell for marking the error data can be set as an editable unit cell, at the moment, the user can directly modify the data in the webpage form, after the data file is submitted to the server through the browser, the server judges that the data verification fails, and then returns error prompt information to the operation process of the browser.
In this embodiment, after the data file is obtained, the data file is parsed to obtain the target file and generate the web page form, and by setting a verification rule at the client, the data in the web page form is verified, and when the data verification fails, the data is marked correspondingly in the web page form to prompt the user to perform processing operation of modifying the error data, so that the data is prevented from being submitted to the server, and then the server determines the data as the error data, and transmits the error data to the time consumed by modifying the display page again.
Referring to FIG. 3, in one embodiment, the web page form includes a header portion and a data content portion, the header portion including at least one header field, each of the header fields corresponding to a set of data content fields; the difference between this embodiment and the previous embodiment is that S103 specifically includes:
s201, analyzing the target file to obtain header data and content data.
In the application, the target file is parsed according to a preset sequence, which may be set by the user according to the actual application, and in this embodiment, the code in the target file is parsed sequentially from top to bottom and from left to right.
In application, the target file is a json file, and in the codes corresponding to the target file, tr tags and td tags are in pairs, and start with < tr > and end with < tr >, so that one row of table data in a network table list can be obtained by analyzing the codes between the two tr tags, and the codes between the two tr tags can be sequentially analyzed by analyzing the target file from top to bottom; and starts with < td > and ends with < td > in the td tag, so that the code between two td tags can be considered to represent the target data information of a certain cell in the table data. Sequentially parsing the target file from left to right may be considered to parse the code between two td tags from left to right. The header data is data obtained when analyzing the first line data in the target file, and the content data is data obtained when analyzing the second line data in the target file. Wherein the header data generally corresponds to a short descriptive header of each column of content data in the data file.
S202, writing the header data into a header field of the header part.
In the application, the header data can be written into the header fields of the header part in sequence according to the sequence of analyzing the header data. Specifically, the sequence from the data analysis to the header data is the sequence of analyzing the code between two td tags to obtain the data. When the codes between the two tr tags are analyzed, the codes between the two td tags are sequentially analyzed, and the data sequentially obtained when the codes between the two td tags are analyzed each time is the sequence of analyzing the header data. And sequentially writing the header fields of the header part according to the sequence of the header data obtained by analysis.
In application, the header part may be a table part of a first row in the web page table, and the header field may be each cell in the table part of the first row. That is, the header portion may be considered as a location of the first row table, and the header field may be each cell in the first row table, which is not limited thereto.
And S203, writing the content data into a data content field of the data content part.
In an application, the content data may be written in the data content field sequentially according to the order in which the content data is parsed. Specifically, the sequence of the data analysis to the content data is that the code between the two td tags is sequentially analyzed from the code between the second tr tags in the target file, and the data sequentially obtained by analyzing the code between the two td tags is the sequence of the data analysis to the content data. And sequentially writing the content data into the data content fields of the content part according to the sequence of the content data obtained by analysis.
In an application, the content part may be a table part including the second row and below the second row in the web page form, and the data content field may be each cell in the table part including the second row and below the second row.
In this embodiment, the purpose that the data content displayed in the web page form corresponds to the data content in the data file is achieved by sequentially writing header data obtained from the analysis target file into the fields of the header portion and sequentially writing content data obtained from the analysis target file into the data content fields of the data content portion so that each header data corresponds to the content data in each column of the data content fields.
Referring to fig. 3, in an embodiment, after S203, further includes:
s301, if a new adding instruction is received, adding one row in the webpage form, and converting each field of the new adding row into a first editable field.
In application, the above-mentioned new-adding instruction can be used for adding a row of data content fields, in which the number of the data content fields added corresponds to the number of the header fields. The code corresponding to the newly added data content field of one line may be a code which is newly added and inherently indicates the data content field. For example, two tr tags are newly added, two td tags with the same number are newly added according to the number of data content fields to be newly added, and codes similar to System ' out are added in each td tag at present and are used for acquiring variable values input by a user, wherein ' System ' out indicates that the user inputs on a system, and ' Enter ' indicates that the input values are content data, and a method for acquiring codes of the newly added data content fields and indicating the input values input by the user is not limited. The first editable field is a field that a user can perform an editing operation, such as inputting data or deleting data. In application, when the target data is analyzed to generate the web page form, the header field and the data content field in the web page form are both in a read-only state (non-editable state), and when the data content field is newly added, the code containing the editable form can be written into the code of the newly added data field, i.e. the data content field can be modified into the editable field, for example, the < td > class= "dbclicktd" </td > is added in the code of each data content field. Wherein the code "class=" dbclicktd "between td tags, i.e. indicates that editing the cell (data content field) becomes editable. The manner in which the edit cell is brought into an editable state is not limited.
S302, first data input by a user in the first editable field are written into the corresponding field of the newly added row, and the first data are first row content data in the target file.
In the application, when the data file is acquired, there may be a case where header data is not set in the data file. That is, the data file contains only the data to be imported, but the user does not set header data of each column of data. Therefore, the target file generated after analyzing the data file does not have header data either, and when generating the web form according to the target file, the browser defaults to the header data to be imported into the header field of the web form. Thus, the data content portion is less than the first row of content data. Therefore, when the user determines that the first row of content data is written into the header field, the user can consider that the header data does not exist in the data file, and further can issue a new instruction to the browser, wherein the new instruction is used for adding a row of first editable field, and receiving the first row of content data input by the user in the first editable field.
In other applications, when the target file is generated by parsing the data file, there may be a case where the data file is not completely parsed, that is, one or more lines of content data are missed during parsing, or the uploaded data file itself has missing content data. Thus, the data content field can be newly added according to the new instruction for filling in the content data input by the user.
In the embodiment, the effect of completely generating the web page form for the target file without the header data is realized by receiving the new instruction of the user, the user does not need to modify the template of the data file on line, and the problem that the requirement of the template of the data file is fixed and can not be changed when the data file is imported into the web page in the past is solved.
Referring to fig. 4, in an embodiment, after S203, further includes:
s401, receiving a replacement instruction, wherein the replacement instruction is used for replacing header data in a header field selected by a user with target header data.
In the application, the target header data is data sent by a background server, the hypertext markup language data sent by the background server is analyzed by a browser, a webpage of uploading data is generated, and the browser also generates the target header data sent by the background server in the webpage. The target header data is a text control made based on a target programming language (JavaScript), wherein the text control is provided with one or more characters arranged in the middle of an opaque box, the characters can serve as an explanation of the text control, or a more detailed explanation information box can be shot through suspension of a cursor on the text control to be used for specifically explaining the functions realized by the text control. In this embodiment, the text control may be used to drag the location of the text control to a target location (selected header field) in response to a mouse event in the computer device, such as in response to a mouse drag event.
In an application, when the text control responds to a drag event of a mouse, header data in a target position can be replaced by target header data, and a verification rule that a header field corresponds to each content data in a set of data content fields can be set at the same time, or a field name of each data content field in a set of data content fields corresponding to the header field can be generated, namely, a unique identifier for identifying each data content field is generated, which is not limited.
S402, acquiring a data content field corresponding to the header field selected by the user, and converting the data content field into a second editable field.
In an application, each header field corresponds to a data content field, and header data in the header field is used for describing content data in the data content field. When the target header data is dragged to the header field, the browser also executes a program for converting the data content field into a second editable field. For example, < td > class = "dbclicktd" </td > is added to the code of each data content field in the column to convert the data content field to a second editable field, which is not limiting.
The second editable field can be used for receiving data input by a user, and when the browser fails to analyze the content data in the target file, the user can manually add corresponding data to the webpage form through the second editable field.
S403, verifying the content data in the second editable field.
In the application, after the target header data is dragged to the header field, the browser can also verify each data content field of the corresponding column of the header field by setting a verification rule in the target header data. The verification rule corresponding to the target header data can be preset in the background server, and codes of the verification rule generated by the target language are written into the target header data. When receiving the replacement instruction, the browser can also set the check rule codes in the target header data into the codes of the data content fields respectively. For example, "required=" a "is added between td tags, where" a "is used to represent a check rule of the cell data.
S404, if the content data in the second editable field does not accord with the check rule, marking the second editable field corresponding to the error data, and indicating a user to modify the error data.
In application, the verification rule includes, but is not limited to, common rules such as unique data, number format, necessary filling, data range interval, date format, time range, etc., which are not limited. The second editable field corresponding to the error data may be marked with a preset color, or the error data may be displayed in a bolded manner, which is not limited. For example, in the check rule between td tags, the code after the failure of the check is determined is added with: "border color=rgb (255, 0)", where "border Color" is used to indicate the table Color of the current cell, and "RGB (255, 0)" indicates that the table Color of the current cell is red, which is not limited.
S405, receiving modification data input by a user in the second editable field.
In the application, the modified data is data input when the user modifies the checked error data, and is used for enabling the data in the second editable field to accord with the check rule, and the data is uploaded to the browser to generate the web page form after the error data is not required to be modified under the user line, so that the time for submitting the data is reduced.
In this embodiment, by setting a rule for verifying content data in each data content field in the browser, and prompting the user to modify the error data when the error data is verified, the situation that the data file is submitted to the server, and after the error data is verified by the server, error prompt information is returned to the browser webpage by the server, and then the user modifies the data file under the line and submits again is avoided. The time consumption of data file submission is reduced, and the working efficiency of data file submission is improved.
Referring to fig. 4, in an embodiment, after S401, further includes:
s501, generating a unique identifier for identifying each data content field.
In an application, the unique identification is used to identify the data content field. When the target header data is dragged to the header field, the browser can also execute the unique identification of each data content field of the corresponding column of the header field. It will be appreciated that the above-described step of the browser setting the unique identification of each data content field may be performed simultaneously with the step of setting the verification rules for each content data field. Illustratively, in the code between the td tags, "name=b+ [ C ]", where "name" is a code representing the field name of the current data content field, B is a field name of the current data content field, i.e., a code of the target header data, and C is a C-th row in the data content portion representing the current data content field.
For example, referring to fig. 2, the target header data may be contents of crops, growth period, points, point segments, etc., and the target header data is displayed at the upper end of a web page form of the browser. After the crop is dragged into the first header field of the web page form, the browser replaces one column of data content fields of the crop with the second editable fields, sets the verification rule of each data content field, and can add unique identification to each data content field of one column corresponding to the header data crop in the data content part. For example, to the code of each data content field of the column, a uniquely identified code is added. As "name=crops [1]" is added between the td tags of the first row to identify the current data content field, and "name=crops [2],..the name=crops [ n ]," is added between the td tags of the remaining data content fields of the column in sequence, wherein "crops" is used to represent header data "crop".
S502, establishing an association relation between the unique identification and the content data in the data content field.
In application, the above association is used to identify the location of the content data in the web form. By generating a code of unique identification of each data content field and writing the code into the code of the data content field, namely, adding the code of generating unique identification according to header data and line number into the code between td tags representing each data content field, namely, adding the code of' name=crops [1] between td tags of the first line.
S503, submitting the content data and the unique identification to a server.
In the application, after the web form is uploaded to the background server, the background server analyzes the code of the web form, so that a list of content data corresponding to which header field the content data in the current data content field belongs to can be correspondingly obtained, and the line of the list of content data can be determined. For example, referring to fig. 2, in a column of data content fields corresponding to a crop as target header data, the content data of the first row is 1, after the background server analyzes the code of the web page form, code information of "crops [1] =1" can be correspondingly obtained, and further, the type of "1" is determined to be "crops" according to "crops [1]," the number of rows of data "1" is the first row; or when uploading the web form, the browser can analyze the code of the web form to obtain code information of 'caps [1] =1', and then submit the code information to the background server, and the background server analyzes the code of the web form to obtain the relation between the content data and the unique identifier, and determines the specific position of the content data uploaded to the table of the background server through the unique identifier, which is not limited.
In an embodiment, after S105, further includes:
and if the data verification of the webpage form passes, submitting the webpage form to a server.
In the application, after the browser judges that the content data in the web form accords with the verification rule, the browser submits the web form to the server. The method for transmitting data (POST) in the submitted webpage form mode is an HTTP POST method. HTTP is a hypertext transfer protocol used to ensure communication between a browser and a server in a manner that is a request-response protocol between a client and a server. For example, a client (browser) submits an HTTP request to a server; the server returns a response to the client. The response contains status information about the request and possibly the requested content. The POST is used for submitting data to be processed to the appointed resource, namely, the browser provides the web form for the server in a POST mode, so that the browser can automatically upload the web form to the background server after the data are checked to be in accordance with rules, and the operation steps of a user are reduced.
In an embodiment, the data processing method further includes:
and if the uploading failure message sent by the server is received, marking error data correspondingly according to the uploading failure message.
In the application, after receiving the webpage form uploaded by the browser, the server also checks the data in the webpage form again, and at the moment, the content of the check data of the background server is different from the check rule set by the browser. For example, the user selects to upload the web page form in the browser, however, when the background server checks the data in the web page form, the background server detects that the database has stored the data in the web page form, for example, detects that the data of each cell in a row of cells is continuously acquired when the current web page form is analyzed, and the data of each cell is identical to the data of a continuous row of cells in the database. The failure message is returned to the browser interface, the data of the one row of cells in the current web page form is marked, and then a new instruction whether to newly add the web page form to the database is displayed, or an update instruction for updating the data of the one row of cells in the current web page form to the database is displayed, which is not limited.
And if the uploading progress message sent by the server is received, determining the uploading progress according to the uploading progress message.
In the application, after uploading the web page form to the background server, the background server sequentially reads the content data in the web page form row by row from left to right, and sequentially updates the read data into the database when judging that the content data accords with the verification rule. Because the background server analyzes the content data in the web page form line by line and updates the content data into the database line by line, the browser can acquire the progress of updating the web page form into the database by the server, and the user can determine the uploading progress of the web page form according to the current progress message.
In the application, the uploading progress can be obtained by successfully updating the line number of the content data in the web page form to the database by the background server and obtaining the ratio of the line number of the content data in the web page form to the total line number of the content data in the web page form.
In this embodiment, after the data file is obtained, analysis is performed to obtain the target file and generate the web page form, and by setting a verification rule at the client, the data in the web page form is verified, and when the data verification fails, the data is correspondingly marked in the web page form to prompt the user to modify the error data, so that the verification of the data can be realized at the browser end, the consumed time is effectively reduced, and the processing efficiency is improved.
Referring to fig. 5, an embodiment of the present application further provides a data processing apparatus 100, including:
the acquiring module 10 is configured to acquire a data file.
And the analysis module 20 is used for analyzing the data file to obtain target data and generating a target file according to the target data.
And the generating module 30 is used for generating the web page form according to the target file.
And the verification module 40 is configured to verify the data in the web page form according to a preset verification rule.
And the marking module 50 is used for marking error data in the web page form if the data verification in the web page form fails.
In one embodiment, the web page form includes a header portion and a data content portion, the header portion including at least one header field, each header field corresponding to a list of data content fields; the generating module 30 is further configured to:
the generating the web page list according to the target file comprises the following steps:
analyzing the target file to obtain header data and content data;
writing the header data into a header field of the header portion;
writing the content data into a data content field of the data content portion.
In an embodiment, the generating module 30 is further configured to:
if a new adding instruction is received, adding a new line in the web page form, and converting each data content field of the new adding line into a first editable field;
and writing first data input by a user in the first editable field into a corresponding field of the newly added row, wherein the first data is first row content data in the target file.
In an embodiment, the generating module 30 is further configured to:
receiving a replacement instruction, wherein the replacement instruction is used for replacing header data in a header field selected by a user with target header data;
Acquiring a data content field corresponding to a header field selected by a user, and converting the data content field into a second editable field;
verifying the content data in the second editable field;
if the content data in the second editable field does not accord with the verification rule, marking the second editable field corresponding to the error data and indicating a user to modify the error data;
modification data entered by a user in the second editable field is received.
In an embodiment, the generating module 30 is further configured to:
generating a unique identifier identifying each of said data content fields;
establishing an association relationship between the unique identifier and the content data in the data content field;
submitting the content data and the unique identification to a server.
In one embodiment, the data processing apparatus 100 further comprises:
and the submitting module is used for submitting the webpage form to the server if the data verification of the webpage form passes.
In one embodiment, the data processing apparatus 100 further comprises:
and the first receiving module is used for correspondingly marking error data according to the uploading failure message if the uploading failure message sent by the server is received.
And the second receiving module is used for determining the uploading progress according to the uploading progress message if the uploading progress message sent by the server is received.
Compared with the prior art, the embodiment of the application has the beneficial effects that: after the data file is obtained, the data file is analyzed to obtain a target file concurrent webpage form, and the data in the webpage form is verified by setting a verification rule at the client, and when the data verification fails, the data is correspondingly marked in the webpage form to prompt a user to modify the error data, so that the data can be verified at the browser, the consumed time is effectively reduced, and the processing efficiency is improved.
The embodiment of the application also provides a terminal device, which comprises: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, which when executed by the processor performs the steps of any of the various method embodiments described above.
Embodiments of the present application also provide a computer-readable storage medium storing a computer program which, when executed by a processor, implements the steps of the respective method embodiments described above.
Embodiments of the present application provide a computer program product which, when run on a mobile terminal, causes the mobile terminal to perform steps that may be performed in the various method embodiments described above.
Fig. 6 is a schematic diagram of a terminal device 80 according to an embodiment of the present application. As shown in fig. 6, the terminal device 80 of this embodiment includes: a processor 803, a memory 801 and a computer program 802 stored in said memory 801 and executable on said processor 803. The processor 803, when executing the computer program 802, implements the steps in the various method embodiments described above, such as steps S101 to S105 shown in fig. 1. Alternatively, the processor 803, when executing the computer program 802, performs the functions of the modules/units in the above-described apparatus embodiments.
By way of example, the computer program 802 may be partitioned into one or more modules/units that are stored in the memory 801 and executed by the processor 803 to complete the present application. The one or more modules/units may be a series of computer program instruction segments capable of performing the specified functions, which instruction segments are used to describe the execution of the computer program 802 in the terminal device 80. For example, the computer program 802 may be divided into an acquisition module, an analysis module, a generation module, a verification module, and a marking module, where each module specifically functions as follows:
And the acquisition module is used for acquiring the data file.
And the analysis module is used for analyzing the data file to obtain target data and generating a target file according to the target data.
And the generating module is used for generating a web page form according to the target file.
And the verification module is used for verifying the data in the webpage form according to a preset verification rule.
And the marking module is used for marking error data in the webpage form if the data verification in the webpage form fails.
The terminal device 80 may be a computing device such as a desktop computer, a notebook computer, a palm computer, and a cloud server. The terminal device may include, but is not limited to, a processor 803, a memory 801. It will be appreciated by those skilled in the art that fig. 6 is merely an example of a terminal device 80 and is not intended to limit the terminal device 80, and may include more or fewer components than shown, or may combine certain components, or different components, e.g., the terminal device may further include an input-output device, a network access device, a bus, etc.
The processor 803 may be a central processing unit (Central Processing Unit, CPU), but may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 801 may be an internal storage unit of the terminal device 80, such as a hard disk or a memory of the terminal device 80. The memory 801 may be an external storage device of the terminal device 80, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which are provided on the terminal device 80. In one embodiment, the memory 801 may also include both internal and external storage units of the terminal device 80. The memory 801 is used for storing the computer program and other programs and data required by the terminal device. The memory 801 may also be used to temporarily store data that has been output or is to be output.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the present application implements all or part of the flow of the method of the above embodiments, and may be implemented by a computer program to instruct related hardware, where the computer program may be stored in a computer readable storage medium, where the computer program, when executed by a processor, may implement the steps of each of the method embodiments described above. Wherein the computer program comprises computer program code which may be in source code form, object code form, executable file or some intermediate form etc. The computer readable medium may include at least: any entity or device capable of carrying computer program code to a photographing device/terminal apparatus, recording medium, computer Memory, read-Only Memory (ROM), random access Memory (RAM, random Access Memory), electrical carrier signals, telecommunications signals, and software distribution media. Such as a U-disk, removable hard disk, magnetic or optical disk, etc. In some jurisdictions, computer readable media may not be electrical carrier signals and telecommunications signals in accordance with legislation and patent practice.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and in part, not described or illustrated in any particular embodiment, reference is made to the related descriptions of other embodiments.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
The above embodiments are only for illustrating the technical solution of the present application, and are not limiting; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application, and are intended to be included in the scope of the present application.

Claims (10)

1. A method of data processing, comprising:
Acquiring a data file;
analyzing the data file to obtain target data, and generating a target file according to the target data; the analyzing the data file to obtain target data, and generating the target file according to the target data includes: reading the data file, analyzing to obtain binary data corresponding to the target data, writing the analyzed target data into a programming language, and generating the target file;
generating a web page form according to the target file;
checking the data in the webpage form according to a preset check rule;
if the data in the webpage form fails to be checked, the error data is marked in the webpage form.
2. The data processing method of claim 1, wherein the web page form includes a header portion and a data content portion, the header portion including at least one header field, each of the header fields corresponding to a set of data content fields;
the generating the web page list according to the target file comprises the following steps:
analyzing the target file to obtain header data and content data;
writing the header data into a header field of the header portion;
Writing the content data into a data content field of the data content portion.
3. The data processing method of claim 2, further comprising, after said writing said content data in a data content field of a data content portion:
if a new adding instruction is received, adding a new line in the web page form, and converting each field of the new adding line into a first editable field;
and writing first data input by a user in the first editable field into a corresponding field of the newly added row, wherein the first data is first row content data in the target file.
4. The data processing method of claim 2, further comprising, after said writing said content data in a data content field of a data content portion:
receiving a replacement instruction, wherein the replacement instruction is used for replacing header data in a header field selected by a user with target header data;
acquiring a data content field corresponding to a header field selected by a user, and converting the data content field into a second editable field;
verifying the content data in the second editable field;
If the content data in the second editable field does not accord with the verification rule, marking the second editable field corresponding to the error data and indicating a user to modify the error data;
modification data entered by a user in the second editable field is received.
5. The data processing method of claim 4, wherein after said receiving a replacement instruction for replacing header data in a header field selected by a user with target header data, further comprising:
generating a unique identifier identifying each of the data content fields;
establishing an association relationship between the unique identifier and the content data in the data content field;
submitting the content data and the unique identification to a server.
6. The data processing method of claim 1, further comprising, after said marking erroneous data in said web page form if the data verification in said web page form fails:
and if the data verification of the webpage form passes, submitting the webpage form to a server.
7. The data processing method of claim 6, further comprising:
If the uploading failure message sent by the server is received, marking error data correspondingly according to the uploading failure message;
and if the uploading progress message sent by the server is received, determining the uploading progress according to the uploading progress message.
8. A data processing apparatus, comprising:
the acquisition module is used for acquiring the data file;
the analysis module is used for analyzing the data file to obtain target data and generating a target file according to the target data; the analyzing the data file to obtain target data, and generating the target file according to the target data includes: reading the data file, analyzing to obtain binary data corresponding to the target data, writing the analyzed target data into a programming language, and generating the target file;
the generation module is used for generating a web page form according to the target file;
the verification module is used for verifying the data in the webpage form according to a preset verification rule;
and the marking module is used for marking error data in the webpage form if the data verification in the webpage form fails.
9. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the method according to any of claims 1 to 7 when executing the computer program.
10. A computer readable storage medium storing a computer program, characterized in that the computer program when executed by a processor implements the method according to any one of claims 1 to 7.
CN201911402337.4A 2019-12-30 2019-12-30 Data processing method, device, equipment and storage medium Active CN111222070B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911402337.4A CN111222070B (en) 2019-12-30 2019-12-30 Data processing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911402337.4A CN111222070B (en) 2019-12-30 2019-12-30 Data processing method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111222070A CN111222070A (en) 2020-06-02
CN111222070B true CN111222070B (en) 2023-07-21

Family

ID=70825967

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911402337.4A Active CN111222070B (en) 2019-12-30 2019-12-30 Data processing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111222070B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112035538A (en) * 2020-07-23 2020-12-04 眉山中车制动科技股份有限公司 Test bed data informatization management system and method for truck brake product
CN114070576B (en) * 2020-08-07 2024-03-08 腾讯科技(深圳)有限公司 A content display method a content generation method a device(s) apparatus and storage medium
CN111949746A (en) * 2020-08-18 2020-11-17 北京字节跳动网络技术有限公司 Data processing method and device, electronic equipment and computer readable medium
CN113076285A (en) * 2021-03-05 2021-07-06 上海明略人工智能(集团)有限公司 Processing method and system for uploading data files
CN113158634A (en) * 2021-04-21 2021-07-23 平安国际智慧城市科技股份有限公司 Batch data reporting method, device, equipment and computer readable storage medium
CN113268483A (en) * 2021-05-24 2021-08-17 北京金山云网络技术有限公司 Request processing method and device, electronic equipment and storage medium
CN113901271A (en) * 2021-12-10 2022-01-07 飞狐信息技术(天津)有限公司 Method, device, storage medium and equipment for configuring system based on electronic form

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109471890A (en) * 2018-10-16 2019-03-15 深圳壹账通智能科技有限公司 Generation method, terminal device and the medium of report file
CN110390069A (en) * 2019-07-31 2019-10-29 中国工商银行股份有限公司 The method, apparatus of data check calculates equipment and medium
CN110442816A (en) * 2019-07-12 2019-11-12 平安科技(深圳)有限公司 Web form configuration method, device and computer readable storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104750864A (en) * 2015-04-16 2015-07-01 北京齐尔布莱特科技有限公司 Universal text checking method
CN108595597A (en) * 2018-04-19 2018-09-28 平安科技(深圳)有限公司 Data lead-in method, device, computer equipment and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109471890A (en) * 2018-10-16 2019-03-15 深圳壹账通智能科技有限公司 Generation method, terminal device and the medium of report file
CN110442816A (en) * 2019-07-12 2019-11-12 平安科技(深圳)有限公司 Web form configuration method, device and computer readable storage medium
CN110390069A (en) * 2019-07-31 2019-10-29 中国工商银行股份有限公司 The method, apparatus of data check calculates equipment and medium

Also Published As

Publication number Publication date
CN111222070A (en) 2020-06-02

Similar Documents

Publication Publication Date Title
CN111222070B (en) Data processing method, device, equipment and storage medium
US10613971B1 (en) Autonomous testing of web-based applications
US11792257B2 (en) Form engine
CN110688600A (en) Online editing method, device and equipment based on HTML (Hypertext markup language) page and storage medium
CN104317618B (en) A kind of firmware partition treating method and apparatus
JP2020187733A (en) Application programming interface documentation annotation
CN108628748B (en) Automatic test management method and automatic test management system
CN111858376A (en) Request message generation method and interface test method
CN113505580A (en) Method and device for analyzing table file
CN110457628A (en) Webpage edition correcting method, device, equipment and storage medium
CN111782117B (en) Interface display method and device, storage medium and electronic device
CN113642308B (en) Data import method, system, device and storage medium based on data variability
CN102707958A (en) Open-platform-based interface generation checking method and equipment
CN113283231B (en) Method for acquiring signature bit, setting system, signature system and storage medium
CN108388796B (en) Dynamic domain name verification method, system, computer device and storage medium
CN110457016B (en) Data visualization processing method and device, computer equipment and storage medium
CN116756456A (en) Webpage end word segmentation method and device, storage medium and terminal
CN112433929A (en) Webpage debugging method and device, computer equipment and storage medium
CN115758011A (en) Data unloading method, data display method, device, equipment and storage medium
CN113626392A (en) Method and device for updating document data, electronic equipment and storage medium
CN114661745A (en) Recruitment information publishing method and device based on RPA and AI
US11281901B2 (en) Document extraction system and method
CN110018766B (en) Webpage form filling method and device
CN113971251A (en) Webpage output method, system and computer readable storage medium
CN114548079B (en) Text display method and device and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant