Method and device for generating data input box

文档序号:449650 发布日期:2021-12-28 浏览:12次 中文

阅读说明:本技术 数据输入框的生成方法和装置 (Method and device for generating data input box ) 是由 张发星 于 2020-12-23 设计创作,主要内容包括:本公开涉及一种数据输入框的生成方法和装置,涉及计算机技术领域。该方法包括:根据Web页面上拟生成数据输入框的位置,在Web页面上填充占位控件;响应于Web页面加载,获取占位控件的相关属性;根据相关属性,将Native安全输入控件渲染到Web页面的相应位置,以生成数据输入框。(The disclosure relates to a method and a device for generating a data input box, and relates to the technical field of computers. The method comprises the following steps: filling an occupancy control on a Web page according to the position of a data input box to be generated on the Web page; responding to Web page loading, and acquiring relevant attributes of the position occupying control; and rendering the Native security input control to the corresponding position of the Web page according to the related attributes to generate a data input box.)

1. A method for generating a data input box comprises the following steps:

filling an occupancy control on a Web page according to the position of a data input box to be generated on the Web page;

responding to the Web page loading, and acquiring the relevant attribute of the placeholder control;

and rendering the local Native security input control to the corresponding position of the Web page according to the related attributes to generate the data input box.

2. The generation method of claim 1, wherein the obtaining the relevant properties of the placeholder control in response to the Web page loading comprises:

responding to the Web page loading, and acquiring the identification ID of the placeholder control;

and acquiring the related attribute of the placeholder control according to the ID of the placeholder control.

3. The generation method of claim 2, wherein the obtaining the relevant attributes of the placeholder control according to the ID of the placeholder control comprises:

loading the Web page by using a callback method;

and acquiring the relevant attribute corresponding to the ID of the occupancy control by using a script JS.

4. The generation method of claim 1, wherein the rendering Native security input controls to respective locations of the Web page according to the relevant attributes comprises:

and rendering the Native security input control to a corresponding position of the Web page by using an add view addView method of a network view WebView control.

5. The generation method of claim 1, wherein the rendering Native security input controls to respective locations of the Web page according to the relevant attributes comprises:

responding to the movement of the occupancy control, and acquiring the change condition of the relevant attribute of the occupancy control;

and rendering the Native security input control to the corresponding position of the Web page according to the change condition.

6. The generation method according to any one of claims 1 to 5,

the position-occupying control is a separating div control or an input control, and the related attributes comprise a size attribute and a position attribute.

7. The generation method according to any one of claims 1 to 5, further comprising:

acquiring data by using the data input box;

and uploading the ciphertext of the data to a server.

8. An apparatus for generating a data input box, comprising:

the filling unit is used for filling the position occupying control on the Web page according to the position of the data input box to be generated on the Web page;

the acquisition unit is used for responding to the Web page loading and acquiring the related attribute of the placeholder control;

and the rendering unit is used for rendering the local Native security input control to the corresponding position of the Web page according to the related attributes so as to generate the data input box.

9. The generation apparatus of claim 8,

the obtaining unit responds to the Web page loading, obtains the identification ID of the occupancy control, and obtains the relevant attribute of the occupancy control according to the ID of the occupancy control.

10. The generation apparatus of claim 8,

and the acquisition unit loads the Web page by using a callback method and acquires the relevant attribute corresponding to the ID of the occupancy control by using a script JS.

11. The generation apparatus of claim 8,

and the rendering unit renders the Native security input control to a corresponding position of the Web page by using an addView method of a network view WebView control.

12. The generation apparatus of claim 8,

the acquiring unit responds to the movement of the occupancy control and acquires the change condition of the related attribute of the occupancy control;

and the rendering unit renders the Native security input control to the corresponding position of the Web page according to the change condition.

13. The generation apparatus according to any one of claims 8 to 12,

the position-occupying control is a separating div control or an input control, and the related attributes comprise a size attribute and a position attribute.

14. The generation apparatus according to any one of claims 8 to 12, further comprising:

and the uploading unit is used for uploading the ciphertext of the data acquired by the acquiring unit by using the data input box to the server side.

15. An apparatus for generating a data input box, comprising:

a memory; and

a processor coupled to the memory, the processor configured to perform the method of generating a data entry box of any of claims 1-7 based on instructions stored in the memory.

16. A non-transitory computer-readable storage medium on which a computer program is stored, the program, when executed by a processor, implementing the method of generating a data input box according to any one of claims 1 to 7.

Technical Field

The present disclosure relates to the field of computer technologies, and in particular, to a method and an apparatus for generating a data input box.

Background

In order to reduce development cost, Web (Web) technology is increasingly used in mobile apps (applications) to develop functional modules. However, the Web technology is insufficient in security protection, and a leakage risk may occur in a scenario of high-sensitive information input such as login, transaction, personal information input, and the like. Therefore, a secure input mechanism needs to be introduced into the function page implemented by the App using the Web technology.

In the related art, input data is encrypted in the Web or in a Native (local) layer and then uploaded to a server, thereby implementing a secure input mechanism.

Disclosure of Invention

The inventors of the present disclosure found that the following problems exist in the above-described related art: encryption algorithms and keys may be revealed during the input of data, or plaintext may be intercepted at the client, resulting in low security of data input.

In view of this, the present disclosure provides a technical solution for generating a data input box, which can improve the security of data input.

According to some embodiments of the present disclosure, there is provided a method for generating a data input box, including: filling an occupancy control on a Web page according to the position of a data input box to be generated on the Web page; responding to the Web page loading, and acquiring the relevant attribute of the placeholder control; and rendering the Native security input control to the corresponding position of the Web page according to the related attributes to generate the data input box.

In some embodiments, the obtaining the relevant properties of the placeholder control in response to the Web page loading comprises: responding to the Web page loading, and acquiring an ID (Identification) of the placeholder control; and acquiring the related attribute of the placeholder control according to the ID of the placeholder control.

In some embodiments, the obtaining the relevant attribute of the placeholder control according to the ID of the placeholder control includes: loading the Web page by using a callback method; and acquiring the relevant attribute corresponding to the ID of the placeholder control by using JS (Java Script).

In some embodiments, the rendering Native security input controls to respective locations of the Web page according to the relevant attributes comprises: and rendering the Native security input control to a corresponding position of the Web page by using an addView (added view) method of a WebView (network view) control.

In some embodiments, the rendering Native security input controls to respective locations of the Web page according to the relevant attributes comprises: responding to the movement of the occupancy control, and acquiring the change condition of the relevant attribute of the occupancy control; and rendering the Native security input control to the corresponding position of the Web page according to the change condition.

In some embodiments, the placeholder control is a div (divsion) control or an input control, and the associated properties include a size property and a location property.

In some embodiments, the generating method further comprises: acquiring data by using the data input box; and uploading the ciphertext of the data to a server.

According to further embodiments of the present disclosure, there is provided a data input box generation apparatus including: the filling unit is used for filling the position occupying control on the Web page according to the position of the data input box to be generated on the Web page; the acquisition unit is used for responding to the Web page loading and acquiring the related attribute of the placeholder control; and the rendering unit is used for rendering the Native security input control to the corresponding position of the Web page according to the related attributes so as to generate the data input box.

In some embodiments, the obtaining unit obtains the ID of the placeholder control in response to the Web page loading, and obtains the related attribute of the placeholder control according to the ID of the placeholder control.

In some embodiments, the obtaining unit loads the Web page by using a callback method, and obtains the relevant attribute corresponding to the ID of the placeholder control by using JS.

In some embodiments, the rendering unit renders the Native secure input control to a corresponding position of the Web page using an addView method of a WebView control.

In some embodiments, the obtaining unit obtains, in response to the placeholder control moving, a change condition of a related attribute of the placeholder control; and the rendering unit renders the Native security input control to the corresponding position of the Web page according to the change condition.

In some embodiments, the placeholder control is a div control or an input control, and the related attributes include a size attribute and a position attribute.

In some embodiments, the generating means further comprises: and the uploading unit is used for uploading the ciphertext of the data acquired by the acquiring unit by using the data input box to the server side.

According to still other embodiments of the present disclosure, there is provided a data input box generation apparatus including: a memory; and a processor coupled to the memory, the processor configured to perform the method of generating a data input box in any of the above embodiments based on instructions stored in the memory device.

According to still further embodiments of the present disclosure, there is provided a non-transitory computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method of generating a data input box in any of the above embodiments.

In the embodiment, the direct loading and rendering of the Native security input control on the Web page are realized by using the position-occupying control. Therefore, the technical problems that an encryption algorithm and a secret key are leaked in the data input process and plaintext is intercepted at a client can be solved, and the safety of data input is improved.

Drawings

The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description, serve to explain the principles of the disclosure.

The present disclosure may be more clearly understood from the following detailed description, taken with reference to the accompanying drawings, in which:

FIG. 1 illustrates a flow diagram of some embodiments of a method of generation of a data input box of the present disclosure;

FIG. 2 illustrates a flow diagram of some embodiments of step 120 in FIG. 1;

FIG. 3 illustrates a flow diagram for some embodiments of step 130 in FIG. 1;

FIG. 4 illustrates a block diagram of some embodiments of a data entry box generation apparatus of the present disclosure;

FIG. 5 shows a block diagram of further embodiments of a data entry box generation apparatus of the present disclosure;

FIG. 6 illustrates a block diagram of still further embodiments of an apparatus for generating a data input box of the present disclosure.

Detailed Description

Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that: the relative arrangement of the components and steps, the numerical expressions, and numerical values set forth in these embodiments do not limit the scope of the present disclosure unless specifically stated otherwise.

Meanwhile, it should be understood that the sizes of the respective portions shown in the drawings are not drawn in an actual proportional relationship for the convenience of description.

The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the disclosure, its application, or uses.

Techniques, methods, and apparatus known to those of ordinary skill in the relevant art may not be discussed in detail but are intended to be part of the specification where appropriate.

In all examples shown and discussed herein, any particular value should be construed as merely illustrative, and not limiting. Thus, other examples of the exemplary embodiments may have different values.

It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, further discussion thereof is not required in subsequent figures.

As described above, encrypting and uploading data in the Web cannot solve the problem of encryption algorithm and key leakage, and further cannot avoid the problem of obtaining a plaintext through means such as hook and dump in the input process; the technical problem that the plaintext is hijacked at the client in the input process cannot be solved by encrypting the data at the Native layer.

In order to solve the technical problem, the Native control is directly rendered on the Web page, that is, the position of the sensitive data input box to be arranged on the Web page is generated by the Native security input control (such as an input box and a security keyboard). For example, the following embodiments may be employed to implement the technical solutions of the present disclosure.

Fig. 1 illustrates a flow diagram of some embodiments of a method of generating a data input box of the present disclosure.

As shown in fig. 1, the method includes: step 110, filling the place occupying control; step 120, obtaining relevant attributes; and step 130, rendering Native security input controls.

In step 110, a placeholder control is filled in the Web page according to the position of the data input box to be generated on the Web page. For example, the placeholder control is a div control or an input control.

In some embodiments, for an input box in a Web page where a sensitive field is to be input, the filling may be performed at a required position by using a div control, and an ID may be set for the div control. For example, the ID may be safeinputid.

In step 120, the relevant properties of the placeholder control are obtained in response to the Web page loading. For example, the correlation attributes include a size attribute, a location attribute.

In some embodiments, step 120 may be implemented by the embodiment in fig. 2.

Fig. 2 illustrates a flow diagram of some embodiments of step 120 in fig. 1.

As shown in fig. 2, step 120 includes: step 1210, acquiring an occupancy control ID; and step 1220, obtain the correlation attributes.

In step 1210, in response to the Web page load, the identification ID of the placeholder control is obtained.

In step 1220, the associated properties of the placeholder control are obtained according to the ID of the placeholder control.

In some embodiments, the Web page is loaded by using a callback method, and then the relevant attribute corresponding to the ID of the placeholder control is acquired by using the JS.

In some embodiments, when the Webview control of the mobile App loads the Web page, in the callback method for completing page loading, the JS is executed to obtain attributes such as the size and the position of the div corresponding to the safenputid. For example, the callback method may be onPageFinishd (WebView view, String url).

After the correlation attributes are obtained, the remaining steps in FIG. 1 may be utilized to generate a data entry box.

In step 130, the Native secure input control is rendered to the corresponding position of the Web page according to the relevant attributes to generate a data input box. For example, the Native security input control is initialized according to the size attribute of the div, and the WebView loads the Native security input control according to the position attribute of the div.

In some embodiments, Native security input controls are rendered to corresponding locations of a Web page using the addView method of the WebView control. For example, according to the acquired related attributes, setting the position, size and the like of a Native security input control; and rendering the Native security input control to the div position corresponding to the safe input contained in the Web page by using an addView method of the WebView control.

In some embodiments, the data input box may be utilized to obtain the data, and then the ciphertext of the data may be uploaded to the server.

Therefore, the function of directly loading the Native security input control in the Web page can be realized, and the security of input information is protected through the Native security input control.

In some embodiments, step 130 may be implemented using the embodiment in FIG. 3.

Fig. 3 illustrates a flow diagram of some embodiments of step 130 in fig. 1.

As shown in fig. 3, step 130 includes: step 1310, obtaining the change condition of the related attribute; and step 1320, rendering Native secure input controls.

In step 1310, changes to the associated properties of the placeholder control are obtained in response to the placeholder control moving.

In step 1320, the Native secure input control is rendered to the corresponding position of the Web page according to the change situation.

In some embodiments, the input box may be occupied by populating a div control with a safenputid ID in the Web page; loading a Web page by using WebView, and acquiring attributes such as the position, the size and the like of a div control with the ID of safeinputid; after the Native safety input control is initialized according to the size of the div, monitoring the position movement of the div; WebView loads Native security input control according to the monitoring result; and rendering and displaying the Native security input control on the Web page.

Fig. 4 illustrates a block diagram of some embodiments of a data entry box generation apparatus of the present disclosure.

As shown in fig. 4, the generation apparatus 4 of the data input box includes a padding unit 41, an acquisition unit 42, and a rendering unit 43.

The filling unit 41 fills the placeholder control on the Web page according to the position of the data input box to be generated on the Web page.

The obtaining unit 42 obtains the relevant attribute of the placeholder control in response to the Web page loading.

The rendering unit 43 renders the Native secure input control to a corresponding position of the Web page according to the relevant attribute to generate a data input box.

In some embodiments, the obtaining unit 42 obtains the ID of the placeholder control in response to the Web page loading; and acquiring the related attribute of the occupancy control according to the ID of the occupancy control.

In some embodiments, the obtaining unit 42 loads the Web page by using a callback method, and obtains the relevant attribute corresponding to the ID of the placeholder control by using JS.

In some embodiments, the rendering unit 43 renders Native secure input controls to corresponding locations of the Web page using the addView method of the WebView control.

In some embodiments, the obtaining unit 42 obtains the change condition of the related attribute of the placeholder control in response to the movement of the placeholder control; the rendering unit 43 renders the Native secure input control to the corresponding position of the Web page according to the change situation.

In some embodiments, the placeholder control is a div control or an input control. The correlation attributes include a size attribute and a position attribute.

In some embodiments, the generating means 4 further comprises: and an uploading unit 44, configured to upload the ciphertext of the data acquired by the acquiring unit 42 using the data input box to the server.

FIG. 5 illustrates a block diagram of further embodiments of an apparatus for generating a data input box of the present disclosure.

As shown in fig. 5, the generation apparatus 5 of the data input box of this embodiment includes: a memory 51 and a processor 52 coupled to the memory 51, the processor 52 being configured to execute a method of generating a data input box in any one of the embodiments of the present disclosure based on instructions stored in the memory 51.

The memory 51 may include, for example, a system memory, a fixed nonvolatile storage medium, and the like. The system memory stores, for example, an operating system, an application program, a Boot Loader (Boot Loader), a database, and other programs.

FIG. 6 illustrates a block diagram of still further embodiments of an apparatus for generating a data input box of the present disclosure.

As shown in fig. 6, the generation device 6 of the data input box of this embodiment includes: a memory 610 and a processor 620 coupled to the memory 610, wherein the processor 620 is configured to execute the method for generating a data input box in any of the above embodiments based on instructions stored in the memory 610.

The memory 610 may include, for example, system memory, fixed non-volatile storage media, and the like. The system memory stores, for example, an operating system, an application program, a Boot Loader (Boot Loader), and other programs.

The data input box generation apparatus 6 may further include an input-output interface 630, a network interface 640, a storage interface 650, and the like. These interfaces 630, 640, 650 and the connections between the memory 610 and the processor 620 may be through a bus 660, for example. The input/output interface 630 provides a connection interface for input/output devices such as a display, a mouse, a keyboard, a touch screen, a microphone, and a sound box. The network interface 640 provides a connection interface for various networking devices. The storage interface 650 provides a connection interface for external storage devices such as an SD card and a usb disk.

As will be appreciated by one skilled in the art, embodiments of the present disclosure may be provided as a method, system, or computer program product. Accordingly, the present disclosure may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present disclosure may take the form of a computer program product embodied on one or more computer-usable non-transitory storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.

Up to this point, the method of generating a data input box, the apparatus for generating a data input box, and the non-volatile computer-readable storage medium according to the present disclosure have been described in detail. Some details that are well known in the art have not been described in order to avoid obscuring the concepts of the present disclosure. It will be fully apparent to those skilled in the art from the foregoing description how to practice the presently disclosed embodiments.

The method and system of the present disclosure may be implemented in a number of ways. For example, the methods and systems of the present disclosure may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above-described order for the steps of the method is for illustration only, and the steps of the method of the present disclosure are not limited to the order specifically described above unless specifically stated otherwise. Further, in some embodiments, the present disclosure may also be embodied as programs recorded in a recording medium, the programs including machine-readable instructions for implementing the methods according to the present disclosure. Thus, the present disclosure also covers a recording medium storing a program for executing the method according to the present disclosure.

Although some specific embodiments of the present disclosure have been described in detail by way of example, it should be understood by those skilled in the art that the foregoing examples are for purposes of illustration only and are not intended to limit the scope of the present disclosure. It will be appreciated by those skilled in the art that modifications may be made to the above embodiments without departing from the scope and spirit of the present disclosure. The scope of the present disclosure is defined by the appended claims.

11页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:显示终端的输入控制方法、装置、设备、系统和存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类