Code conversion method, device and computer equipment based on verification image

Through the code conversion method based on verification pictures, virtual filter paper is generated and converted, the problem of traditional code taking into account security and convenience is solved, the efficient security and convenience of the code is achieved, and the visualization of development is improved. and verification speed.

CN111580823BActive Publication Date: 2025-01-14CHINA PING AN PROPERTY INSURANCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010238714.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-03-30
Publication Date
2025-01-14
Estimated Expiration
2040-03-30

AI Technical Summary

Technical Problem

Traditional core codes are difficult to take into account both security and convenience. If security is improved, it will be inconvenient to transform. If convenience is improved, security will decrease.

Method used

Using a code conversion method based on verification pictures, by obtaining the input code conversion instructions carrying verification pictures, perform pixel point detection, generate virtual filter paper, and filter the virtual liquid, and calculate the distance value between the gap and the preset position. Gets the specified annotation and field locations, annotates the conversion rules and codes.

Benefits of technology

It improves the security and convenience of the code, realizes visualization, controllability, accuracy and verification speed in code conversion, and supports the further development of the original code by multiple developers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111580823B_ABST
    Figure CN111580823B_ABST
Patent Text Reader

Abstract

The present application discloses a code conversion method, device, computer equipment and storage medium based on a verification image, the method comprising: obtaining an input code conversion instruction carrying a verification image, and obtaining the RGB channel color values ​​of all pixels in the verification image; using the RGB channel color values ​​to generate a virtual filter paper in a virtual space; using the virtual filter paper to filter the virtual liquid until a gap appears in the virtual filter paper; calculating the distance value between the gap and the preset position; obtaining a specified annotation and a specified field position corresponding to the distance value, wherein the specified annotation records the conversion rule of the specified field; marking the specified field position in the initial code with a specified annotation to obtain an intermediate code; and converting the specified field in the intermediate code. This improves the security and convenience of the code, realizes the visualization of the verification process in the code conversion, and improves the controllability, accuracy and verification speed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the computer field, and in particular to a code conversion method, device, computer equipment and storage medium based on a verification image. Background Art

[0002] Code is the basis for computer control implementation. Computer developers write code to enable computers to complete different computer tasks. Among them, there is a problem that information security and convenience cannot be achieved simultaneously in traditional core codes. Specifically, if the core code allows multiple copies, it is easy for computer developers to modify the core code, which improves convenience, but relatively speaking, the core code is easy to leak and security is reduced; if the core code does not allow copies, then the security is relatively high, but it is not convenient for computer developers to modify the core code, and convenience is reduced. Therefore, the security and convenience of traditional core codes need to be improved. Summary of the invention

[0003] The main purpose of this application is to provide a code conversion method, device, computer equipment and storage medium based on verification images, aiming to improve the security and convenience of the code.

[0004] In order to achieve the above-mentioned invention object, the present application proposes a code conversion method based on a verification picture, comprising the following steps:

[0005] Obtain an input code conversion instruction carrying a verification picture, and perform pixel detection on the verification picture to obtain RGB channel color values ​​of all pixels in the verification picture;

[0006] According to a preset filter paper generation method, the RGB channel color values ​​are used to generate virtual filter paper in a virtual space, wherein the thickness of the virtual filter paper is uneven;

[0007] Using the virtual filter paper to evenly filter the preset virtual liquid at least once until a gap appears in the virtual filter paper, wherein each filtering process consumes a portion of the virtual filter paper of the same volume;

[0008] Calculating the distance between the notch and the preset position;

[0009] According to the preset correspondence between the distance, the annotation and the field position, obtaining the specified annotation and the specified field position corresponding to the distance value, wherein the specified annotation records the conversion rule of the specified field;

[0010] Marking the specified annotation at the specified field position in the preset original code, thereby obtaining the intermediate code;

[0011] According to the conversion rule, the designated field in the intermediate code is converted.

[0012] Furthermore, the verification image includes a first pixel point, a second pixel point, ..., and an nth pixel point, and the step of generating a virtual filter paper in a virtual space by using the RGB channel color value according to a preset filter paper generating method includes:

[0013] Retrieving a preset filter paper template, and dividing the filter paper template into 256 grids according to a preset grid division method, wherein the filter paper template has a uniform thickness;

[0014] According to the RGB channel color values ​​(R1, G1, B1), (R2, G2, B2), ..., (Rn, Gn, Bn) of the first pixel point, the second pixel point, ..., the nth pixel point, the filter paper template is subjected to a first thickness increase process, a second thickness increase process, ..., and an nth thickness increase process; wherein the first thickness increase process refers to increasing the preset thickness to the R1th grid, the G1th grid, and the B1th grid; the second thickness increase process refers to increasing the preset thickness to the R2th grid, the G2th grid, and the B2th grid; ...; the nth thickness increase process refers to increasing the preset thickness to the Rnth grid, the Gnth grid, and the Bnth grid; thereby obtaining an intermediate filter paper;

[0015] Determining whether the thickness of the thinnest part of the intermediate filter paper is the same as the thickness of the filter paper template;

[0016] If the thickness of the thinnest part of the intermediate filter paper is different from the thickness of the filter paper template, the intermediate filter paper is recorded as the virtual filter paper.

[0017] Furthermore, the step of retrieving a preset filter paper template and dividing the filter paper template into 256 grids according to a preset grid division method includes:

[0018] Drawing a spiral line on the filter paper template, wherein the center of the spiral line coincides with the center of the filter paper template;

[0019] The filter paper template is divided into 256 grids on the principle that the center of the grid coincides with the spiral line, and the center of the first grid, the center of the second grid, ... the center of the 256th grid are successively away from the center of the spiral line, wherein the areas of the 256 grids are different.

[0020] Further, the filter paper template is configured such that: the longer the contact time between the filter paper template and the virtual liquid is, the darker the color of the contact portion between the filter paper template and the virtual liquid is, and the step of using the virtual filter paper to uniformly filter the preset virtual liquid at least once until a gap appears in the virtual filter paper comprises:

[0021] Using the virtual filter paper to evenly filter the preset virtual liquid at least once, and detecting the color of the filter paper template in real time;

[0022] When a part of the filter paper template is detected to be discolored, the filtering process is stopped, and the position where the discoloration occurs is recorded as the position of the gap of the virtual filter paper.

[0023] Furthermore, the gap exists in multiple locations, and the step of calculating the distance value between the gap and the preset position includes:

[0024] Performing clustering processing on all the gaps, thereby dividing all the gaps into multiple categories;

[0025] Selecting a designated category from the plurality of categories, wherein the number of members of the designated category is greater than the number of members of other categories;

[0026] Obtaining the cluster center of the specified classification, and calculating the distance between the cluster center and the center of the virtual filter paper;

[0027] The distance between the cluster center and the center of the virtual filter paper is recorded as the distance value between the notch and the preset position.

[0028] Furthermore, the designated annotation records a designated link, the designated link is linked to a preset mapping table, and the step of converting the designated field in the intermediate code according to the conversion rule includes:

[0029] Obtaining the value of the specified field, and obtaining the mapping table through the specified link;

[0030] Obtaining a specified key-value pair from the mapping table, wherein the value of the key in the specified key-value pair is equal to the value of the specified field;

[0031] The value in the specified key-value pair is used as the conversion result of the conversion process on the specified field.

[0032] The present application provides a code conversion device based on a verification picture, comprising:

[0033] A code conversion instruction acquisition unit is used to acquire an input code conversion instruction carrying a verification picture, and perform pixel detection on the verification picture to obtain RGB channel color values ​​of all pixels in the verification picture;

[0034] A virtual filter paper generating unit, configured to generate virtual filter paper in a virtual space by using the RGB channel color values ​​according to a preset filter paper generating method, wherein the thickness of the virtual filter paper is uneven;

[0035] A filtering processing unit, used to use the virtual filter paper to perform at least one uniform filtering process on the preset virtual liquid until a gap appears in the virtual filter paper, wherein each filtering process consumes a portion of the virtual filter paper of the same volume;

[0036] A distance value calculation unit, used to calculate the distance value between the notch and a preset position;

[0037] A designated annotation acquisition unit, used for acquiring a designated annotation and a designated field position corresponding to the distance value according to a preset correspondence relationship between the distance, the annotation and the field position, wherein the designated annotation records a conversion rule of the designated field;

[0038] An intermediate code acquisition unit is used to mark the specified annotation at the specified field position in the preset original code, so as to obtain the intermediate code;

[0039] A conversion processing unit is used to convert the specified field in the intermediate code according to the conversion rule.

[0040] Furthermore, the verification image includes a first pixel point, a second pixel point, ..., an nth pixel point, and the virtual filter paper generating unit includes:

[0041] A grid division subunit, used to call a preset filter paper template and divide the filter paper template into 256 grids according to a preset grid division method, wherein the filter paper template has a uniform thickness;

[0042] The thickness increase processing subunit is used to perform a first thickness increase processing, a second thickness increase processing, ..., and an nth thickness increase processing on the filter paper template according to the RGB channel color values ​​(R1, G1, B1), (R2, G2, B2), ..., (Rn, Gn, Bn) of the first pixel point, the second pixel point, ..., and the nth pixel point; wherein the first thickness increase processing refers to increasing the preset thickness of the R1th grid, the G1th grid, and the B1th grid; the second thickness increase processing refers to increasing the preset thickness of the R2th grid, the G2th grid, and the B2th grid; ...; the nth thickness increase processing refers to increasing the preset thickness of the Rnth grid, the Gnth grid, and the Bnth grid; thereby obtaining an intermediate filter paper;

[0043] A thickness judgment subunit, used to judge whether the thickness of the thinnest part of the intermediate filter paper is the same as the thickness of the filter paper template;

[0044] The virtual filter paper marking subunit is used to mark the intermediate filter paper as the virtual filter paper if the thickness of the thinnest part of the intermediate filter paper is different from the thickness of the filter paper template.

[0045] The present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any one of the above methods when executing the computer program.

[0046] The present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of any of the above-mentioned methods are implemented.

[0047] The code conversion method, device, computer equipment and storage medium based on the verification image of the present application obtain the input code conversion instruction carrying the verification image, and obtain the RGB channel color values ​​of all pixels in the verification image; use the RGB channel color values ​​to generate virtual filter paper in the virtual space; use the virtual filter paper to filter the preset virtual liquid at least once uniformly until a gap appears in the virtual filter paper; calculate the distance value between the gap and the preset position; obtain the specified annotation and the specified field position corresponding to the distance value, wherein the specified annotation records the conversion rule of the specified field; mark the specified annotation at the specified field position in the preset original code to obtain the intermediate code; according to the conversion rule, convert the specified field in the intermediate code. Thereby improving the security and convenience of the code, realizing the visualization of the verification process in the code conversion, and improving the controllability, accuracy and verification speed. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1A schematic diagram of a flow chart of a code conversion method based on a verification image according to an embodiment of the present application;

[0049] Figure 2 This is a schematic block diagram of the structure of a code conversion device based on a verification image according to an embodiment of the present application;

[0050] Figure 3 A schematic block diagram of the structure of a computer device according to an embodiment of the present application.

[0051] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0052] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0053] Reference Figure 1 The embodiment of the present application provides a code conversion method based on a verification image, comprising the following steps:

[0054] S1. Obtain an input code conversion instruction carrying a verification picture, and perform pixel detection on the verification picture to obtain RGB channel color values ​​of all pixels in the verification picture;

[0055] S2. According to a preset filter paper generation method, using the RGB channel color values, generating a virtual filter paper in a virtual space, wherein the thickness of the virtual filter paper is uneven;

[0056] S3, using the virtual filter paper to uniformly filter the preset virtual liquid at least once until a gap appears in the virtual filter paper, wherein each filtering process consumes a portion of the virtual filter paper of the same volume;

[0057] S4, calculating the distance between the notch and the preset position;

[0058] S5. According to the preset correspondence between the distance, the annotation, and the field position, obtaining the designated annotation and the designated field position corresponding to the distance value, wherein the designated annotation records the conversion rule of the designated field;

[0059] S6. marking the designated annotation at the designated field position in the preset original code, thereby obtaining the intermediate code;

[0060] S7. According to the conversion rule, convert the designated field in the intermediate code.

[0061] This application performs code conversion in a specific way so that the original code performs different code conversion processing according to different verification pictures (i.e., converts different fields), so as to achieve further development of the original code by multiple computer developers (i.e., corresponding to multiple different verification pictures) while maintaining the original code unchanged (no copy of the original code is required), thereby comprehensively improving security and convenience. A special verification method is adopted, that is, a series of processes of verification picture-pixel point-virtual filter paper-gap-distance value-annotation, and the graphics on the verification picture are ignored during the verification process, and the focus is on the pixel point itself, so as to achieve visualization, controllability, accuracy of the verification process and improve the verification speed, which makes it possible for the original code of this application to support further development by multiple computer developers (i.e., clarify the annotation content of different developers, avoid mutual influence, and clarify the ownership relationship).

[0062] As described in step S1 above, the input code conversion instruction carrying the verification picture is obtained, and the verification picture is subjected to pixel detection to obtain the RGB channel color values ​​of all pixels in the verification picture. The picture is composed of pixels, and each pixel has a different color value, for example, each pixel has an RGB channel color value. For example, the RGB channel color value of pure white is (255, 255, 255). It should be noted that the verification method of the present application using the verification picture is different from the ordinary picture verification method. The ordinary picture verification method emphasizes the shape on the picture, but this is not the case in the present application. The graphics composed of the pixels in the verification picture in the present application do not affect the verification result, but the color value of the pixels does affect the verification result. The specific process is described in the subsequent steps.

[0063] As described in step S2 above, according to the preset filter paper generation method, the RGB channel color value is used to generate a virtual filter paper in the virtual space, wherein the thickness of the virtual filter paper is uneven. Wherein, the method of using the RGB channel color value to generate the virtual filter paper in the virtual space can be any feasible method, for example, the virtual filter paper is divided into three areas, the first area corresponds to the R channel color value, the second area corresponds to the G channel color value, and the third area corresponds to the B channel color value. When the R channel color value of a pixel point is greater than a preset value (for example, 128), the thickness of the first area increases by the thickness of the first value; when the G channel color value of a pixel point is greater than a preset value (for example, 128), the thickness of the second area increases by the thickness of the first value; when the B channel color value of a pixel point is greater than a preset value (for example, 128), the thickness of the third area increases by the thickness of the first value. Thus, the pixel points of the verification image are converted into virtual filter paper in the virtual space. At this time, the verification result is no longer related to the graphics in the verification image, but only to the color value of the pixel points in the verification image, and the abstract process of ordinary verification is concretized. The virtual filter paper can be generated in any feasible way, such as by an open source 3D modeling tool. In addition, the virtual filter paper has uneven thickness, so that the verification process in the code conversion of the present application can be realized.

[0064] As described in step S3 above, the virtual filter paper is used to perform at least one uniform filtering treatment on the preset virtual liquid until a gap appears in the virtual filter paper, wherein each filtering treatment consumes a portion of the virtual filter paper of the same volume. The virtual liquid is useful for consuming a portion of the virtual filter paper, and its generation method can be generated by any feasible method, such as by an open source 3D modeling tool. Since the virtual filter paper is of uneven thickness, after a sufficient filtering process, the virtual filter paper will preferentially have a gap at the thinnest part. The uniform filtering process means that during the filtering process, the thickness consumed in any area on the virtual filter paper is the same.

[0065] As described in step S4 above, the distance value between the notch and the preset position is calculated. The preset position may be any feasible position, such as the center position of the virtual filter paper. The distance value is the most direct basis for the verification process. The distance value between the notch and the preset position may be calculated in any feasible manner, such as constructing a coordinate system, obtaining the coordinate points of the notch and the coordinate points of the preset position, and then calculating the distance value according to the distance calculation formula.

[0066] As described in step S5 above, according to the preset correspondence between the distance and the annotation and field position, the designated annotation and the designated field position corresponding to the distance value are obtained, wherein the designated annotation records the conversion rule of the designated field. Different distance values ​​correspond to different annotations and field positions, thereby avoiding possible influences between multiple developers. For example, when the distance value is A, it corresponds to annotation a1 and field position a2 (i.e., the annotation and field position of developer a), so annotation a1 and field position a2 are used as designated annotations and designated field positions.

[0067] As described in step S6 above, the designated field position in the preset original code is marked with the designated annotation, thereby obtaining the intermediate code. After the designated field position is marked with the annotation, it indicates that the designated field needs to be converted, and its conversion rule is also recorded in the designated annotation. Therefore, when the computer detects the designated field marked with the designated annotation, it will convert the designated field according to the conversion rule in the designated annotation, thereby realizing further development of the original code.

[0068] As described in step S7 above, according to the conversion rule, the specified field in the intermediate code is converted. The conversion rule can be any feasible rule, such as value type conversion. The simplest example is to convert the value 1.00 to 1.0, or to convert the numerical format to text format. Furthermore, the specified annotation also defines 6 attributes: varName, oprType, objType, valType and valMap. The meanings of the 5 attributes are as follows: varName: mapping field name, used to mark the field name corresponding to the field after conversion. oprType: operation type, identifying the logical operator of the rule item, used to determine the operation performed during the conversion process. objType: object type, used to identify whether the specified field is a complex object or a simple object. When it is a simple object, the operation can be performed on the simple object. When it is a complex object (for example, there is a nested object), the internal object needs to be recursively parsed until the internal object is a simple object. valType: value type, used to determine the value method after the specified field is converted. valMap: value mapping table, used to obtain the converted mapping value according to the key-value pair. Thus, the computer converts the specified field according to the above five attributes. Further, the code conversion of the present application can be used in any feasible scenario, for example, it is applied to the code conversion of the core code based on the OGNL rule engine.

[0069] In one embodiment, the verification image includes a first pixel point, a second pixel point, ..., and an nth pixel point, and the step S2 of generating a virtual filter paper in a virtual space by using the RGB channel color value according to a preset filter paper generation method includes:

[0070] S201, calling a preset filter paper template, and dividing the filter paper template into 256 grids according to a preset grid division method, wherein the filter paper template has a uniform thickness;

[0071] S202, according to the RGB channel color values ​​(R1, G1, B1), (R2, G2, B2), ..., (Rn, Gn, Bn) of the first pixel point, the second pixel point, ..., the nth pixel point, perform a first thickness increase process, a second thickness increase process, ..., and an nth thickness increase process on the filter paper template; wherein the first thickness increase process refers to increasing the preset thickness of the R1th grid, the G1th grid, and the B1th grid; the second thickness increase process refers to increasing the preset thickness of the R2th grid, the G2th grid, and the B2th grid; ...; the nth thickness increase process refers to increasing the preset thickness of the Rnth grid, the Gnth grid, and the Bnth grid; thereby obtaining an intermediate filter paper;

[0072] S203, determining whether the thickness of the thinnest part of the intermediate filter paper is the same as the thickness of the filter paper template;

[0073] S204: If the thickness of the thinnest part of the intermediate filter paper is different from the thickness of the filter paper template, the intermediate filter paper is recorded as the virtual filter paper.

[0074] As described above, it is realized that according to the preset filter paper generation method, the RGB channel color value is used to generate the virtual filter paper in the virtual space. The present application adopts the method of dividing the filter paper template into 256 grids, wherein the filter paper template has a uniform thickness, so as to maximize the use of the pixel color value and improve the accuracy of verification. Among them, the first grid corresponds to the color value 0 (regardless of whether it is the R color value, the G color value or the B color value), until the 256th grid corresponds to the color value 255. Then, according to the RGB channel color values ​​(R1, G1, B1), (R2, G2, B2), ..., (Rn, Gn, Bn) of the first pixel point, the second pixel point, ..., the nth pixel point, the filter paper template is subjected to the first thickness increase process, the second thickness increase process, ..., and the nth thickness increase process. Thus, different thicknesses will be added to different grids of the filter paper template, thereby forming an intermediate filter paper with uneven thickness. Then determine whether the thickness of the thinnest part of the intermediate filter paper is the same as the thickness of the filter paper template to prevent the existence of a special case, that is, no thickness is added to some grids, which will affect the accuracy of the verification of this application. If the thickness of the thinnest part of the intermediate filter paper is not the same as the thickness of the filter paper template, it means that the generation of the virtual filter paper is completed. In this way, the 256 color values ​​are fully utilized and the accuracy of verification is improved.

[0075] In one embodiment, the step S201 of retrieving a preset filter paper template and dividing the filter paper template into 256 grids according to a preset grid division method includes:

[0076] S2011, drawing a spiral line on the filter paper template, wherein the center of the spiral line coincides with the center of the filter paper template;

[0077] S2012. Divide the filter paper template into 256 grids on the principle that the center of each grid coincides with the spiral line and the center of the first grid, the center of the second grid, ... the center of the 256th grid successively move away from the center of the spiral line, wherein the areas of the 256 grids are different.

[0078] As described above, the preset filter paper template is retrieved, and the filter paper template is divided into 256 grids according to the preset grid division method. The present application improves the accuracy and speed of subsequent distance value calculation by setting the spiral line. Since the center of the grid coincides with the spiral line, and the center of the first grid, the center of the second grid, ... the center of the 256th grid are successively away from the center of the spiral line, the distance between each grid and the center of the spiral line is different, so that there will be 256 distance values ​​between the gap and the preset position (at this time, the center of the spiral line is used as the preset position, and the gap is one of the 256 grids), which can be applied to 256 computer developers at the same time. Thereby improving the accuracy and speed of calculation and improving applicability.

[0079] In one embodiment, the filter paper template is configured such that the longer the contact time between the filter paper template and the virtual liquid is, the darker the color of the contact portion between the filter paper template and the virtual liquid is. The step S3 of using the virtual filter paper to uniformly filter the preset virtual liquid at least once until a gap appears in the virtual filter paper comprises:

[0080] S301, using the virtual filter paper to uniformly filter a preset virtual liquid at least once, and detecting the color of the filter paper template in real time;

[0081] S302: When it is detected that a part of the filter paper template changes color, the filtering process is stopped, and the position where the color changes occurs is recorded as the position of the gap of the virtual filter paper.

[0082] As described above, the virtual filter paper is used to perform at least one uniform filtering treatment on the preset virtual liquid until a gap appears in the virtual filter paper. The present application adopts a setting that the longer the contact time between the filter paper template and the virtual liquid, the darker the color of the contact part between the filter paper template and the virtual liquid, so as to quickly obtain the position of the gap. Generally, the determination of the position of the gap needs to be completed after the virtual filter paper is damaged. The present application realizes the pre-acquisition of the gap position through the special setting of the filter paper template, thereby improving the overall verification efficiency.

[0083] In one embodiment, the gap exists in multiple locations, and the step S4 of calculating the distance value between the gap and the preset position includes:

[0084] S401, clustering all the gaps, thereby classifying all the gaps into multiple categories;

[0085] S402, selecting a designated category from the multiple categories, wherein the number of members of the designated category is greater than the number of members of other categories;

[0086] S403, obtaining the cluster center of the specified classification, and calculating the distance between the cluster center and the center of the virtual filter paper;

[0087] S404: Record the distance between the cluster center and the center of the virtual filter paper as the distance value between the notch and the preset position.

[0088] As described above, the distance value between the notch and the preset position is calculated. The present application adopts a method of clustering all the notches, thereby dividing all the notches into multiple categories; selecting a designated category from the multiple categories; obtaining the cluster center of the designated category, and calculating the distance between the cluster center and the center of the virtual filter paper to determine the distance value between the notch and the preset position, thereby avoiding the influence of possible interfering notches (for example, there are 11 notches, and the first 10 notches are in the same area, and the 11th notch is far away from the area, so the 11th notch is excluded, and the first 10 notches are used as the basis for distance calculation), thereby improving the calculation efficiency in an approximate calculation manner.

[0089] In one embodiment, the designated annotation records a designated link, the designated link is linked to a preset mapping table, and the step S7 of converting the designated field in the intermediate code according to the conversion rule includes:

[0090] S701, obtaining the value of the specified field, and obtaining the mapping table through the specified link;

[0091] S702: Obtain a specified key-value pair from the mapping table, wherein the value of the key in the specified key-value pair is equal to the value of the specified field;

[0092] S703: Use the value in the specified key-value pair as a conversion result of the conversion process on the specified field.

[0093] As described above, the conversion processing of the designated fields in the intermediate code is realized according to the conversion rules. The fundamental purpose of this application is to improve the versatility of the original code, so the code conversion is only performed on some fields in the original code, that is, only the designated fields marked with the designated annotations are converted. Then, the designated link method is adopted to obtain the mapping table through the designated link; obtain the designated key-value pair from the mapping table; and use the value of the value in the designated key-value pair as the conversion result of the conversion processing of the designated field. Therefore, when developing (converting) the designated field, it is only necessary to modify the value of the value in the designated key-value pair in the mapping table, thereby improving convenience and efficiency.

[0094] The code conversion method based on the verification picture of the present application obtains the input code conversion instruction carrying the verification picture, and obtains the RGB channel color values ​​of all pixels in the verification picture; uses the RGB channel color values ​​to generate virtual filter paper in the virtual space; uses the virtual filter paper to filter the preset virtual liquid at least once uniformly until a gap appears in the virtual filter paper; calculates the distance value between the gap and the preset position; obtains the specified annotation and the specified field position corresponding to the distance value, wherein the specified annotation records the conversion rule of the specified field; marks the specified annotation at the specified field position in the preset original code, thereby obtaining the intermediate code; and converts the specified field in the intermediate code according to the conversion rule. Thereby improving the security and convenience of the code, realizing the visualization of the verification process in the code conversion, and improving the controllability, accuracy and verification speed.

[0095] Reference Figure 2 The embodiment of the present application provides a code conversion device based on a verification picture, comprising:

[0096] The code conversion instruction acquisition unit 10 is used to acquire the input code conversion instruction carrying the verification picture, and perform pixel detection on the verification picture to obtain the RGB channel color values ​​of all pixels in the verification picture;

[0097] A virtual filter paper generating unit 20, configured to generate a virtual filter paper in a virtual space by using the RGB channel color values ​​according to a preset filter paper generating method, wherein the thickness of the virtual filter paper is uneven;

[0098] A filtering processing unit 30, configured to use the virtual filter paper to perform at least one uniform filtering process on the preset virtual liquid until a gap appears in the virtual filter paper, wherein each filtering process consumes a portion of the virtual filter paper of the same volume;

[0099] A distance value calculation unit 40 is used to calculate the distance value between the notch and a preset position;

[0100] The designated annotation acquisition unit 50 is used to acquire the designated annotation and the designated field position corresponding to the distance value according to the preset correspondence between the distance, the annotation and the field position, wherein the designated annotation records the conversion rule of the designated field;

[0101] The intermediate code acquisition unit 60 is used to mark the specified annotation at the specified field position in the preset original code, so as to obtain the intermediate code;

[0102] The conversion processing unit 70 is used to perform conversion processing on the designated field in the intermediate code according to the conversion rule.

[0103] The operations performed by the above units correspond one-to-one to the steps of the code conversion method based on the verification image in the aforementioned implementation method, and will not be repeated here.

[0104] In one embodiment, the verification image includes a first pixel point, a second pixel point, ..., an nth pixel point, and the virtual filter paper generating unit 20 includes:

[0105] A grid division subunit, used to call a preset filter paper template and divide the filter paper template into 256 grids according to a preset grid division method, wherein the filter paper template has a uniform thickness;

[0106] The thickness increase processing subunit is used to perform a first thickness increase processing, a second thickness increase processing, ..., and an nth thickness increase processing on the filter paper template according to the RGB channel color values ​​(R1, G1, B1), (R2, G2, B2), ..., (Rn, Gn, Bn) of the first pixel point, the second pixel point, ..., and the nth pixel point; wherein the first thickness increase processing refers to increasing the preset thickness of the R1th grid, the G1th grid, and the B1th grid; the second thickness increase processing refers to increasing the preset thickness of the R2th grid, the G2th grid, and the B2th grid; ...; the nth thickness increase processing refers to increasing the preset thickness of the Rnth grid, the Gnth grid, and the Bnth grid; thereby obtaining an intermediate filter paper;

[0107] A thickness judgment subunit, used to judge whether the thickness of the thinnest part of the intermediate filter paper is the same as the thickness of the filter paper template;

[0108] The virtual filter paper marking subunit is used to mark the intermediate filter paper as the virtual filter paper if the thickness of the thinnest part of the intermediate filter paper is different from the thickness of the filter paper template.

[0109] The operations performed by the above sub-units correspond one-to-one to the steps of the code conversion method based on the verification image in the aforementioned implementation method, and will not be repeated here.

[0110] In one embodiment, the grid division subunit includes:

[0111] A spiral line drawing module, used for drawing a spiral line on the filter paper template, wherein the center of the spiral line coincides with the center of the filter paper template;

[0112] The grid division module is used to divide the filter paper template into 256 grids on the principle that the center of each grid coincides with the spiral line and the center of the first grid, the center of the second grid, ... the center of the 256th grid successively moves away from the center of the spiral line, wherein the areas of the 256 grids are different.

[0113] The operations performed by the above modules respectively correspond one-to-one to the steps of the code conversion method based on the verification image in the aforementioned implementation method, and will not be repeated here.

[0114] In one embodiment, the filter paper template is configured such that: the longer the contact time between the filter paper template and the virtual liquid is, the darker the color of the contact portion between the filter paper template and the virtual liquid is. The filtering processing unit 30 includes:

[0115] A real-time detection subunit, used to use the virtual filter paper to perform at least one uniform filtering process on the preset virtual liquid, and to perform real-time detection on the color of the filter paper template;

[0116] The notch position marking subunit is used to stop the filtering process when a part of the filter paper template is detected to be discolored, and to record the discolored position as the notch position of the virtual filter paper.

[0117] The operations performed by the above sub-units correspond one-to-one to the steps of the code conversion method based on the verification image in the aforementioned implementation method, and will not be repeated here.

[0118] In one embodiment, the gap exists in multiple places, and the distance value calculation unit 40 includes:

[0119] A clustering processing subunit, used for performing clustering processing on all the gaps, thereby dividing all the gaps into multiple categories;

[0120] A designated category acquisition subunit, used to select a designated category from the multiple categories, wherein the number of members of the designated category is greater than the number of members of other categories;

[0121] A cluster center acquisition subunit, used to acquire the cluster center of the specified classification and calculate the distance between the cluster center and the center of the virtual filter paper;

[0122] The distance value marking subunit is used to record the distance between the cluster center and the center of the virtual filter paper as the distance value between the notch and the preset position.

[0123] The operations performed by the above sub-units correspond one-to-one to the steps of the code conversion method based on the verification image in the aforementioned implementation method, and will not be repeated here.

[0124] In one embodiment, the specified annotation records a specified link, and the specified link is linked to a preset mapping table. The conversion processing unit 70 includes:

[0125] A mapping table acquisition subunit, used to acquire the value of the specified field and acquire the mapping table through the specified link;

[0126] A designated key-value pair obtaining subunit, used to obtain a designated key-value pair from the mapping table, wherein the value of the key in the designated key-value pair is equal to the value of the designated field;

[0127] The conversion result acquisition subunit is used to take the value in the specified key-value pair as the conversion result of the conversion processing on the specified field.

[0128] The operations performed by the above sub-units correspond one-to-one to the steps of the code conversion method based on the verification image in the aforementioned implementation method, and will not be repeated here.

[0129] The code conversion device based on the verification picture of the present application obtains the input code conversion instruction carrying the verification picture, and obtains the RGB channel color values ​​of all pixels in the verification picture; uses the RGB channel color values ​​to generate virtual filter paper in the virtual space; uses the virtual filter paper to filter the preset virtual liquid at least once uniformly until a gap appears in the virtual filter paper; calculates the distance value between the gap and the preset position; obtains the specified annotation and the specified field position corresponding to the distance value, wherein the specified annotation records the conversion rule of the specified field; marks the specified annotation at the specified field position in the preset original code, thereby obtaining the intermediate code; and converts the specified field in the intermediate code according to the conversion rule. Thereby improving the security and convenience of the code, realizing the visualization of the verification process in the code conversion, and improving the controllability, accuracy and verification speed.

[0130] Reference Figure 3 In an embodiment of the present invention, a computer device is also provided, which may be a server, and its internal structure may be as shown in the figure. The computer device includes a processor, a memory, a network interface and a database connected via a system bus. Among them, the processor designed by the computer is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data used in a code conversion method based on a verification image. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a code conversion method based on a verification image is implemented.

[0131] The above-mentioned processor executes the above-mentioned code conversion method based on the verification image, wherein the steps included in the method correspond one-to-one to the steps of executing the code conversion method based on the verification image in the aforementioned implementation method, and are not repeated here.

[0132] Those skilled in the art will appreciate that the structure shown in the figure is merely a block diagram of a portion of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied.

[0133] The computer device of the present application obtains the input code conversion instruction carrying the verification picture, and obtains the RGB channel color values ​​of all pixels in the verification picture; uses the RGB channel color values ​​to generate virtual filter paper in the virtual space; uses the virtual filter paper to filter the preset virtual liquid at least once uniformly until a gap appears in the virtual filter paper; calculates the distance value between the gap and the preset position; obtains the specified annotation and the specified field position corresponding to the distance value, wherein the specified annotation records the conversion rule of the specified field; marks the specified annotation at the specified field position in the preset original code, thereby obtaining the intermediate code; and converts the specified field in the intermediate code according to the conversion rule. Thereby improving the security and convenience of the code, realizing the visualization of the verification process in the code conversion, and improving the controllability, accuracy and verification speed.

[0134] An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, a code conversion method based on a verification image is implemented. The steps included in the method correspond one-to-one to the steps of executing the code conversion method based on a verification image in the aforementioned implementation method, and are not repeated here.

[0135] The computer-readable storage medium of the present application obtains the input code conversion instruction carrying the verification picture, and obtains the RGB channel color values ​​of all pixels in the verification picture; uses the RGB channel color values ​​to generate virtual filter paper in the virtual space; uses the virtual filter paper to filter the preset virtual liquid at least once uniformly until a gap appears in the virtual filter paper; calculates the distance value between the gap and the preset position; obtains the specified annotation and the specified field position corresponding to the distance value, wherein the specified annotation records the conversion rule of the specified field; marks the specified annotation at the specified field position in the preset original code, thereby obtaining the intermediate code; and converts the specified field in the intermediate code according to the conversion rule. Thereby improving the security and convenience of the code, realizing the visualization of the verification process in the code conversion, and improving the controllability, accuracy and verification speed.

[0136] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media provided in this application and used in the embodiments may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0137] 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, device, article or method 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, device, article or method. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, device, article or method including the element.

[0138] The above description is only a preferred embodiment of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A code conversion method based on a verification image, characterized in that: include: Obtain an input code conversion instruction carrying a verification picture, and perform pixel detection on the verification picture to obtain RGB channel color values ​​of all pixels in the verification picture; According to a preset filter paper generation method, the RGB channel color values ​​are used to generate virtual filter paper in a virtual space, wherein the thickness of the virtual filter paper is uneven; Using the virtual filter paper to evenly filter the preset virtual liquid at least once until a gap appears in the virtual filter paper, wherein each filtering process consumes a portion of the virtual filter paper of the same volume; Calculating the distance between the notch and the preset position; According to the preset correspondence between the distance, the annotation and the field position, obtaining the specified annotation and the specified field position corresponding to the distance value, wherein the specified annotation records the conversion rule of the specified field; Marking the specified annotation at the specified field position in the preset original code, thereby obtaining the intermediate code; According to the conversion rule, converting the specified field in the intermediate code; The verification image includes a first pixel point, a second pixel point, ..., and an nth pixel point. The step of generating a virtual filter paper in a virtual space by using the RGB channel color value according to a preset filter paper generating method includes: Retrieving a preset filter paper template, and dividing the filter paper template into 256 grids according to a preset grid division method, wherein the filter paper template has a uniform thickness; According to the RGB channel color values ​​(R1, G1, B1), (R2, G2, B2), ..., (Rn, Gn, Bn) of the first pixel point, the second pixel point, ..., the nth pixel point, the filter paper template is subjected to a first thickness increase process, a second thickness increase process, ..., and an nth thickness increase process; wherein the first thickness increase process refers to increasing the preset thickness to the R1th grid, the G1th grid, and the B1th grid; the second thickness increase process refers to increasing the preset thickness to the R2th grid, the G2th grid, and the B2th grid; ...; the nth thickness increase process refers to increasing the preset thickness to the Rnth grid, the Gnth grid, and the Bnth grid; thereby obtaining an intermediate filter paper; Determining whether the thickness of the thinnest part of the intermediate filter paper is the same as the thickness of the filter paper template; If the thickness of the thinnest part of the intermediate filter paper is different from the thickness of the filter paper template, the intermediate filter paper is recorded as the virtual filter paper.

2. The code conversion method based on the verification image according to claim 1 is characterized in that: The step of retrieving a preset filter paper template and dividing the filter paper template into 256 grids according to a preset grid division method comprises: Drawing a spiral line on the filter paper template, wherein the center of the spiral line coincides with the center of the filter paper template; The filter paper template is divided into 256 grids on the principle that the center of the grid coincides with the spiral line, and the center of the first grid, the center of the second grid, ... the center of the 256th grid are successively away from the center of the spiral line, wherein the areas of the 256 grids are different.

3. The code conversion method based on verification image according to claim 1 is characterized in that: The filter paper template is configured such that: the longer the contact time between the filter paper template and the virtual liquid is, the darker the color of the contact portion between the filter paper template and the virtual liquid is. The step of using the virtual filter paper to uniformly filter the preset virtual liquid at least once until a gap appears in the virtual filter paper comprises: Using the virtual filter paper to evenly filter the preset virtual liquid at least once, and detecting the color of the filter paper template in real time; When a part of the filter paper template is detected to be discolored, the filtering process is stopped, and the position where the discoloration occurs is recorded as the position of the gap of the virtual filter paper.

4. The code conversion method based on verification image according to claim 1 is characterized in that: The gap exists in multiple locations, and the step of calculating the distance value between the gap and the preset position includes: Performing clustering processing on all the gaps, thereby dividing all the gaps into multiple categories; Selecting a designated category from the plurality of categories, wherein the number of members of the designated category is greater than the number of members of other categories; Obtaining the cluster center of the specified classification, and calculating the distance between the cluster center and the center of the virtual filter paper; The distance between the cluster center and the center of the virtual filter paper is recorded as the distance value between the notch and the preset position.

5. The code conversion method based on verification image according to claim 1 is characterized in that: The designated annotation records a designated link, and the designated link is linked to a preset mapping table. The step of converting the designated field in the intermediate code according to the conversion rule includes: Obtaining the value of the specified field, and obtaining the mapping table through the specified link; Obtaining a specified key-value pair from the mapping table, wherein the value of the key in the specified key-value pair is equal to the value of the specified field; The value in the specified key-value pair is used as the conversion result of the conversion process on the specified field.

6. A code conversion device based on a verification image, characterized in that: include: A code conversion instruction acquisition unit is used to acquire an input code conversion instruction carrying a verification picture, and perform pixel detection on the verification picture to obtain RGB channel color values ​​of all pixels in the verification picture; A virtual filter paper generating unit, configured to generate virtual filter paper in a virtual space by using the RGB channel color values ​​according to a preset filter paper generating method, wherein the thickness of the virtual filter paper is uneven; A filtering processing unit, used to use the virtual filter paper to perform at least one uniform filtering process on the preset virtual liquid until a gap appears in the virtual filter paper, wherein each filtering process consumes a portion of the virtual filter paper of the same volume; A distance value calculation unit, used to calculate the distance value between the notch and a preset position; A designated annotation acquisition unit, used for acquiring a designated annotation and a designated field position corresponding to the distance value according to a preset correspondence relationship between the distance, the annotation and the field position, wherein the designated annotation records a conversion rule of the designated field; An intermediate code acquisition unit is used to mark the specified annotation at the specified field position in the preset original code, so as to obtain the intermediate code; A conversion processing unit, used for performing conversion processing on the specified field in the intermediate code according to the conversion rule; The verification image includes a first pixel point, a second pixel point, ..., and an nth pixel point, and the virtual filter paper generating unit includes: A grid division subunit, used to call a preset filter paper template and divide the filter paper template into 256 grids according to a preset grid division method, wherein the filter paper template has a uniform thickness; The thickness increase processing subunit is used to perform a first thickness increase processing, a second thickness increase processing, ..., and an nth thickness increase processing on the filter paper template according to the RGB channel color values ​​(R1, G1, B1), (R2, G2, B2), ..., (Rn, Gn, Bn) of the first pixel point, the second pixel point, ..., and the nth pixel point; wherein the first thickness increase processing refers to increasing the preset thickness of the R1th grid, the G1th grid, and the B1th grid; the second thickness increase processing refers to increasing the preset thickness of the R2th grid, the G2th grid, and the B2th grid; ...; the nth thickness increase processing refers to increasing the preset thickness of the Rnth grid, the Gnth grid, and the Bnth grid; thereby obtaining an intermediate filter paper; A thickness judgment subunit, used to judge whether the thickness of the thinnest part of the intermediate filter paper is the same as the thickness of the filter paper template; The virtual filter paper marking subunit is used to mark the intermediate filter paper as the virtual filter paper if the thickness of the thinnest part of the intermediate filter paper is different from the thickness of the filter paper template.

7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Test paper detection card intelligent detection system and test paper detection card intelligent analysis method

    CN106546581A

  • Code generation method, device and equipment and storage medium

    CN109947431A