Data storage method, storage device, electronic device and storage medium

By temporarily storing the data of the drop-down box component on the front end and batch synchronizing it to the back-end database, multiple interaction problems when new options are added to the drop-down box component are solved, and resource saving and simplicity of the page are achieved.

CN114237560BActive Publication Date: 2025-08-12阳光保险集团股份有限公司
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111497642.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-09
Publication Date
2025-08-12
Estimated Expiration
2041-12-09

AI Technical Summary

Technical Problem

In front-end development, when the options in the drop-down box component are added, it needs to interact with the back-end multiple times, resulting in waste of development resources and unclear and beautiful front-end pages.

Method used

The complete target data is temporarily stored in the string array of the front-end, and synchronized to the back-end database at one time after the user confirms it, reducing the number of interactions with the back-end.

Benefits of technology

Save development resources, simplify the front-end page, and improve the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114237560B_ABST
    Figure CN114237560B_ABST
Patent Text Reader

Abstract

The present application provides a data storage method, storage device, electronic device and storage medium. The storage method includes: upon receiving the first part of data entered by the user in a drop-down box, determining whether there is at least one alternative content item whose data header is consistent with the first part of data in the alternative data stored in the back-end database; if not, obtaining the complete target data entered by the user in the drop-down box, and temporarily storing the complete target data in a string array on the front end; in response to a touch operation on a newly added control, synchronizing all the complete target data in the string array temporarily stored on the front end to the back-end database. According to the storage method and device, the number of interactions with the back end can be reduced, saving development resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing, and in particular to a data storage method, a storage device, an electronic device, and a storage medium. Background Art

[0002] With the development of front-end development technology, many frameworks have emerged to facilitate development for technical personnel. For example, Iview has become one of the most commonly used front-end VUE frameworks. Various development components have been widely used, which can meet the daily development needs of developers, reduce the difficulty of development, and greatly shorten the development cycle.

[0003] The drop-down box component is a commonly used component in development tasks, providing great convenience for selecting options and determining whether options already exist in the database. However, during the development process, developers often encounter situations where options do not exist in the drop-down box component. In these cases, they need to add new options and write them to the database. Adding new options usually requires writing the new options to the database first and then retrieving them from the database to the front-end for developers to see them. This not only increases the number of interactions with the back-end but also wastes development resources. Summary of the Invention

[0004] In view of this, the purpose of this application is to provide a data storage method, storage device, electronic device and storage medium, which first temporarily stores the complete target data in the string array of the front end, and then submits all the complete target data in the string array temporarily stored in the front end to the back-end database together. There is no need to submit each new complete target data to the back-end database, which reduces the number of interactions with the back end and saves development resources.

[0005] In a first aspect, an embodiment of the present application provides a data storage method, the storage method comprising:

[0006] When receiving the first part of data input by the user in the drop-down box, determining whether there is at least one candidate content item whose data header is consistent with the first part of data in the candidate data stored in the back-end database;

[0007] If it does not exist, obtain the complete target data entered by the user in the drop-down box and temporarily store the complete target data in the string array of the front end;

[0008] In response to a touch operation on a newly added control, all complete target data in the string array temporarily stored in the front end is synchronized to the back end database.

[0009] Furthermore, the drop-down box displays prompt information corresponding to the current display state, and the storage method further includes:

[0010] If there is no at least one alternative content item whose data header is consistent with the first part of data, the display state of the drop-down box is changed, and the prompt information is changed; wherein, the current display state includes any one of display and hiding, when the current display state is display, the prompt information corresponding to the current display state is please select, and when the current display state is hidden, the prompt information corresponding to the current display state is please enter.

[0011] Furthermore, the determining whether there is at least one candidate content item whose data header is consistent with the first portion of data in the candidate data stored in the back-end database includes:

[0012] According to the identification information of the drop-down box, at least one candidate data corresponding to the data content involved in the drop-down box is obtained from the back-end database;

[0013] determining the number of characters included in the first portion of data;

[0014] For each candidate data, extract the pre-set sub-candidate data from the candidate data; wherein the number of digits of the pre-set sub-candidate data is the same as the number of characters;

[0015] If the sub-candidate data is consistent with the first part of data, it is considered that there is a candidate content item whose data header is consistent with the first part of data in the candidate data stored in the backend database, and the candidate data to which the sub-candidate data belongs is used as the candidate content item.

[0016] Furthermore, after temporarily storing the complete target data in the character string array of the front end, the storage method further includes:

[0017] receiving a second portion of data re-entered by the user in the drop-down box;

[0018] Determining whether a data header of the complete target data is consistent with the second portion of data;

[0019] If they are consistent, the complete target data is displayed in the graphical user interface.

[0020] Furthermore, displaying the complete target data in a graphical user interface includes:

[0021] Displaying a pop-up box at the location of the drop-down box in the graphical user interface;

[0022] The complete target data is displayed in the area where the pop-up box is located.

[0023] Furthermore, after determining whether there is at least one candidate content item whose data header is consistent with the first part of data in the candidate data stored in the back-end database, the storage method further includes:

[0024] If there is at least one candidate content item whose data header is consistent with the first part of data, obtaining the at least one candidate content item in the backend database;

[0025] displaying at least one alternative content item in a graphical user interface;

[0026] In response to a click operation on any one of the at least one candidate content item, the candidate content item is displayed in the area where the drop-down box is located.

[0027] In a second aspect, an embodiment of the present application further provides a storage device for newly added data, the storage device comprising:

[0028] a determination module configured to, upon receiving a first portion of data input by a user in the drop-down box, determine whether there is at least one candidate content item whose data header is consistent with the first portion of data in the candidate data stored in the back-end database;

[0029] An acquisition module is used to acquire the complete target data entered by the user in the drop-down box if the target data does not exist, and temporarily store the complete target data in a string array of the front end;

[0030] The data synchronization module is used to respond to the touch operation on the newly added control and synchronize all the complete target data in the string array temporarily stored in the front end to the back end database.

[0031] Furthermore, the drop-down box displays prompt information corresponding to the current display state, and the storage device further includes:

[0032] A transition module is used to change the display state of the drop-down box and the prompt information if there is no at least one alternative content item whose data header is consistent with the first part of the data; wherein, the display state includes any one of display and hiding, when the display state is display, the prompt information corresponding to the display state is please select, and when the display state is hidden, the prompt information corresponding to the display state is please enter.

[0033] In a third aspect, an embodiment of the present application further provides an electronic device comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor and the memory communicate through the bus, and when the machine-readable instructions are executed by the processor, the steps of the data storage method as described above are performed.

[0034] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the data storage method as described above are executed.

[0035] The data storage method provided by the present application, first, when receiving the first part of data entered by the user in the drop-down box, it is determined whether there is at least one alternative content item whose data header is consistent with the first part of data in the alternative data stored in the back-end database; if not, the complete target data entered by the user in the drop-down box is obtained, and the complete target data is temporarily stored in the string array of the front end; finally, in response to the touch operation for the newly added control, all the complete target data in the string array temporarily stored in the front end are synchronized to the back-end database.

[0036] The data storage method and storage device provided in the embodiment of the present application compare the first part of the data received from the user input with the alternative data stored in the back-end database. If there is no alternative data item, the complete target data input by the user is obtained, and the complete target data is temporarily stored in the string array of the front end. In this way, when adding new target data, the complete target data is first temporarily stored in the string array of the front end, so there is no need to store the complete target data in the back-end database first. After all the complete target data are stored in the string data of the front end, in response to the touch operation for the newly added control, all the complete target data temporarily stored in the string array of the front end are synchronized to the back-end database, so that all the newly added complete target data are submitted to the back-end database together, and there is no need to submit to the back-end database once for each new complete target data. This can reduce the number of interactions with the back end and save development resources.

[0037] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without creative work.

[0039] Figure 1 A flowchart of a data storage method provided in an embodiment of the present application;

[0040] Figure 2 A flowchart for determining whether there is at least one candidate content item provided in an embodiment of the present application;

[0041] Figure 3 A schematic diagram of the structure of a data storage device provided in an embodiment of the present application;

[0042] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0043] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application for which protection is claimed, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, each other embodiment obtained by those skilled in the art without making creative work falls within the scope of protection of the present application.

[0044] With the development of front-end development technology, many frameworks have emerged to facilitate development for technical personnel. For example, Iview has become one of the most commonly used front-end VUE frameworks. Various development components have been widely used, which can meet the daily development needs of developers, reduce the difficulty of development, and greatly shorten the development cycle.

[0045] Among them, the drop-down box component is a more commonly used component in development tasks. It provides great convenience for the selection of options and the judgment of whether the options already exist in the database. In the development process, developers will often encounter situations where options do not exist in the drop-down box component. In this case, it is necessary to add new options and write them into the database. For example, in the lower version of the Iview framework, the SELECT drop-down box is usually used as a selection. If you need to add new options, use the INPUT input box to enter the options to be created, submit the back-end for creation, and then they will appear in the SELECT drop-down box. In other words, it is usually necessary to write the new options into the database first, and then retrieve the new options from the database to the front-end before the developer can see them. This not only increases the number of interactions with the back-end, but also causes a waste of development resources. In addition, this will cause the front-end page to be not simple and beautiful due to the excessive number of components.

[0046] Based on this, an embodiment of the present application provides a data storage method, which first temporarily stores the complete target data in a string array on the front end, and then submits all the complete target data in the string array temporarily stored on the front end to the back-end database together. There is no need to submit a new complete target data to the back-end database once, which reduces the number of interactions with the back end and saves development resources.

[0047] See also Figure 1 , Figure 1 This is a flow chart of a data storage method provided in an embodiment of the present application. Figure 1 As shown in , an embodiment of the present application provides a data storage method, including:

[0048] S101 : When receiving a first portion of data input by a user in a drop-down box, determining whether there is at least one candidate content item whose data header is consistent with the first portion of data in the candidate data stored in a backend database.

[0049] It should be noted that the drop-down box refers to a component used to select target data. For example, in the application scenario of Iview, the drop-down box can be a SELECT drop-down box. The first part of the data refers to a part of the target data input by the user, which is a part of the complete target data described below. Here, the first part of the data can be in English, Chinese, or a mixed data format of Chinese and English. The back-end database refers to a database used to store various alternative data. Alternative data refers to option data stored in the back-end database for users to select. Alternative content items refer to alternative data whose data header is consistent with the first part of the data input by the user. The data format of the alternative data and alternative content items can also be in English, Chinese, or a mixed data format of Chinese and English.

[0050] For the above step S101, during the specific implementation, the user can enter the first part of data in the drop-down box. When the first part of data entered by the user in the drop-down box is received, it is necessary to determine whether there is at least one alternative content item in the alternative data stored in the back-end database whose data header is consistent with the first part of data.

[0051] See also Figure 2 , Figure 2 A flowchart for determining whether at least one candidate content item exists is provided in an embodiment of the present application. Regarding step S101 above, as an optional embodiment, determining whether there is at least one candidate content item in the candidate data stored in the backend database whose data header is consistent with the first portion of data includes:

[0052] S201 : Acquire at least one candidate data corresponding to the data content involved in the drop-down box from the backend database according to the identification information of the drop-down box.

[0053] It should be noted that identification information is a label used to distinguish different drop-down boxes. Specifically, the identification information can be a number, with different numbers representing different drop-down boxes. Data content refers to the type of data corresponding to the drop-down box. For example, data content can be different data contents such as user name, user mobile phone number, user ID number, user address, etc. This application does not specifically limit this.

[0054] With respect to step S201 above, since different drop-down boxes may involve different data contents, and different data contents may correspond to different candidate data, it is necessary to obtain the corresponding candidate data based on the identification information of the drop-down box. When a user clicks a drop-down box and enters the first target data therein, the identification information of the drop-down box is obtained, and at least one candidate data corresponding to the data content involved in the drop-down box is obtained in the back-end database based on the identification information of the drop-down box. As an example, when the data content involved in the drop-down box is a user name, the corresponding at least one candidate data may be data such as "zhangsan", "lisi", "Wang Wu", etc.

[0055] It should be noted here that the above examples of data content and candidate data corresponding to the data content are merely illustrative. In practice, data content and candidate data corresponding to the data content are not limited to the above examples.

[0056] S202: Determine the number of characters included in the first portion of data.

[0057] It should be noted that the number of characters refers to the number of characters included in the first part of the data. As an example, when the first part of the data is "liu", the number of characters included in the first part of the data is 3; when the first part of the data is "Zhang San", the number of characters included in the first part of the data is 2.

[0058] Regarding S202 above, determine the number of characters included in the first part of the data according to the first part of the data input by the user in the dropdown box.

[0059] S203. For each alternative data, extract the sub-alternative data of the first preset position from the alternative data.

[0060] It should be noted that the first preset position refers to the position of the character at the head of the data in the alternative data. Among them, the number of digits of the first preset position is the same as the number of characters. The sub-alternative data refers to the sub-data located at the first preset position extracted from the alternative data. Therefore, the sub-alternative data of the alternative data at the first preset position refers to the data of several digits at the head of the data in the alternative data. As an example, when the alternative data is "zhangsan" and the number of characters is 3, the number of digits of the first preset position is also 3, and the sub-alternative data of the first preset position extracted from the alternative data is "zha". When the alternative data is "Zhang San" and the number of characters is 1, the number of digits of the first preset position is also 1, and the sub-alternative data of the first preset position extracted from the alternative data is "Zhang".

[0061] Regarding the above step S203, in specific implementation, for each alternative data, according to the number of characters included in the determined first part of the data, extract the sub-alternative data of the first preset position from the alternative data, and the number of characters included in the sub-alternative data is equal to the number of characters included in the first part of the data.

[0062] S204. If the sub-alternative data is consistent with the first part of the data, it is considered that there is an alternative content item in the alternative data stored in the backend database whose data head is consistent with the first part of the data, and the alternative data to which the sub-alternative data belongs is used as the alternative content item.

[0063] With respect to the above-mentioned step S204, during specific implementation, for each alternative data, after extracting the sub-alternative data corresponding to the alternative data, if the sub-alternative data is consistent with the first part of the data input by the user, it is considered that there is an alternative content item whose data header is consistent with the first part of the data in the alternative data stored in the back-end database, and the alternative data to which the sub-alternative data belongs is used as the alternative content item. Continuing with the embodiment in step S203, when the first part of the data input by the user is "zha", the first part of the data is consistent with the sub-alternative data "zha" corresponding to the alternative data "zhangsan", it is considered that there is an alternative content item whose data header is consistent with the first part of the data in the alternative data stored in the back-end database, and the alternative data "zhangsan" is used as the alternative content item. If the first part of the data input by the user is "shu", the first part of the data is inconsistent with the sub-alternative data corresponding to the alternative data, and then it is considered that there is no alternative content item whose data header is consistent with the first part of the data in the alternative data stored in the back-end database.

[0064] S102: If the target data does not exist, the complete target data input by the user in the drop-down box is obtained, and the complete target data is temporarily stored in the string array of the front end.

[0065] It should be noted that the complete target data refers to the complete target data that the user wants to create. The front end refers to the graphical user interface operated by the user, and the string array refers to an array used to store character data, which is used to store characters or strings. The string data of the front end is the code used to develop the front end interface. For example, the string data of the front end can be a front end JSON (JavaScript Object Notation) string. Here, JSON is a lightweight data exchange format that uses a text format that is completely independent of the programming language to store and represent data.

[0066] For the above-mentioned step S102, during the specific implementation, when it is determined that there is no alternative content item whose data header is consistent with the first part of the data in the alternative data stored in the back-end database, the complete target data entered by the user in the drop-down box is obtained, and the complete target data is temporarily stored in the string array of the front end. In this way, there is no need to store the complete target data in the back-end database first, which can reduce the number of interactions with the back-end and save development resources.

[0067] As an optional implementation, the drop-down box displays prompt information corresponding to the current display state. The data storage method provided by this application also includes:

[0068] If there is no at least one candidate content item whose data header is consistent with the first part of data, the display state of the drop-down box is changed, and the prompt information is changed.

[0069] It should be noted that the current display status refers to the display status of the drop-down box, wherein the current display status includes any one of display and hide, and the prompt information refers to the prompt information displayed at the position of the drop-down box, wherein the prompt information includes please select and please enter. When the current display status of the drop-down box is display, the prompt information corresponding to the current display status is please select; when the current display status of the drop-down box is hide, the prompt information corresponding to the current display status is please enter.

[0070] In the prior art, in the lower versions of the iview framework, the SELECT drop-down box component is usually used as a selection. If there is no target option in the drop-down box option list and a new one needs to be added, the INPUT input component is used to input the option to be created and submitted to the back-end for creation, and then it will appear in the SELECT drop-down box. In this way, multiple SELECT drop-down box components and multiple INPUT input components will be displayed on the graphical interface, which will not only cause a burden on the front-end page, but also because there are too many components displayed, the front-end interface is not simple and beautiful enough. Therefore, in the absence of at least one alternative content item whose data header is consistent with the first part of the data, the present application will hide the drop-down box and display the input box. With respect to the above steps, in the specific implementation, the two components of the drop-down box and the input box are combined, and the display and hiding of the two components are controlled. In the initial state, the drop-down box's display state is set to displayed, the input box's display state is set to hidden, and a "Please Select" prompt is displayed in the drop-down box. When it is determined that there is no alternative content item whose data header is consistent with the first part of the data, the display state of the drop-down box and the input box are changed, the drop-down box's display state is set to hidden, and the input box's display state is set to displayed. This makes it appear that there is only one component, beautifying the front-end page and reducing the number of interactions between the user and the back-end. When the drop-down box is hidden, the prompt corresponding to the current display state is also changed to "Please Select".

[0071] Regarding the above step S102, as an optional implementation, after temporarily storing the complete target data in the string array of the front end, the data storage method provided by the present application further includes:

[0072] Step 1021: receiving the second portion of data input again by the user in the drop-down box.

[0073] It should be noted that after the first partial data input by the user is processed, the next partial data input by the user is the second partial data.

[0074] With respect to the above step 1021 , after the first portion of data is processed, the second portion of data input again by the user in the drop-down box is received.

[0075] Step 1022: Determine whether the data header of the complete target data is consistent with the second portion of data.

[0076] With respect to step 1022 above, after receiving the second portion of data, it is determined whether the data header of the complete target data is consistent with the second portion of data. Specifically, the method for determining whether the data header of the complete target data is consistent with the second portion of data is the same as the method for determining whether there is at least one alternative content item in the alternative data whose data header is consistent with the first portion of data provided in the above embodiment: first, the number of characters in the second portion of data is obtained, and sub-target data with the same number of characters is extracted from the complete target data. If the sub-target data is consistent with the second portion of data input by the user, it is considered that the data header of the complete target data is consistent with the second portion of data; if the sub-target data is inconsistent with the second portion of data input by the user, it is considered that the data header of the complete target data is inconsistent with the second portion of data.

[0077] Step 1023: If they are consistent, the complete target data is displayed in a graphical user interface.

[0078] For the above step 1023, when it is determined that the data header of the complete target data is consistent with the second part of the data, the complete target data will be displayed in the graphical user interface, so that the user can directly select the complete target data when needed without having to create it again, reducing the number of interactions with the backend and improving the user experience.

[0079] Regarding step 1023, as an optional implementation, displaying the complete target data in a graphical user interface includes:

[0080] A: Display a pop-up box at the location of the drop-down box in the graphical user interface.

[0081] B: Display the complete target data in the pop-up box.

[0082] With respect to the above-mentioned steps A and B, during specific implementation, a pop-up box is displayed at the position of the drop-down box in the graphical user interface, and the complete target data just created by the user is displayed in the pop-up box. If the user needs the complete target data, the user can directly select it in the pop-up box. In response to the user's selection operation for the complete target data, when the user clicks on the complete target data, the complete target data is then displayed in the drop-down box. In this way, when the second target data input by the user is the same as the data header of the complete target data newly created by the user, the complete target data just created can be directly displayed in the pop-up box on the graphical user interface, and the user does not need to create it again, thereby improving the user experience. The complete target data in the pop-up box is available for the user to select. When the user needs it, he can directly click on the complete target data, and the complete target data will be displayed in the drop-down box, and the user can continue to edit the complete target data.

[0083] S103 , in response to a touch operation on the newly added control, synchronizing all complete target data in the string array temporarily stored in the front end to a back end database.

[0084] It should be noted that the newly added control is a trigger button used to synchronize all complete target data to the backend database.

[0085] Regarding the above step S103, in the specific implementation, after the first complete target data is temporarily stored in the string array of the front end, a row of components for operation will be added to the graphical user interface. The user clicks the drop-down box in the newly added row and starts to enter the second part of the data. At this time, the process returns to step S101, obtains the second part of the data entered by the user in the drop-down box, and determines whether the back-end database contains the same alternative content item as the second part of the data in the data front end. If not, the second complete target data is obtained and temporarily stored in the string array of the front end; repeat the above operation until all the complete target data entered by the user are stored in the string array of the front end. At this time, in response to the user's touch operation on the newly added control, all the complete target data temporarily stored in the string array of the front end are synchronized to the back-end database. In this way, all the newly added complete target data are submitted to the back-end database together, and there is no need to submit the back-end database once for each new complete target data. This can reduce the number of interactions with the back-end and save development resources.

[0086] The above embodiments are all described with respect to the case where there is no at least one candidate content item whose data header is consistent with the first portion of data. In specific implementations, the case where there is at least one candidate content item whose data header is consistent with the first portion of data is also included. According to the embodiments provided by the present application, after determining whether there is at least one candidate content item whose data header is consistent with the first portion of data in the candidate data stored in the back-end database, the data storage method provided by the present application further includes:

[0087] (1) If there is at least one candidate content item whose data header is consistent with the first part of data, the at least one candidate content item is obtained from the backend database.

[0088] In the specific implementation of the above steps, the first portion of data entered by the user in the drop-down box is obtained. If it is determined that at least one candidate content item exists whose data header is consistent with the first portion of data, the at least one candidate content item is obtained from the backend database. The method for determining whether at least one candidate content item exists in the candidate data stored in the backend database whose data header is consistent with the first portion of data is described in detail in steps S201 to S204 and will not be repeated here.

[0089] (2) Displaying at least one alternative content item in a graphical user interface.

[0090] In the specific implementation of the above steps, after obtaining at least one candidate content item whose data header is consistent with the first portion of data, the at least one candidate content item is displayed in a graphical user interface for the user to view. As an optional implementation, a pop-up box is displayed in the graphical user interface at the location of the drop-down box, and the at least one candidate content item is displayed in the pop-up box.

[0091] (3) In response to a click operation on any one of the at least one candidate content item, the candidate content item is displayed in the area where the drop-down box is located.

[0092] Regarding the above steps, in a specific implementation, when a user clicks on any of the alternative content items in the pop-up box, in response to the user's click operation on any of the at least one alternative content item, the alternative content item is displayed in the area where the drop-down box operated by the user is located. In this way, the alternative content item whose data header is consistent with the first part of the data entered by the user can be retrieved based on the first part of the data entered by the user and displayed in the pop-up box. When the user needs a certain alternative content item, they can directly click on the alternative content item, and the alternative content item will appear in the area where the drop-down box is located, and the user can edit the alternative content item. In this way, the user can obtain the desired alternative content item without having to enter all the target data, thereby improving the user experience.

[0093] The data storage method and storage device provided in the embodiment of the present application compare the first part of the data received from the user input with the alternative data stored in the back-end database. If there is no alternative data item, the complete target data input by the user is obtained, and the complete target data is temporarily stored in the string array of the front end. In this way, when adding new target data, the complete target data is first temporarily stored in the string array of the front end, so there is no need to store the complete target data in the back-end database first. After all the complete target data are stored in the string data of the front end, in response to the touch operation for the newly added control, all the complete target data temporarily stored in the string array of the front end are synchronized to the back-end database, so that all the newly added complete target data are submitted to the back-end database together, and there is no need to submit to the back-end database once for each new complete target data. This can reduce the number of interactions with the back end and save development resources.

[0094] See also Figure 3 , Figure 3 This is a schematic diagram of the structure of a storage device for newly added data provided in an embodiment of the present application. Figure 3 As shown in , the storage device 300 includes:

[0095] The judgment module 301 is configured to, upon receiving a first portion of data input by a user in a drop-down box, judge whether there is at least one candidate content item whose data header is consistent with the first portion of data in the candidate data stored in the backend database;

[0096] The acquisition module 302 is used to acquire the complete target data entered by the user in the drop-down box if it does not exist, and temporarily store the complete target data in the string array of the front end;

[0097] The data synchronization module 303 is used to respond to the touch operation on the newly added control and synchronize all the complete target data in the string array temporarily stored in the front end to the back end database.

[0098] Furthermore, the drop-down box displays prompt information corresponding to the current display state, and the storage device 300 further includes:

[0099] A transition module is used to change the display state of the drop-down box and the prompt information if there is no at least one alternative content item whose data header is consistent with the first part of the data; wherein, the display state includes any one of display and hiding, when the display state is display, the prompt information corresponding to the display state is please select, and when the display state is hidden, the prompt information corresponding to the display state is please enter.

[0100] Furthermore, when the judgment module 301 is used to judge whether there is at least one candidate content item whose data header is consistent with the first part of data in the candidate data stored in the backend database, the judgment module 301 is used to:

[0101] According to the identification information of the drop-down box, at least one candidate data corresponding to the data content involved in the drop-down box is obtained from the back-end database;

[0102] determining the number of characters included in the first portion of data;

[0103] For each candidate data, extract the pre-set sub-candidate data from the candidate data; wherein the number of digits of the pre-set sub-candidate data is the same as the number of characters;

[0104] If the sub-candidate data is consistent with the first part of data, it is considered that there is a candidate content item whose data header is consistent with the first part of data in the candidate data stored in the backend database, and the candidate data to which the sub-candidate data belongs is used as the candidate content item.

[0105] Furthermore, after temporarily storing the complete target data in the character string array of the front end, the storage device 300 further includes a first display module, which is used to:

[0106] receiving a second portion of data re-entered by the user in the drop-down box;

[0107] Determining whether a data header of the complete target data is consistent with the second portion of data;

[0108] If they are consistent, the complete target data is displayed in the graphical user interface.

[0109] Furthermore, when the display module is used to display the complete target data in a graphical user interface, the display module is used to:

[0110] Displaying a pop-up box at the location of the drop-down box in the graphical user interface;

[0111] The complete target data is displayed in the area where the pop-up box is located.

[0112] Furthermore, after determining whether there is at least one candidate content item whose data header is consistent with the first portion of data in the candidate data stored in the backend database, the storage device 300 further includes a second display module, which is configured to:

[0113] If there is at least one candidate content item whose data header is consistent with the first part of data, obtaining the at least one candidate content item in the backend database;

[0114] displaying at least one alternative content item in a graphical user interface;

[0115] In response to a click operation on any one of the at least one candidate content item, the candidate content item is displayed in the area where the drop-down box is located.

[0116] See also Figure 4 , Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 4 As shown in FIG, the electronic device 400 includes a processor 410 , a memory 420 and a bus 430 .

[0117] The memory 420 stores machine-readable instructions executable by the processor 410. When the electronic device 400 is running, the processor 410 communicates with the memory 420 via the bus 430. When the machine-readable instructions are executed by the processor 410, the above-mentioned Figure 1 as well as Figure 2 The steps of the data storage method in the method embodiment shown solve the problem in the prior art of frequent interactions with the backend and waste of development resources when adding new data. The specific implementation method can be found in the method embodiment and will not be repeated here.

[0118] The embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the computer program can execute the above-mentioned Figure 1 as well as Figure 2 The steps of the data storage method in the method embodiment shown solve the problem in the prior art of frequent interactions with the backend and waste of development resources when adding new data. The specific implementation method can be found in the method embodiment and will not be repeated here.

[0119] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0120] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. There may be other division methods in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed may be through some communication interface, indirect coupling or communication connection of devices or units, which may be electrical, mechanical or other forms.

[0121] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0122] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0123] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0124] It should be noted that similar numbers and letters represent similar items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are only used to distinguish the description and are not to be understood as indicating or implying relative importance.

[0125] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The scope of protection of the present application is not limited thereto. Although the present application has been described in detail with reference to the above-mentioned embodiments, those skilled in the art should understand that any person skilled in the art can modify or easily conceive of changes to the technical solutions described in the above-mentioned embodiments within the technical scope disclosed in the present application, or perform equivalent replacements for some of the technical features thereof. These modifications, changes, or replacements do not deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.

Claims

1. A data storage method, characterized in that: The storage method includes: When receiving the first part of data input by the user in the drop-down box, determining whether there is at least one candidate content item whose data header is consistent with the first part of data in the candidate data stored in the back-end database; If it does not exist, obtain the complete target data entered by the user in the drop-down box and temporarily store the complete target data in the string array of the front end; In response to a touch operation on a newly added control, all complete target data in the string array temporarily stored in the front end is synchronized to a back end database; The determining whether there is at least one candidate content item whose data header is consistent with the first part of data in the candidate data stored in the back-end database includes: According to the identification information of the drop-down box, at least one candidate data corresponding to the data content involved in the drop-down box is obtained from the back-end database; determining the number of characters included in the first portion of data; For each candidate data, extract the pre-set sub-candidate data from the candidate data; wherein the number of digits of the pre-set sub-candidate data is the same as the number of characters; If the sub-candidate data is consistent with the first part of data, it is considered that there is a candidate content item whose data header is consistent with the first part of data in the candidate data stored in the backend database, and the candidate data to which the sub-candidate data belongs is used as the candidate content item.

2. The storage method according to claim 1, wherein: The drop-down box displays prompt information corresponding to the current display state, and the storage method further includes: If there is no at least one alternative content item whose data header is consistent with the first part of data, the display state of the drop-down box is changed, and the prompt information is changed; wherein, the current display state includes any one of display and hiding, when the current display state is display, the prompt information corresponding to the current display state is please select, and when the current display state is hidden, the prompt information corresponding to the current display state is please enter.

3. The storage method according to claim 1, wherein: After temporarily storing the complete target data in the string array of the front end, the storage method further includes: receiving a second portion of data re-entered by the user in the drop-down box; Determining whether a data header of the complete target data is consistent with the second portion of data; If they are consistent, the complete target data is displayed in the graphical user interface.

4. The storage method according to claim 3, characterized in that: Displaying the complete target data in a graphical user interface includes: Displaying a pop-up box at the location of the drop-down box in the graphical user interface; The complete target data is displayed in the area where the pop-up box is located.

5. The storage method according to claim 1, wherein: After determining whether there is at least one candidate content item whose data header is consistent with the first part of data in the candidate data stored in the back-end database, the storage method further includes: If there is at least one candidate content item whose data header is consistent with the first part of data, obtaining the at least one candidate content item in the backend database; displaying at least one alternative content item in a graphical user interface; In response to a click operation on any one of the at least one candidate content item, the candidate content item is displayed in the area where the drop-down box is located.

6. A storage device for newly added data, characterized in that: The storage device includes: a determination module configured to, upon receiving a first portion of data input by a user in the drop-down box, determine whether there is at least one candidate content item whose data header is consistent with the first portion of data in the candidate data stored in the back-end database; An acquisition module is used to acquire the complete target data entered by the user in the drop-down box if the target data does not exist, and temporarily store the complete target data in a string array of the front end; A data synchronization module, configured to respond to a touch operation on a newly added control and synchronize all complete target data in the string array temporarily stored in the front end to a back end database; When the judgment module is used to judge whether there is at least one candidate content item whose data header is consistent with the first part of data in the candidate data stored in the back-end database, the judgment module is used to: According to the identification information of the drop-down box, at least one candidate data corresponding to the data content involved in the drop-down box is obtained from the back-end database; determining the number of characters included in the first portion of data; For each candidate data, extract the pre-set sub-candidate data from the candidate data; wherein the number of digits of the pre-set sub-candidate data is the same as the number of characters; If the sub-candidate data is consistent with the first part of data, it is considered that there is a candidate content item whose data header is consistent with the first part of data in the candidate data stored in the backend database, and the candidate data to which the sub-candidate data belongs is used as the candidate content item.

7. The storage device according to claim 6, wherein: The drop-down box displays prompt information corresponding to the current display state, and the storage device further includes: A transition module is used to change the display state of the drop-down box and the prompt information if there is no at least one alternative content item whose data header is consistent with the first part of the data; wherein, the display state includes any one of display and hiding, when the display state is display, the prompt information corresponding to the display state is please select, and when the display state is hidden, the prompt information corresponding to the display state is please enter.

8. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate through the bus, and the machine-readable instructions are executed by the processor to perform the steps of the data storage method according to any one of claims 1 to 5.

9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the data storage method according to any one of claims 1 to 5 are executed.

Citation Information

Patent Citations

  • Method for achieving multilevel linkage of drop-down boxes, electronic device and storage medium

    CN108038142A