Data entry method, user terminal, backend server and storage medium
By regularly comparing and updating the questionnaire answer data on the user terminal, and using Ajax technology to send the data to the backend server, the problem of data loss caused by users accidentally closing the browser during market research is solved, ensuring the integrity and reliability of the data.
Patent Information
- Application Number
- CN201910018203.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-01-04
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2039-01-04
AI Technical Summary
During market research, users accidentally closed the browser during the process of filling out the questionnaire, resulting in data loss, and the data demander lost the valuable data.
Real-time answer data and historical answer data are regularly obtained and compared on the user terminal. If they are inconsistent, Ajax technology is used to send a data update request to the backend server to ensure real-time update and preservation of the data.
It effectively avoids data loss caused by accidental operations by users, ensures the integrity and reliability of questionnaire answer data, and realizes regular updating and saving of data.
Smart Images

Figure CN109840803B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a data entry method, a user terminal, a backend server and a storage medium. Background Art
[0002] Market research refers to the process of planning, collecting and analyzing data related to marketing decisions and using the results of the analysis for marketing decisions. The basic task of market research is to provide management with information sufficient to solve marketing problems. Market research is also a key management tool for determining customers and needs, and is a means for companies to establish long-term relationships. Currently, most research methods are that after the user fills out the survey questionnaire and clicks the submit button, the browser transmits the data back to the server. If the user accidentally closes the browser midway, the data that the user has filled in will be lost, and the user will not be able to complete the questionnaire on the original basis. At the same time, the data demander will also lose data that is valuable to use. Summary of the invention
[0003] The main purpose of the present invention is to provide a data entry method, a user terminal, a backend server and a storage medium, aiming to achieve regular updating of questionnaire answer data and avoid data loss caused by accidental user operations.
[0004] To achieve the above object, the present invention provides a data entry method, which is applied to a user terminal and includes:
[0005] Periodically obtaining real-time answer data entered by a user in a data entry area of a data entry page, and obtaining first historical answer data corresponding to the data entry area stored in a preset position;
[0006] Comparing the real-time answer data with the first historical answer data to determine whether the real-time answer data is consistent with the first historical answer data;
[0007] If the real-time answer data is inconsistent with the first historical answer data, a data update request is sent to the backend server by creating a fast dynamic web page technology through Ajax based on the real-time answer data, so that the backend server updates the data based on the data update request.
[0008] Optionally, before the step of creating a fast dynamic web page technology based on the real-time answer data through Ajax and sending a data update request to the backend server, the step includes:
[0009] Verifying the real-time answer data based on preset data legitimacy verification rules;
[0010] If the real-time answer data passes the verification, the following steps are executed: based on the real-time answer data, a fast dynamic web page technology is created through Ajax to send a data update request to the backend server, so that the backend server updates the data based on the data update request.
[0011] Optionally, the step of verifying the real-time answer data based on preset data legitimacy verification rules includes:
[0012] Performing character count on the real-time answer data to determine the character count of the real-time answer data;
[0013] Comparing the character count with a preset character count threshold to determine whether the character count is less than or equal to the preset character count threshold;
[0014] If yes, determining the character type of the real-time answer data, and determining whether the character type matches a preset character type;
[0015] If so, it is determined that the real-time answer data verification has passed.
[0016] Optionally, the step of verifying the real-time answer data based on preset data legitimacy verification rules includes:
[0017] Comparing the answer data with a preset regular expression to determine whether the answer data matches the preset regular expression;
[0018] If so, it is determined that the real-time answer data verification has passed.
[0019] Optionally, the step of creating a fast dynamic web page technology based on the real-time answer data through Ajax and sending a data update request to the backend server includes:
[0020] The real-time answer data, or the return data from the large backend server received based on Ajax, is used to replace the first historical answer data as new first historical answer data.
[0021] In addition, to achieve the above-mentioned purpose, the present invention further discloses a data entry method, wherein the data entry method is applied to a background server, and the data entry method comprises:
[0022] Receiving a data update request sent by a user terminal, and obtaining answer data to be updated and a first data entry area identifier corresponding to the answer data to be updated from the data update request;
[0023] Determine a second data entry area identifier in a preset database that is consistent with the first data entry area identifier, and obtain second historical answer data corresponding to the second data entry area identifier from the preset database;
[0024] Comparing the answer data to be updated with the second historical answer data to determine whether the two are consistent;
[0025] If not, the answer data to be updated will replace the second historical answer data as new second historical answer data.
[0026] Optionally, after the step of replacing the second historical answer data with the answer data to be updated as the new second historical answer data, the step further includes:
[0027] The return data is sent to the user terminal based on the new second historical answer data, so that the user terminal updates the historical answer data.
[0028] In addition, to achieve the above-mentioned purpose, the present invention also provides a user terminal, wherein the user terminal includes a processor, a memory, and a data entry program stored in the memory and executable by the processor, wherein when the data entry program is executed by the processor, the steps of the above-mentioned data entry method are implemented.
[0029] In addition, to achieve the above-mentioned purpose, the present invention also provides a background server, wherein the background server includes a processor, a memory, and a data entry program stored on the memory and executable by the processor, wherein when the data entry program is executed by the processor, the steps of the above-mentioned data entry method are implemented.
[0030] In addition, to achieve the above-mentioned purpose, the present invention also provides a storage medium, wherein a data entry program is stored on the storage medium, and when the data entry program is executed by the processor, the steps of the above-mentioned data entry method are implemented.
[0031] The present invention provides a data entry method, a user terminal, a backend server and a storage medium. The data entry method is applied to the user terminal, and the data entry method includes: regularly obtaining the input answer data entered by the user in each data entry area of the data entry page; performing data verification on the answer data, wherein the data verification method at least includes comparing the real-time answer data with the first historical answer data to determine whether the real-time answer data is consistent with the first historical answer data; if inconsistent, based on the answer data inconsistent with the first historical answer data, a data update request is sent to the backend server through Ajax to create a fast dynamic web page technology, so that the backend server performs data update based on the data update request. Through the above method, it can be achieved that during the process of the user entering the answer data, the user terminal regularly obtains the answer data entered by the user, and determines the answer data modified by the user by comparing it with the pre-stored historical answer data, that is, the answer data inconsistent with the pre-stored historical answer data, and sends a data update request to the backend server through the Ajax technology, so that the backend server performs data update, thereby achieving the timed update of the questionnaire answer data and avoiding data loss caused by the user's accidental operation. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 A schematic diagram of the hardware structure of a data entry device involved in an embodiment of the present invention;
[0033] Figure 2 It is a flowchart of the first embodiment of the data entry method of the present invention;
[0034] Figure 3 It is a flow chart of the second embodiment of the data entry method of the present invention;
[0035] Figure 4 It is a flowchart of a third embodiment of the data entry method of the present invention;
[0036] Figure 5 It is a flowchart of a fourth embodiment of the data entry method of the present invention;
[0037] Figure 6 It is a flowchart of a fifth embodiment of the data entry method of the present invention;
[0038] Figure 7 It is a flowchart of a sixth embodiment of the data entry method of the present invention;
[0039] Figure 8 Schematic diagram of the flow chart of the seventh embodiment of the data entry method of the present invention.
[0040] 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
[0041] 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.
[0042] The data entry method involved in the embodiment of the present invention is mainly applied to a data entry device, which may be a device with data processing function such as a personal computer (PC), a portable computer, or a mobile terminal.
[0043] Reference Figure 1 , Figure 1 Schematic diagram of the hardware structure of the data entry device involved in the embodiment of the present invention. In the embodiment of the present invention, the data entry device may include a processor 1001 (e.g., a central processing unit, CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components; the user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard); the network interface 1004 may optionally include a standard wired interface, a wireless interface (such as wireless fidelity WIreless-FIdelity, WI-FI interface); the memory 1005 may be a high-speed random access memory (random access memory, RAM), or a stable memory (non-volatile memory), such as a disk storage, and the memory 1005 may optionally be a storage device independent of the aforementioned processor 1001. Those skilled in the art will understand that Figure 1 The hardware structure shown in the figure does not constitute a limitation of the present invention, and may include more or less components than those shown in the figure, or combine certain components, or arrange the components differently.
[0044] Continue to refer to Figure 1 , Figure 1 The memory 1005 as a storage medium may include an operating system, a network communication module, and a data entry program. Figure 1 In the embodiment, the network communication module can be used to connect to the server and perform data communication with the server; and the processor 1001 can call the data entry program stored in the memory 1005 and execute the data entry method provided in the embodiment of the present invention.
[0045] An embodiment of the present invention provides a data entry method.
[0046] Reference Figure 2 , Figure 2 It is a flowchart of the first embodiment of the data entry method of the present invention.
[0047] This embodiment can be applied to various technical fields with market research needs, such as the financial field. Market research refers to the process of planning, collecting and analyzing data related to marketing decisions and using the analysis results for marketing decisions. The basic task of market research is to provide management with information sufficient to solve marketing problems. Market research is also a key management tool for determining customers and needs, and is a means for enterprises to establish long-term relationships. At present, most research methods are methods in which the browser transmits the data back to the server after the user fills out the survey questionnaire and clicks the submit button. If the user accidentally closes the browser halfway, the data that the user has filled in will be lost, and the user cannot complete the questionnaire on the original basis. At the same time, the data demander also loses data with utilization value. This embodiment provides a data entry method, which is applied to a user terminal. The user can log in to the corresponding web page through a preset application or browser through the user terminal to enter the answer page of the questionnaire, and pre-install a plug-in based on the data entry method of this embodiment on the corresponding application or browser, and process the data entered by the user on the questionnaire page based on the plug-in. Specifically, the implementation process of this embodiment includes the following steps:
[0048] Step S10, periodically obtaining real-time answer data entered by the user in the data entry area of the data entry page, and obtaining first historical answer data corresponding to the data entry area stored in a preset position;
[0049] In this embodiment, the data entry area refers to the area for entering answer data set for each survey question on the questionnaire. The user can enter the answer data of each question into the corresponding data entry area by manually editing the text content, selecting the corresponding option from the preset options, or selecting the corresponding option from the drop-down list. A function for obtaining answer data at a fixed time can be pre-set, and the function checks and obtains the real-time answer data of each data entry area in the questionnaire page at a fixed time. The real-time answer data refers to the answer data entered by the user in the data entry area based on the corresponding survey question, which is obtained in real time each time step S10 is executed. The first historical answer data of this embodiment refers to the latest answer data entered by the user in the same data entry area before the final submission of the questionnaire data, which is stored in a preset position on the user terminal when step S10 is executed. After receiving the start questionnaire survey triggered by the user, before receiving the questionnaire triggered by the user, the first historical answer data can be updated based on the comparison verification result or the return data of the backend server. Specifically, the question of the questionnaire may include "user occupation". For this question, the user can enter the answer data "teacher" in the corresponding answer data entry area. The time interval for executing the timing in this embodiment can be set based on actual needs. For example, it can be set to execute the steps of this embodiment every 2 seconds.
[0050] Step S20, comparing the real-time answer data with the first historical answer data to determine whether the real-time answer data is consistent with the first historical answer data;
[0051] Based on step S10, after obtaining the answer data entered by the user in the data entry area, the obtained answer data is verified. The method for data verification in this embodiment at least includes comparing and verifying the obtained answer data with the historical answer data pre-stored on the user terminal, and judging whether the answer data in each data entry area is consistent with the corresponding pre-stored historical answer data. In this embodiment, the answer data in each data entry area can be stored in a preset storage location, such as a Javascript object, and the answer data can be associated with the corresponding questionnaire identification, question identification or data entry area identification or user identification and other information, and the preset storage location can correspond to each on the questionnaire interface. In this embodiment, the first historical answer data corresponding to the same question as the currently obtained answer data can be determined based on the above identification information, and the obtained answer data can be compared with the corresponding first historical answer data to judge whether the two are consistent. If they are consistent, it is determined that the user has not modified the answer data of the corresponding question, and there is no need to perform related operations for data update. If the two are inconsistent, it can be determined that the user has modified the answer data of the corresponding question, and the answer data can be checked for legitimacy, or the obtained answer data can be checked for legitimacy before being compared with the historical answer data. When the legitimacy check passes and it is determined that the answer data in the same data entry area is inconsistent with the historical answer data, the answer data is sent to the backend server for updating; it is also possible not to check the legitimacy of the answer data, and when it is determined that the answer data is inconsistent with the historical answer data, the answer data is directly sent to the backend server for updating.
[0052] Further, in this embodiment, the preset legality verification rules and corresponding preset legality verification conditions for legality verification can be set in advance based on the format of the required input data in the data entry area. When the answer data in the data entry area is obtained, the answer data is verified with the corresponding preset legality verification rules to determine whether the answer data meets the corresponding preset legality verification conditions. Specifically, the preset legality verification rules of this embodiment may include preset character or field verification rules, and the corresponding preset legality verification conditions are preset character or field verification conditions. Specifically, the data verification rules can be set in advance based on the characteristics of the required answer data. The preset character or field verification rules can be rules that limit the answer data to data of a specific character type, or rules that limit the answer data to not be data of a specific character type. For example, for the input area where digital data needs to be entered, a preset verification rule can be set to determine whether the entered answer data is digital type data. The corresponding preset character or field verification condition is: the answer data entered in the corresponding data entry area is a complete digital type answer data, and there is no text or other special character type data. The preset character or field rule can also be a rule for limiting the length of the answer data field. For example, for a specific data entry area, the length of the answer data can be limited to the preset field length. Specifically, the number of characters or words in the answer data can be limited.
[0053] Furthermore, for data that needs to be entered in a specific format, such as dates, or other data selected and entered through a drop-down box, a regular expression for data verification, as well as corresponding regular expression verification rules and regular expression verification conditions can also be pre-set. First, a regular expression for the drop-down box transmission value is set based on actual needs, and then the string entered by the user in the drop-down box is compared with the pre-set regular expression to determine whether the input string matches the regular expression. If they match, it is determined that the answer data of the drop-down box meets the preset regular expression verification conditions; if they do not match, it is determined that the answer data of the drop-down box does not meet the preset regular expression verification conditions.
[0054] Step S30: If the real-time answer data is inconsistent with the first historical answer data, a data update request is sent to the backend server through Ajax to create a fast dynamic web page technology based on the real-time answer data, so that the backend server updates the data based on the data update request.
[0055] Based on step S20, if the answer data obtained is inconsistent with the first answer data stored in advance, a data update request is sent to the backend server through Ajax to create a fast dynamic web page technology based on the answer data inconsistent with the first historical answer data, so that the backend server updates the data based on the data update request. Ajax, namely Asynchronous Javascript And XML, refers to a web page development technology for creating interactive web page applications, which can update part of the web page without reloading the entire web page. By exchanging a small amount of data with the server in the background, Ajax can enable the web page to be updated asynchronously. This means that a part of the web page can be updated without reloading the entire web page. Specifically, if the answer data currently obtained for the question "user occupation" is "teacher", and the first historical answer data stored in advance is "waiter", then a data update request for updating the answer to the question "user occupation" to "teacher" can be generated based on the question "user occupation" and the corresponding answer data "teacher", and sent to the backend server through asynchronous transmission, so that the backend server updates the answer data corresponding to the question "user occupation" to "teacher", completing the data update of the backend server.
[0056] Furthermore, if a data validity check is performed, for answer data that does not meet the preset data validity check conditions, a data request may not be sent to the backend server, but a prompt message indicating that the data verification is incorrect may be directly displayed on the data entry interface of the questionnaire; for answer data that meets the preset data validity check conditions and is inconsistent with the corresponding first historical answer data, a data update request is sent to the backend server through Ajax to create a fast dynamic web page technology, so that the backend server updates the data based on the data update request.
[0057] In this embodiment, the real-time answer data entered by the user in the data entry area of the data entry page is obtained periodically, and the first historical answer data corresponding to the data entry area stored in the preset position is obtained; the real-time answer data is compared with the first historical answer data to determine whether the real-time answer data is consistent with the first historical answer data; if the real-time answer data is inconsistent with the first historical answer data, a data update request is sent to the background server based on the real-time answer data through Ajax to create a fast dynamic web page technology, so that the background server updates the data based on the data update request. Through the above method, it can be achieved that during the process of the user entering the answer data, the user terminal periodically obtains the answer data entered by the user, and determines the answer data modified by the user by comparing it with the pre-stored historical answer data, that is, the answer data inconsistent with the pre-stored historical answer data, and sends a data update request to the background server through Ajax technology, so that the background server updates the data, thereby achieving the timed update of the questionnaire answer data and avoiding data loss caused by the user's accidental operation.
[0058] Reference Figure 3 , Figure 3 Schematic diagram of the flow chart of the second embodiment of the data entry method of the present invention.
[0059] Based on the above embodiment, in this embodiment, before the step of creating a fast dynamic web page technology based on the real-time answer data through Ajax and sending a data update request to the backend server, the following steps are included:
[0060] Step S40, verifying the real-time answer data based on preset data legitimacy verification rules;
[0061] In this embodiment, the preset legality verification rules and corresponding preset legality verification conditions for legality verification can be set in advance based on the format of the required input data in the data entry area. When it is determined that the obtained real-time answer data is inconsistent with the corresponding first historical data, the real-time answer data is verified with the corresponding preset legality verification rules to determine whether the answer data meets the corresponding preset legality verification conditions. Specifically, the preset legality verification rules of this embodiment may include preset character or field verification rules, and the corresponding preset legality verification conditions are preset character or field verification conditions. Specifically, the data verification rules can be set in advance based on the characteristics of the required answer data. The preset character or field verification rules can be rules that limit the answer data to data of a specific character type, or rules that limit the answer data to not be data of a specific character type. For example, for the input area where digital data needs to be entered, a preset verification rule can be set to determine whether the entered answer data is digital type data. The corresponding preset character or field verification condition is: the answer data entered in the corresponding data entry area is a complete digital type answer data, and there is no text or other special character type data. The preset character or field rule can also be a rule for limiting the length of the answer data field. For example, for a specific data entry area, the length of the answer data can be limited to the preset field length. Specifically, the number of characters or words in the answer data can be limited.
[0062] Furthermore, for data that needs to be entered in a specific format, such as dates, or other data selected and entered through a drop-down box, a regular expression for data verification, as well as corresponding regular expression verification rules and regular expression verification conditions can also be pre-set. First, a regular expression for the drop-down box transmission value is set based on actual needs, and then the string entered by the user in the drop-down box is compared with the pre-set regular expression to determine whether the input string matches the regular expression. If they match, it is determined that the answer data of the drop-down box meets the preset regular expression verification conditions; if they do not match, it is determined that the answer data of the drop-down box does not meet the preset regular expression verification conditions.
[0063] Step S50, if the real-time answer data verification passes, then execute the step: based on the real-time answer data, create a fast dynamic web page technology through Ajax to send a data update request to the background server, so that the background server updates the data based on the data update request.
[0064] Based on step S40, for real-time answer data that does not meet the preset data legitimacy verification conditions, it is not necessary to send a data request to the backend server, but a prompt message of data verification error is directly displayed on the data entry interface of the questionnaire; for answer data that meets the preset data legitimacy verification conditions and is inconsistent with the corresponding first historical answer data, a data update request is sent to the backend server through Ajax to create a fast dynamic web page technology, so that the backend server updates the data based on the data update request.
[0065] In this embodiment, the real-time answer data is verified based on the preset data legality verification rules; if the real-time answer data passes the verification, the step of sending a data update request to the backend server through Ajax to create a fast dynamic web page technology based on the real-time answer data, so that the backend server updates the data based on the data update request. In the above manner, the answer data is standardized based on the preset legality verification rules, and the standardized answer data is obtained for further analysis of the answer data.
[0066] Further, Figure 4 Schematic diagram of the flow chart of the third embodiment of the data entry method of the present invention.
[0067] Based on the above embodiment, in this embodiment, the step of verifying the real-time answer data based on the preset data legitimacy verification rule includes:
[0068] Step S60, performing character count on the real-time answer data to determine the character count of the real-time answer data;
[0069] Based on the above embodiments, in this embodiment, in this embodiment, when it is determined that the obtained real-time answer data is inconsistent with the corresponding first historical answer data, the number of characters in the real-time answer data can be counted first to determine the number of characters in the real-time answer data, that is, the character statistics number of the real-time answer data.
[0070] Step S70, comparing the character statistics with a preset character quantity threshold, and determining whether the character statistics is less than or equal to the preset character quantity threshold;
[0071] In this embodiment, the preset character quantity threshold refers to the preset required field length, that is, the number of characters, which is used to limit the number of characters of the answer data input by the user. When the number of characters of the answer data input by the user is less than or equal to the preset character quantity threshold, the answer data is determined to meet the character quantity requirement; when the answer data input by the user is greater than or equal to the preset character answer quantity threshold, the answer data is determined to be illegal. Based on step S60, after determining the character statistics of the real-time answer data, the statistical number of the real-time answer data is compared with the preset character quantity threshold to determine whether the character statistics is less than or equal to the preset character quantity threshold. In this embodiment, for the data entry area of the answer data of different questions, different preset character quantity thresholds can be set based on the actual situation of the question.
[0072] Step S80, if yes, determining the character type of the real-time answer data, and determining whether the character type matches a preset character type;
[0073] Based on step S70, if it is determined that the real-time answer data meets the character quantity requirement, the current character type is determined, wherein the character type may include a digital character type, an alphabetic character type, a Chinese character type, or a special character type such as a Greek letter. The character type of the real-time answer data may include one or more, and when executing step S80, all the character types included in the real-time answer data are determined. In this embodiment, for the data entry areas of different questions, different preset character types can be set based on the actual situation of the question, and each data entry area can include one or more preset character types. When obtaining the character type of the real-time answer data, the character type of the real-time answer data is compared with the preset character type to determine whether the character type of the answer data matches the preset character type. Specifically, if the preset character type includes all the character types of the real-time answer data, it can be determined that the character type of the answer data in the data entry area matches the preset character type. If the character type of the real-time answer data includes a character type that is not included in the preset character type, it can be determined that the character type of the real-time answer data does not match the preset character type. In this embodiment, if it is determined in step S70 that the real-time answer data is illegal, a prompt message that the answer data does not meet the character quantity requirement can be directly displayed without executing step S80.
[0074] Step S90: If yes, it is determined that the real-time answer data verification has passed.
[0075] Based on step S80, if the character type of the real-time answer data does not match the preset character type, it can be determined that the real-time answer data does not pass, and based on the data entry method of the above embodiment, the steps are executed: based on the real-time answer data, a data update request is sent to the backend server through Ajax to create a fast dynamic web page technology, so that the backend server performs data update based on the data update request. If the character type of the real-time answer data does not match the preset character type, it is determined that the real-time answer data does not meet the character type requirements, the data verification fails, and a prompt message indicating that the data verification fails is displayed.
[0076] In this embodiment, the number of characters in the real-time answer data is counted to determine the number of characters in the real-time answer data; the number of characters in the real-time answer data is compared with a preset character number threshold to determine whether the number of characters in the real-time answer data is less than or equal to the preset character number threshold; if so, the character type of the real-time answer data is determined, and it is determined whether the character type matches the preset character type; if so, it is determined that the real-time answer data has passed the verification. In the above manner, data verification based on the preset character number threshold and the preset character type is achieved, and data is standardized.
[0077] Further, Figure 5 Schematic diagram of the flow chart of the fourth embodiment of the data entry method of the present invention.
[0078] Based on the above embodiment, in this embodiment, the step of verifying the real-time answer data based on the preset data legitimacy verification rule includes:
[0079] Step S100, comparing the answer data with a preset regular expression to determine whether the answer data matches the preset regular expression;
[0080] Based on the above embodiments, in this embodiment, the preset legality verification rules include preset regular expression verification rules, wherein the preset regular expression verification rules refer to setting a corresponding regular expression for the data entry area with format requirements based on the format requirements of the data entry area, that is, a preset regular expression, and setting a preset regular expression verification rule based on the preset regular expression to determine whether the entered answer data matches the preset regular expression. If the answer data matches the preset regular expression, it is determined that the answer data meets the preset regular expression verification condition; if the answer data does not match the preset regular expression, it is determined that the answer data does not meet the preset regular expression verification condition. For data that needs to be entered in a specific format, such as a date, or other data selected and entered through a drop-down box, a regular expression for data verification, as well as the corresponding regular expression verification rule and its regular expression verification condition can also be pre-set. First, set the regular expression for the drop-down box transmission value based on actual needs, and then compare the string entered by the user in the drop-down box with the pre-set regular expression to determine whether the input string matches the regular expression. If they match, it is determined that the answer data in the drop-down box meets the preset regular expression verification conditions; if they do not match, it is determined that the answer data in the drop-down box does not meet the preset regular expression verification conditions.
[0081] Step S110: If yes, it is determined that the real-time answer data verification has passed.
[0082] Based on step S80, for answer data that does not meet the preset regular expression verification conditions, a data request may not be sent to the backend server, but a prompt message indicating that the data verification is incorrect may be directly displayed on the data entry interface of the questionnaire; for answer data that meets the preset regular expression verification conditions and is inconsistent with the corresponding first historical answer data, a data update request is sent to the backend server through Ajax to create a fast dynamic web page technology, so that the backend server updates the data based on the data update request.
[0083] Further, Figure 6 It is a flowchart of the fifth embodiment of the data entry method of the present invention.
[0084] Based on the above embodiment, in this embodiment, the following steps are included after step S30:
[0085] Step S120, the real-time answer data, or the return data from the large backend server received based on Ajax, is used to replace the first historical answer data as new first historical answer data.
[0086] Based on the above embodiments, in this embodiment, when the user terminal determines that the current answer data of a specific data entry area is inconsistent with the first historical answer data stored in the user terminal, since the first historical answer data stored in the user terminal is consistent with the answer data stored in the background server, if the current answer data is inconsistent with the historical answer data of the user terminal, then the current answer data is also inconsistent with the answer data in the background server. In this case, the currently obtained answer data can replace the corresponding historical answer data in the user terminal to implement an update of the answer data of the user terminal, so that the corresponding new first historical answer data after replacement is consistent with the corresponding updated answer data on the background server. Furthermore, after the user terminal sends the answer data to the backend service based on Ajax technology, the backend server performs data verification on the received answer data based on its own verification rules. If the data verification passes, the stored answer data is updated with the received answer data, and after the update is completed, the updated answer data, i.e., return data, and update completion information are sent to the user terminal based on Ajax technology, so that the user terminal replaces and updates the corresponding answer data stored in itself after receiving the data update completion information sent by the backend server; if the data verification of the backend server fails, the backend server does not update the answer data stored in itself, and sends a prompt message to the user terminal indicating that the data verification fails and the data has not been updated. The user terminal displays the corresponding prompt message and does not update the answer data stored in itself.
[0087] In this embodiment, answer data inconsistent with the first historical answer data, or return data received from the backend server based on Ajax, will replace the corresponding first historical answer data as new first historical answer data. Through the above method, when the current answer data is inconsistent with the first historical answer data pre-stored in the user terminal, the corresponding first historical answer data in the user terminal is updated based on the current data or the return data from the backend server received based on the Ajax technology, and the comparison and verification is continued based on the updated new first answer data. Among them, replacing the corresponding first historical answer data with the return data from the backend server received based on Ajax can ensure that the first historical answer data in the user terminal is updated after the backend server completes the data update, which more reliably ensures that the user terminal is consistent with the corresponding answer data in the backend server.
[0088] Further, Figure 7 A flow chart of the sixth embodiment of the data entry method of the present invention.
[0089] Based on the above embodiment, in this embodiment, the data entry method is applied to a backend server, and the data entry method includes:
[0090] Step S130, receiving a data update request sent by a user terminal, and obtaining answer data to be updated and a first data entry area identifier corresponding to the answer data to be updated from the data update request;
[0091] Based on the above embodiment, in this embodiment, when the user terminal determines that the obtained answer data is inconsistent with the corresponding first historical answer data, it can directly send a data update request to the background server based on the answer data inconsistent with the first historical answer data and the identifier of the data entry area of the answer data (i.e., the first data entry area identifier) through Ajax to create a fast dynamic web page technology. Further, if the data legitimacy verification is performed, for the answer data that does not meet the preset data legitimacy verification conditions, it is not necessary to send a data request to the background server, but directly display a prompt message that the data verification is incorrect on the data entry interface of the questionnaire; for the answer data that meets the preset data legitimacy verification conditions and is inconsistent with the corresponding first historical answer data, a data update request is sent to the background server through Ajax to create a fast dynamic web page technology. Based on the above embodiment, in this embodiment, the background server first receives the data update request sent by the user terminal, and obtains the answer data to be updated and the first data entry area identifier corresponding to the answer data from the data update request. In this embodiment, the first data entry identifier can be uniquely determined based on the questionnaire identifier, the questionnaire title identifier, and the user identifier. The user identifier may include the user terminal identifier, such as the hardware address information of the user terminal.
[0092] Step S140, determining a second data entry area identifier in a preset database that is consistent with the first data entry area identifier, and acquiring second historical answer data corresponding to the second data entry area identifier from the preset database;
[0093] The preset database in this embodiment refers to a database in the backend server, or outside the backend server connected to the backend server, used to store the answer data of the questionnaire. The backend server stores or updates the answer data entered by the user based on the data update request sent by each user terminal, and identifies the second data entry area of the answer data of each user and its corresponding data in the preset database. The second data entry area identification of this embodiment refers to the identification of the entry area of each answer data set in the backend server. In this embodiment, the setting method of the first data entry area identification and the corresponding second data entry area can be set using the same setting method, and the data entry area identification of the data of a specific user for a specific question in a specific questionnaire is consistent. In this embodiment, the backend server first stores the questionnaire data. When receiving the request information for accepting the questionnaire survey sent by a specific user terminal, the backend server obtains the identification information of the user terminal, the identification information of the survey questionnaire selected by the user, and the title identification information of each question in the questionnaire. Based on the identification of the user terminal, the survey questionnaire identification, and the title identification, multiple data entry area identifications, namely, second data entry area identifications, are generated, and corresponding data storage spaces are configured for each second data entry area identification to store the answer data sent by the corresponding user terminal. The second data entry area identification is associated with the corresponding data storage space. When the data to be updated and the first data entry area identification are obtained, the obtained first data entry area identification is compared with the pre-stored second data entry area identification, and the second data entry area identification in the backend server that is consistent with the obtained first data entry area identification is determined, and the answer data stored in the storage space corresponding to the second data entry area identification, namely, the second historical answer data, is obtained.
[0094] Step S150, comparing the answer data to be updated with the second historical answer data to determine whether the two are consistent;
[0095] Based on step S120, after obtaining the second historical answer data, the obtained second historical answer data is compared with the obtained answer data to be updated to determine whether the two are consistent.
[0096] Step S160: If not, the answer data to be updated replaces the second historical answer data as new second historical answer data.
[0097] Based on step S120, if the second historical answer data is consistent with the answer data to be updated, it is determined that the answer data to be updated in the data update request of the user terminal has not changed compared with the second historical answer data stored in the background server, and no response is required to the data update request. If the second historical answer data is inconsistent with the answer data to be updated, it is determined that the answer data to be updated in the data update request sent by the user terminal has changed compared with the second historical answer data in the background server, and the second historical answer data can be deleted from the corresponding data storage space, and the answer data to be updated can be stored in the data storage space, so as to replace the corresponding second historical answer data with the answer data to be updated, and use the answer data to be updated as the new second historical answer data.
[0098] In this embodiment, a data update request sent by a user terminal is received, and the answer data to be updated and the first data entry area identifier corresponding to the answer data to be updated are obtained from the data update request; a second data entry area identifier consistent with the first data entry area identifier in a preset database is determined, and the second historical answer data corresponding to the second data entry area identifier is obtained from the preset database; the answer data to be updated is compared with the second historical answer data to determine whether the two are consistent; if not, the answer data to be updated replaces the second historical answer data as the new second historical answer data. In the above manner, the background server performs data verification based on the received data update request, and updates the data stored in itself when the answer data changes, to ensure the reliability of the data.
[0099] Further, Figure 8 It is a flowchart of the seventh embodiment of the data entry method of the present invention.
[0100] Based on the above embodiment, in this embodiment, the following steps are included after step S160:
[0101] Step S170: sending return data to the user terminal based on the new second historical answer data, so that the user terminal updates the historical answer data.
[0102] This embodiment is also applied to the backend server, based on the sixth embodiment of the data entry method of the present invention. In this embodiment, after the answer data to be updated replaces the corresponding second historical answer data to obtain new second historical answer data, return data is sent to the user terminal based on the new second historical answer data or the corresponding answer data to be updated, so that the user terminal updates the pre-stored answer data of the corresponding data entry area identifier in the historical answer data stored in itself. In this embodiment, after the second historical answer data is updated, the updated second historical answer data and its corresponding data entry area identifier can be directly sent to the user terminal as return data. When the user terminal receives the return data sent by the backend server, it extracts the data entry area identifier in the return data, determines the answer data to be replaced in the user terminal based on the data entry area identifier, deletes the answer data to be replaced, and stores the answer data extracted from the return data in the storage location of the original answer data to be replaced. If the backend server does not update the data stored in the preset database based on the data update request after receiving the data update request from the user terminal, it can directly ignore the data request and not send any return data to the user terminal. Under this setting, if the user terminal does not receive the return data sent by the backend server within the preset time, the updated answer data will be discarded directly, and no update will be made to the first historical answer data stored in the user terminal itself.
[0103] In this embodiment, return data is sent to the user terminal based on the new second historical answer data, so that the user terminal updates the historical answer data. Through the above method, after the background server updates the data, the user terminal updates its own historical answer data according to the return data sent by the background server based on the updated answer data, ensuring that the answer data stored in the user terminal is consistent with the corresponding answer data in the background server, avoiding the situation where the user terminal actively updates its own answer data when the background server has not updated the data, resulting in inconsistency between the user terminal data and the background server data.
[0104] In addition, an embodiment of the present invention further provides a storage medium.
[0105] The storage medium of the present invention stores a data entry program, wherein when the data entry program is executed by a processor, the steps of the above-mentioned data entry method are implemented.
[0106] Among them, the method implemented when the data entry program is executed can refer to the various embodiments of the data entry method of the present invention, and will not be repeated here.
[0107] It should 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 system 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 system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0108] 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.
[0109] 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 storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present invention.
[0110] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A data entry method, It is characterized in that The data entry method is applied to a user terminal, and the data entry method comprises: Periodically obtaining real-time answer data entered by a user in a data entry area of a data entry page, and obtaining first historical answer data corresponding to the data entry area stored in a preset position; Comparing the real-time answer data with the first historical answer data to determine whether the real-time answer data is consistent with the first historical answer data; If the real-time answer data is inconsistent with the first historical answer data, a data update request is sent to the backend server by creating a fast dynamic web page technology through Ajax based on the real-time answer data, so that the backend server performs data update based on the data update request; The step of creating a fast dynamic web page technology based on the real-time answer data through Ajax and sending a data update request to the backend server includes: Performing character count on the real-time answer data to determine the character count of the real-time answer data; Comparing the character count with a preset character count threshold to determine whether the character count is less than or equal to the preset character count threshold; If the character count is less than or equal to a preset character count threshold, determining a character type of the real-time answer data, and determining whether the character type matches a preset character type; If the character type matches the preset character type, the real-time answer data is compared with the preset regular expression to determine whether the real-time answer data matches the preset regular expression; If the real-time answer data matches the preset regular expression, it is determined that the real-time answer data verification has passed, and the following steps are executed: based on the real-time answer data, a fast dynamic web page technology is created through Ajax to send a data update request to the background server, so that the background server updates the data based on the data update request.
2. The data entry method according to claim 1, It is characterized in that The step of creating a fast dynamic web page technology based on the real-time answer data through Ajax and sending a data update request to the backend server includes: Verifying the real-time answer data based on preset data legitimacy verification rules; If the real-time answer data passes the verification, the following steps are executed: based on the real-time answer data, a fast dynamic web page technology is created through Ajax to send a data update request to the backend server, so that the backend server updates the data based on the data update request.
3. The data entry method according to claim 1, It is characterized in that The step of sending a data update request to a backend server through Ajax technology to create a fast dynamic web page based on the real-time answer data includes: The real-time answer data, or the return data from the large backend server received based on Ajax, is used to replace the first historical answer data as new first historical answer data.
4. A data entry method, It is characterized in that The data entry method is applied to a backend server, and the data entry includes: Receiving a data update request sent by a user terminal, and obtaining answer data to be updated and a first data entry area identifier corresponding to the answer data to be updated from the data update request, wherein the answer data to be updated is answer data that satisfies verification conditions that the number of character statistics is less than or equal to a preset character number threshold, the character type matches a preset character type, and matches a preset regular expression, and is inconsistent with the corresponding first historical answer data; Determine a second data entry area identifier in a preset database that is consistent with the first data entry area identifier, and obtain second historical answer data corresponding to the second data entry area identifier from the preset database; Comparing the answer data to be updated with the second historical answer data to determine whether the two are consistent; If not, the answer data to be updated will replace the second historical answer data as new second historical answer data.
5. The data entry method according to claim 4, It is characterized in that After the step of replacing the second historical answer data with the answer data to be updated as the new second historical answer data, the following step further comprises: The return data is sent to the user terminal based on the new second historical answer data, so that the user terminal updates the historical answer data.
6. A user terminal, It is characterized in that The user terminal includes a processor, a memory, and a data entry program stored in the memory and executable by the processor, wherein when the data entry program is executed by the processor, the steps of the data entry method according to any one of claims 1 to 3 are implemented.
7. A backend server, It is characterized in that The backend server includes a processor, a memory, and a data entry program stored in the memory and executable by the processor, wherein when the data entry program is executed by the processor, the steps of the data entry method as described in any one of claims 4 to 5 are implemented.
8. A storage medium, It is characterized in that The storage medium stores a data entry program, wherein when the data entry program is executed by the processor, the steps of the data entry method according to any one of claims 1 to 5 are implemented.
