Coding processing method, device, electronic device and storage medium

By receiving the query request, the weights are queried according to the character position order of the target encoding and weighted sum, and matching the standard verification values ​​to query the database data, the problem of low data processing reliability in the real estate industry is solved, and the high reliability and data security of encoding query are achieved.

CN114168640BActive Publication Date: 2025-05-13CHINA CONSTRUCTION BANK +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111265908.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-28
Publication Date
2025-05-13
Estimated Expiration
2041-10-28

AI Technical Summary

Technical Problem

In the business transaction scenarios of the real estate industry, the reliability of data processing is low, which increases the probability of errors. How to improve the reliability of coding queries has become an important requirement.

Method used

By receiving the query request, the weights are queried according to the order of each character position in the target encoding, weighted sum is performed, and after matching the standard check value and the check bit value, the data is queried in the corresponding database and the query response is sent to the client.

Benefits of technology

It effectively avoids the risk of forgery of encoding and stealing data, and improves the reliability of encoding queries and data security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114168640B_ABST
    Figure CN114168640B_ABST
Patent Text Reader

Abstract

The present disclosure proposes a coding processing method, device, electronic device and storage medium, wherein the method comprises: receiving at least one query request carrying a first client identifier for requesting a query, a target code to be queried, and a code type to which the target code belongs; querying the weight of each character position according to the order of each character position in the target code; performing weighted summation on the values ​​at each character position in the target code except the check digit character according to the weight of each character position to obtain a weighted sum; when the standard check value corresponding to the weighted sum matches the value at the check digit in the target code, querying in a database corresponding to the code type to which the target code belongs according to the target code to obtain query data; and sending a query response carrying the query data to the corresponding client according to the first client identifier. The verification rules in the present disclosure can prevent counterfeiting of codes to steal data, thereby ensuring the security of data query.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] With the vigorous development of the real estate industry, a large number of commercial houses are in the market, including pre-sold commercial houses, existing commercial houses, etc., corresponding to different business transaction scenarios. In each business scenario, there are a large number of business queries and processing operations, which increases the probability of errors. Therefore, how to improve the reliability of data processing is crucial. Summary of the invention

[0003] The present disclosure provides a coding processing method, device, electronic device and storage medium, which improve the reliability of coding query.

[0004] The technical solution of the present disclosure is as follows:

[0005] According to a first aspect of an embodiment of the present disclosure, there is provided a coding processing method, including:

[0006] Receive at least one query request, wherein the query request carries a first client identifier requesting the query, a target code to be queried, and a code type to which the target code belongs;

[0007] According to the order of the positions of the characters in the target code, query the weight of each character position;

[0008] According to the weight of each character position, weighted sum is performed on the values ​​at each character position except the check bit character in the target code to obtain a weighted sum;

[0009] When the standard check value corresponding to the weighted sum matches the value on the check bit in the target code, querying in a database corresponding to the coding type to which the target code belongs according to the target code to obtain query data;

[0010] According to the first client identifier, a query response carrying the query data is sent to the corresponding client.

[0011] According to a second aspect of an embodiment of the present disclosure, there is provided a coding processing device, including:

[0012] A receiving module, configured to receive at least one query request, wherein the query request carries a first client identifier requesting the query, a target code to be queried, and a code type to which the target code belongs;

[0013] A query module, used for querying the weight of each character position according to the order of each character position in the target code;

[0014] A weighting module is used to perform weighted summation on the values ​​at each character position except the check bit character in the target code according to the weight of each character position to obtain a weighted sum;

[0015] A processing module, configured to query, according to the target code, a database corresponding to the coding type to which the target code belongs, to obtain query data when a standard check value corresponding to the weighted sum matches a value on a check digit in the target code;

[0016] A sending module is used to send a query response carrying the query data to a corresponding client according to the first client identifier.

[0017] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, including:

[0018] A processor; a memory for storing instructions executable by the processor;

[0019] The processor is configured to execute the instructions to implement the method as described in the first aspect.

[0020] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method described in the first aspect.

[0021] According to a fifth aspect of an embodiment of the present disclosure, there is provided a computer program product, comprising computer instructions, wherein when the computer instructions are executed by a processor, the method described in the first aspect is implemented.

[0022] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:

[0023] According to the order of the character positions in the target code, the weight of each character position is queried, and the corresponding standard check value is determined according to the weighted sum of the weights of each character position. When the standard check value matches the value on the pre-set check bit, the query data is fed back, avoiding counterfeiting of codes to steal data and improving the reliability of code-based query data.

[0024] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.

[0026] Figure 1 A schematic diagram of a flow chart of a coding processing method provided in the first embodiment of the present disclosure;

[0027] Figure 2 A schematic diagram of a flow chart of a coding processing method provided in the second embodiment of the present disclosure;

[0028] Figure 3 A schematic diagram of a flow chart of a coding processing method provided in the third embodiment of the present disclosure;

[0029] Figure 4 A schematic diagram of cache lock competition provided for the fourth embodiment of the present disclosure;

[0030] Figure 5 It is a block diagram of a coding processing device provided in the fifth embodiment of the present disclosure.

[0031] Figure 6 is a block diagram of an electronic device provided by an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION

[0032] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.

[0033] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0034] The following describes the encoding processing method, device, electronic device and storage medium according to the embodiments of the present disclosure with reference to the accompanying drawings.

[0035] Figure 1 A flowchart of a coding processing method provided by an embodiment of the present disclosure.

[0036] like Figure 1 As shown, the method comprises the following steps:

[0037] Step 101: Receive at least one query request.

[0038] The query request carries the first client identifier requesting the query, the target code to be queried, and the code type to which the target code belongs.

[0039] In the disclosed embodiment, the first client identifier is used to uniquely indicate the first client, and the first client can be an application installed on an electronic device, for example, a query information system. Among them, the target code to be queried can be generated based on the set coding rules and has a corresponding coding type. Among them, in different business scenarios, the target code can be generated based on different coding rules. For example, in the real estate field, the target code corresponding to the pre-sale license for commercial housing includes: business code-regional identification-year-sequence number-check code. For example, the first pre-sale license approved in Guangzhou in 2021 is numbered: 001-440100-2021-00001-X, where X is the check digit. Different types of target codes and coding rules will be described in detail in subsequent embodiments.

[0040] Step 102, query the weight of each character position according to the order of each character position in the target code.

[0041] In one implementation of the embodiment of the present disclosure, the weight of each character position in the target code is determined by querying based on a correspondence table between the order of each character position in the target code and the weight of each character position.

[0042] In one implementation of the embodiment of the present disclosure, the order of any character position in the target code is substituted into the formula Wi=2 (i-1) Mod N' to get the weight of a character position;

[0043] Wherein, i is the order of a character position, Wi is the weight of a character position, and N' is a second constant, and its value range is a positive integer. It should be noted that the value of N' can be determined according to relevant national standards.

[0044] For example, if N' is 11, if i is 3, that is, the position sequence of a character is 3, then Wi = 2 (3-1) Mod 11 = 4; if i is 9, that is, the position sequence of a character is 9, then Wi = 2 (9-1) Mod 11=3, not listed here one by one.

[0045] Taking a pre-sale license number of 001-440100-2021-00002-0 as an example, the weight of each character is calculated as shown in Table 1:

[0046] Table 1

[0047] Character Position Weight 1 1 2 2 3 4 4 8 5 5 6 10 7 9 8 7 9 3 10 6 11 1 12 2 13 4 14 8 15 5 16 10 17 9 18 7 19 3

[0048] Step 103, according to the weight of each character position, weighted sum is performed on the values ​​at each character position except the check bit character in the target code to obtain a weighted sum.

[0049] For example, a pre-sale license number is 001-440100-2021-00002-0, the first digit is 0, the second digit is 2, the 19th digit is 0, and the weighted sum is S. Then S is expressed as follows:

[0050] S=(0*3)+(0*7)+(1*9)+(4*10)+(4*5)+(0*8)+(1*4)+(0*2)+(0*1)+(2*6)+(0*3)+(2*7)+(1*9)+(0*10)+(0*5)+(0*8)+(0*4)+(2*2), the weighted sum is 112.

[0051] Step 104, when the standard check value corresponding to the weighted sum matches the value on the check bit in the target code, query is performed in the database corresponding to the coding type to which the target code belongs according to the target code to obtain query data.

[0052] In the disclosed embodiment, a correspondence between weighted and standard check values ​​can be set. According to the correspondence, the standard check value corresponding to the weighted sum can be determined. When the standard check value matches the value on the check bit in the target code, it means that the target code has passed the verification. Then, according to the target code, a query is performed in the database corresponding to the encoding type to which the target code belongs to obtain the query data. By setting the check bit and determining the standard check code based on the value of each character in the target code, the value on the check bit is verified according to the standard check code, thereby improving the reliability of the verification and avoiding counterfeit codes. Setting the database corresponding to the encoding type to which the target code belongs improves the efficiency of querying the query data.

[0053] Step 105: Send a query response carrying query data to the corresponding client according to the first client identifier.

[0054] Furthermore, after the query data is found, a query response carrying the query data is sent to the corresponding client according to the first client identifier, thereby avoiding malicious imitation of the target code to steal the query data corresponding to the target code, and improving data security.

[0055] In the encoding processing method of the embodiment of the present disclosure, at least one query request is received, wherein each query request carries a first client identifier for requesting the query, a target code to be queried, and a code type to which the target code belongs. According to the order of the character positions in the target code, the weights of the character positions are queried. According to the weights of the character positions, the values ​​at the character positions in the target code are weighted and summed to obtain a weighted sum. When the standard check value corresponding to the weighted sum matches the value at the check bit in the target code, according to the target code, a query is performed in a database corresponding to the code type to which the target code belongs to obtain query data. According to the first client identifier, a query response carrying the query data is sent to the corresponding client. In the present disclosure, the target code to be queried is verified according to the verification rules to avoid counterfeiting the code to steal data, thereby ensuring the security of data query.

[0056] Based on the above embodiments, the present disclosure provides another encoding processing method. Figure 2 A flowchart of another encoding processing method provided by an embodiment of the present disclosure is shown as follows: Figure 2 As shown, the method comprises the following steps:

[0057] Step 201: Receive at least one query request.

[0058] Each query request carries the first client identifier requesting the query, the target code to be queried, and the code type to which the target code belongs.

[0059] Step 202, query the weight of each character position according to the order of each character position in the target code.

[0060] Step 203, according to the weight of each character position, weighted sum is performed on the values ​​at each character position except the check bit character in the target code to obtain a weighted sum.

[0061] Steps 201 - 203 may refer to the explanations in the aforementioned embodiment, and the principles are the same, so they will not be repeated in this embodiment.

[0062] Step 204, performing modulo calculation based on the weighted sum to obtain a reference value.

[0063] In one implementation of the disclosed embodiment, the weighted sum is substituted into the formula Y=S Mod N to obtain a reference value; wherein S is the weighted sum, Y is the reference value, and N is a first constant whose value range is a positive integer. It should be noted that the value of N can be determined according to relevant national standards, and the value of N and the above-mentioned N' can be the same or different.

[0064] For example, the pre-sale license number is 001-440100-2021-00002-0, and the calculated S is 112 and N is 11, then Y=Mod(S,11)=112%11=2.

[0065] Step 205: query the corresponding relationship between the reference value and the check value according to the reference value to determine the standard check value corresponding to the weighted sum.

[0066] In the disclosed embodiment, according to the corresponding relationship between the reference value and the check value, the check value corresponding to the queried reference value 2 is 0, that is, the standard check value corresponding to the weighted sum 112 is 0.

[0067] Step 206, when the standard check value corresponding to the weighted sum matches the value on the check bit in the target code, query is performed in the database corresponding to the coding type to which the target code belongs according to the target code to obtain query data.

[0068] Step 207: Send a query response carrying the query data to the corresponding client according to the first client identifier.

[0069] Step 206 and step 207 can refer to the explanation in the above-mentioned embodiment, and the principles are the same, so they will not be repeated in this embodiment.

[0070] In the encoding processing method of the embodiment of the present disclosure, at least one query request is received, wherein each query request carries a first client identifier for requesting the query, a target code to be queried, and a code type to which the target code belongs. According to the order of the character positions in the target code, the weights of the character positions are queried. According to the weights of the character positions, the values ​​at the character positions in the target code are weighted and summed to obtain a weighted sum. When the standard check value corresponding to the weighted sum matches the value at the check bit in the target code, according to the target code, a query is performed in a database corresponding to the code type to which the target code belongs to obtain query data. According to the first client identifier, a query response carrying the query data is sent to the corresponding client. In the present disclosure, the target code to be queried is verified according to the verification rules to avoid counterfeiting the code to steal data, thereby ensuring the security of data query.

[0071] Based on the above embodiments, the present disclosure provides another encoding processing method. Figure 3 A flowchart of another encoding processing method provided by an embodiment of the present disclosure specifically illustrates how to ensure the uniqueness of each encoding when generating various encodings in a concurrent business scenario, such as Figure 3 As shown, the method comprises the following steps:

[0072] Step 301: Receive at least one distribution request.

[0073] Each distribution request carries a client identifier of the request code and a code type.

[0074] Among them, the client identification is used to uniquely indicate each client. In the field of real estate business, the client can be the information system of the Housing and Construction Bureau of each province, city (district, county).

[0075] In the embodiment of the present disclosure, when there are concurrent services, there may be at least one distribution request, and the at least one distribution request is generated by a corresponding client, requesting to generate a corresponding code.

[0076] Step 302: Allocate an idle thread in a thread pool to each distribution request to determine a to-be-executed thread corresponding to each distribution request.

[0077] like Figure 4 As shown, the thread pool includes multiple thread pools, and each distribution request can be assigned an idle thread, wherein distribution request 1 corresponds to thread 1, distribution request 2 corresponds to thread 2, and distribution request 3 corresponds to thread 3, wherein threads 1 to 3 are idle threads.

[0078] Step 303: determine the cache lock corresponding to each thread to be executed according to the region identifier included in the encoded content carried by each distribution request, so that each thread to be executed calls the target method respectively to compete for the corresponding cache lock.

[0079] In the disclosed embodiment, the region identifier included in the coding content and the cache lock corresponding to each thread to be executed have a corresponding relationship. After determining the cache lock corresponding to each thread to be executed, as an implementation method, the distributed lock setIfAbsent(key,value) method of the memory database Redis can be adopted to compete for the corresponding cache lock, wherein the key key and value value in the key-value pair indicate whether there is currently a thread occupying the cache lock. After the thread is executed, the cache lock is released, that is, the key is deleted, and a new key can be regenerated at this time; if the thread is not executed, the cache lock is not released, that is, the value corresponding to the key is not changed, thereby ensuring that only one thread can compete for the cache lock each time, that is, only one target thread can generate the target code, avoiding the repeated generation of the target code.

[0080] Step 304: Determine the target thread that competes for the cache lock from the threads to be executed.

[0081] Step 305, executing the target thread to query the corresponding encoding rule according to the encoding type carried by the distribution request corresponding to the target thread, and encoding according to the encoding rule to obtain the target encoding.

[0082] There are multiple encoding types, each with a corresponding encoding rule. Each encoding rule is used to indicate the encoding content, the order of the encoding content, and the number of character bits occupied by the encoding content. Thus, according to the encoding rule, the target encoding can be encoded, and based on the regional identifier contained in the encoding content, the encoding rules of the same region are the same, ensuring the uniformity of the same region.

[0083] In an implementation of the embodiment of the present disclosure, the coded content carried in the distribution request includes, in addition to the region identifier, at least one of a business code, a year, a date, and a sequence number.

[0084] In the embodiments of the present disclosure, the encoding content includes a region identifier, a business code, a year, a date, and a serial number, and a real estate scenario is used as an example for explanation.

[0085] Among them, there are 6 coding types corresponding to 6 coding rules, including commercial housing pre-sale permit number, commercial housing current sale registration number, new commercial housing online contract registration number, existing housing online contract registration number, housing mortgage online contract registration number and housing rental online contract registration number. Each coding type and the corresponding coding rules are explained below.

[0086] The first type is the coding rules corresponding to the commercial housing pre-sale license number, as follows:

[0087] The code of the commercial housing pre-sale license number consists of five parts: "business code - region identification - year - sequence number - check code":

[0088] (1) Business code: 001 (refer to the business category dictionary of the National Housing Online Registration and Filing Business Data Standard of the Ministry of Housing and Urban-Rural Development);

[0089] (ii) Region identification - 6-digit administrative division code (refer to the "National Administrative Division Code Information Query Platform" of the Ministry of Civil Affairs);

[0090] (iii) Year - 4-digit year number;

[0091] (iv) Sequence number: starting from 00001, in order of the time of issuance (in the current year) of the region (city, district or county) where the certificate is located;

[0092] (V) Check digit: 1 digit, which can refer to the national standard GB / T 17710-2008 (ISO 7064MOD 11-2).

[0093] Case 1: The first pre-sale license approved by Guangzhou in 2021 is numbered: 001-440100-2021-00001-X;

[0094] Case 2: The 90th pre-sale license approved in Nanhai District, Foshan City in 2021 is numbered: 001-440605-2021-00090-X.

[0095] The second type is the coding rules corresponding to the commercial housing current sale registration number, as follows:

[0096] The commercial housing sale registration number consists of five parts: "business code - region identification - year - sequence number - check code":

[0097] (1) Business code: 020 (refer to the business category dictionary of the National Housing Online Registration and Filing Business Data Standard of the Ministry of Housing and Urban-Rural Development);

[0098] (ii) Region identification - 6-digit administrative division code (refer to the "National Administrative Division Code Information Query Platform" of the Ministry of Civil Affairs);

[0099] (iii) Year - 4-digit year number;

[0100] (iv) Sequence number: starting from 00001, in order of the time of issuance (in the current year) of the region (city, district or county) where the certificate is located;

[0101] (V) Check digit: 1 digit, which can refer to the national standard GB / T 17710-2008 (ISO 7064MOD 11-2).

[0102] Case 1: The first commercial housing sale registration number in Guangzhou in 2021 is: 020-440100-2021-00001-X;

[0103] Case 2: The 90th commercial housing sale registration number in Nanhai District, Foshan City in 2021 is: 020-440605-2021-00090-X.

[0104] The third type is the coding rules corresponding to the registration number of the newly built commercial housing online signing contract, as follows:

[0105] The registration number of the newly built commercial housing online signing contract consists of five contents: "business code - region identification - year - date - sequence number - check code":

[0106] (1) Business code: 023 / 059 (refer to the business category dictionary of the National Housing Online Registration and Filing Business Data Standard of the Ministry of Housing and Urban-Rural Development);

[0107] (ii) Region identification - 6-digit administrative division code (refer to the "National Administrative Division Code Information Query Platform" of the Ministry of Civil Affairs);

[0108] (iii) Year and date - 8 digits, i.e. year, month and day;

[0109] (iv) Sequence number: starting from 000001, in order of the time of issuance (in the current year) of the region (city, district or county) where the certificate is located;

[0110] (V) Check digit: 1 digit, which can refer to the national standard GB / T 17710-2008 (ISO 7064MOD 11-2).

[0111] Case 1: The registration number of the first commercial housing pre-sale online contract signed in Guangzhou on January 1, 2021 is: 023-440100-20210101-000001-X;

[0112] Case 2: The registration number of the 900th online contract for commercial housing sales signed in Nanhai District, Foshan City on January 21, 2021 is: 059-440605-20210121-000900-X.

[0113] The fourth type is the coding rules corresponding to the registration number of the online contract for existing housing, as explained below:

[0114] The code for the online contract registration number of existing housing is composed of six contents: "business code - region identification - year - date - sequence number - check code":

[0115] (1) Business code - 086 (refer to the business category dictionary of the Ministry of Housing and Urban-Rural Development's "National Housing Online Registration and Filing Business Data Standard");

[0116] (ii) Region identification - 6-digit administrative division code (refer to the "National Administrative Division Code Information Query Platform" of the Ministry of Civil Affairs);

[0117] (iii) Year and date - 8 digits, including year, month and day;

[0118] (iv) Sequence number: starting from 000001, in order of the time of issuance (in the current year) of the region (city, district or county) where the certificate is located;

[0119] (V) Check digit: 1 digit, which can be referred to the national standard GB / T 17710-2008 (ISO 7064MOD 11-2).

[0120] Case 1: The registration number of the first existing housing online contract signed in Guangzhou on January 1, 2021 is: 086-440100-20210101-000001-X;

[0121] Case 2: The registration number of the 900th online contract for existing housing signed in Nanhai District, Foshan City on January 21, 2021 is: 086-440605-20210121-000900-X.

[0122] The fifth type is the coding rules corresponding to the registration number of the housing mortgage online signing contract, as follows:

[0123] The registration number of the housing mortgage online signing contract consists of six contents: "business code - region identification - year - date - sequence number - check code":

[0124] (1) Business code: 028 / 067 / 091 (refer to the business category dictionary of the National Housing Online Registration and Filing Business Data Standard of the Ministry of Housing and Urban-Rural Development);

[0125] (ii) Region identification - 6-digit administrative division code (refer to the "National Administrative Division Code Information Query Platform" of the Ministry of Civil Affairs);

[0126] (iii) Year and date - 8 digits, i.e. year, month and day;

[0127] (iv) Sequence number: starting from 000001, in order of the time of issuance (in the current year) of the region (city, district or county) where the certificate is located;

[0128] (V) Check digit: 1 digit, which can refer to the national standard GB / T 17710-2008 (ISO 7064MOD 11-2).

[0129] Case 1: The registration number of the first commercial pre-sale housing mortgage online contract signed in Guangzhou on January 1, 2021 is: 028-440100-20210101-000001-X;

[0130] Case 2: The registration number of the 900th online mortgage contract for commercial properties signed on January 21, 2021 in Nanhai District, Foshan City is: 067-440605-20210121-000900-X;

[0131] Case 3: The registration number of the 900th online mortgage contract for existing housing signed in Nanhai District, Foshan City on January 21, 2021 is: 091-440605-20210121-000900-X.

[0132] The sixth type is the coding rules corresponding to the registration number of the online house rental contract, as explained below:

[0133] The registration number of the housing rental online contract consists of six parts: "business code - region identification - year - date - sequence number":

[0134] (1) Business code: 033 / 072 / 096 (refer to the business category dictionary of the National Housing Online Registration and Filing Business Data Standard of the Ministry of Housing and Urban-Rural Development);

[0135] (ii) Region identification - 6-digit administrative division code (refer to the "National Administrative Division Code Information Query Platform" of the Ministry of Civil Affairs);

[0136] (iii) Year and date - 8 digits, i.e. year, month and day;

[0137] (iv) Sequence number: starting from 000001, in order of the time of issuance (in the current year) of the region (city, district or county) where the certificate is located;

[0138] (V) Check digit: 1 digit, which can refer to the national standard GB / T 17710-2008 (ISO 7064MOD 11-2).

[0139] Case 1: The registration number of the first online contract for pre-sale housing lease signed in Guangzhou on January 1, 2021 is 033-440100-20210101-000001-X;

[0140] Case 2: The registration number of the 900th online contract for leasing commercial ready-to-move-in properties signed on January 21, 2021 in Nanhai District, Foshan City is: 072-440605-20210121-000900-X;

[0141] Case 3: The registration number of the 900th online contract for existing housing rental signed in Nanhai District, Foshan City on January 21, 2021 is: 096-440605-20210121-000900-X.

[0142] Step 306: Send a distribution response carrying the target code according to the client identifier carried in the distribution request corresponding to the target thread.

[0143] In the encoding processing method of the disclosed embodiment, encoding rules that reflect different business characteristics and verification rules that prevent counterfeit encoding to steal private data are designed to support unified use in a certain area. In the process of target code generation, in the scenario of concurrent business, a competition mechanism based on the cache lock ensures that only one thread competes for the cache lock at a time, avoiding duplication of encoding, and the set encoding type and encoding rules ensure the uniformity of the encoding rules for easy management.

[0144] In order to implement the above embodiment, the embodiment of the present disclosure provides a coding processing device.

[0145] Figure 5 is a block diagram of a coding processing device provided by an embodiment of the present disclosure. Figure 5 The device includes a receiving module 51, a query module 52, a weighting module 53, a processing module 54 and a sending module 55.

[0146] The receiving module 51 is configured to receive at least one query request, wherein the query request carries a first client identifier requesting a query, a target code to be queried, and a code type to which the target code belongs.

[0147] The query module 52 is configured to query the weight of each character position according to the order of the character positions in the target code.

[0148] The weighting module 53 is configured to perform weighted summation on the values ​​at the positions of the characters except the check bit character in the target code according to the weights of the positions of the characters to obtain a weighted sum.

[0149] The processing module 54 is configured to query the database corresponding to the coding type to which the target code belongs according to the target code to obtain query data when the standard check value corresponding to the weighted sum matches the value on the check bit in the target code.

[0150] The sending module 55 is configured to send a query response carrying the query data to the corresponding client according to the first client identifier.

[0151] Furthermore, in an implementation of the embodiment of the present disclosure, the device further includes:

[0152] The first determination module is configured to perform modulo calculation based on the weighted sum to obtain a reference value, and query the corresponding relationship between the reference value and the check value based on the reference value to determine a standard check value corresponding to the weighted sum.

[0153] In an implementation of the embodiment of the present disclosure, the first determining module is configured as follows:

[0154] Substitute the weighted sum into the formula Y=S Mod N to perform modulo calculation to obtain the reference value; wherein S is the weighted sum, Y is the reference value, and N is a first constant whose value range is a positive integer.

[0155] In one implementation of the embodiment of the present disclosure, the query module 52 is configured to:

[0156] Substitute the order of any character position in the target code into the formula Wi=2 (i-1) Mod N' to obtain the weight of the character position; wherein i is the order of the character position, Wi is the weight of the character position, and N' is a second constant whose value range is a positive integer.

[0157] In one implementation of the embodiment of the present disclosure, the device further includes:

[0158] The receiving module 51 is further configured to receive at least one distribution request, wherein each distribution request carries a client identifier of a request encoding and an encoding type.

[0159] The allocation module is configured to allocate an idle thread in a thread pool to each of the distribution requests to determine a to-be-executed thread corresponding to each of the distribution requests.

[0160] The competition module is configured to determine the cache lock corresponding to each of the threads to be executed according to the region identifier included in the encoded content carried by each of the distribution requests, so that each of the threads to be executed calls the target method respectively to compete for the corresponding cache lock.

[0161] The second determining module is configured to determine a target thread that competes for the cache lock from the threads to be executed.

[0162] The execution module is configured to execute the target thread to query the corresponding encoding rule according to the encoding type carried by the distribution request corresponding to the target thread, and encode according to the encoding rule to obtain the target encoding.

[0163] The sending module is further configured to send a distribution response carrying the target code according to the client identifier carried by the distribution request corresponding to the target thread.

[0164] In one implementation of the embodiment of the present disclosure, there are multiple encoding types, each of which has a corresponding encoding rule; wherein each of the encoding rules is used to indicate each of the encoding contents, the order of the various encoding contents, and the number of character bits occupied by the various encoding contents.

[0165] In one implementation of the embodiment of the present disclosure, the coded content carried in the distribution request further includes at least one of a business code, a year, a date, and a sequence number.

[0166] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0167] In the encoding processing device of the embodiment of the present disclosure, at least one query request is received, wherein each query request carries a first client identifier for requesting query, a target code to be queried, and a code type to which the target code belongs. According to the order of each character position in the target code, the weight of each character position is queried. According to the weight of each character position, the values ​​at each character position in the target code are weighted and summed to obtain a weighted sum. When the standard check value corresponding to the weighted sum matches the value at the check bit in the target code, according to the target code, a query is performed in a database corresponding to the code type to which the target code belongs to obtain query data, and according to the first client identifier, a query response carrying the query data is sent to the corresponding client. The present disclosure verifies the target code to be queried according to the verification rule, avoids counterfeiting the code to steal data, and ensures the security of data query. In the process of generating the target code, in the scenario of concurrent business, based on the competition mechanism of the cache lock, it is ensured that only one thread competes for the cache lock each time, avoiding duplication of the code, and the set code type and code rule ensure the uniformity of the code rule, which is easy to manage.

[0168] In order to implement the above embodiment, the present disclosure also provides an electronic device, including:

[0169] At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can perform the steps of the method described in the aforementioned method embodiment.

[0170] In order to implement the above embodiments, the embodiments of the present disclosure further provide a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to execute the steps of the method described in the above method embodiments.

[0171] In order to implement the above embodiments, the embodiments of the present disclosure further provide a computer program product, including computer instructions, which implement the steps of the method described in the above method embodiments when executed by a processor.

[0172] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0173] Figure 6 The electronic device 600 includes a processor 601 and a memory 602 for storing instructions executable by the processor 601. The processor 601 is configured to execute the instructions to implement the present disclosure. Figure 1-4Coding Processing Method in the Embodiment In practical applications, the electronic device 600 may further include a network interface 603, an I / O controller 604, a large-capacity storage device 605, and a bus 606 for connecting them.

[0174] In an exemplary embodiment, a storage medium including instructions is also provided, such as a memory 602 including instructions, and the above instructions can be executed by a processor 601 of an electronic device 600 to implement the present disclosure. Figure 1-4 The encoding processing method in the embodiment. Optionally, the storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.

[0175] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0176] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A coding processing method, characterized in that: include: Receive at least one query request, wherein the query request carries a first client identifier requesting the query, a target code to be queried, and a code type to which the target code belongs; According to the order of the positions of the characters in the target code, query the weight of each character position; According to the weight of each character position, weighted sum is performed on the values ​​at each character position except the check bit character in the target code to obtain a weighted sum; When the standard check value corresponding to the weighted sum matches the value on the check bit in the target code, querying in a database corresponding to the coding type to which the target code belongs according to the target code to obtain query data; Sending a query response carrying the query data to a corresponding client according to the first client identifier; The method further comprises: Receive at least one distribution request, wherein each distribution request carries a client identifier of a request code and a code type; Allocating an idle thread in a thread pool to each of the distribution requests to determine a thread to be executed corresponding to each of the distribution requests; Determine, according to the region identifier included in the coded content carried by each of the distribution requests, a cache lock corresponding to each of the threads to be executed, so that each of the threads to be executed calls a target method respectively to compete for obtaining the corresponding cache lock; Determine a target thread that competes for a cache lock from among the threads to be executed; Executing the target thread to query a corresponding encoding rule according to an encoding type carried by a distribution request corresponding to the target thread, and encoding according to the encoding rule to obtain a target encoding; According to the client identifier carried in the distribution request corresponding to the target thread, a distribution response carrying the target code is sent.

2. The method according to claim 1, characterized in that In the case where the standard check value corresponding to the weighted sum matches the value on the check bit in the target code, before obtaining the query data, searching in a database corresponding to the coding type to which the target code belongs according to the target code, the method further comprises: Taking a modulus according to the weighted sum to obtain a reference value; According to the reference value, the corresponding relationship between the reference value and the check value is queried to determine the standard check value corresponding to the weighted sum.

3. The method according to claim 2, characterized in that The step of taking a modulus according to the weighted sum to obtain a reference value includes: Substituting the weighted sum into the formula Y=S Mod N to perform modulo calculation to obtain the reference value; Among them, S is the weighted sum, Y is the reference value, and N is a first constant, and its value range is a positive integer.

4. The method according to claim 1, characterized in that: The step of querying the weight of each character position according to the order of the character positions in the target code includes: Substitute the order of any character position in the target code into the formula Wi=2 (i-1) Mod N' to obtain the weight of the character position; Wherein, i is the order of the character position, Wi is the weight of the character position, and N' is a second constant, and its value range is a positive integer.

5. The method according to any one of claims 1 to 4, characterized in that: There are multiple encoding types, and each encoding type has a corresponding encoding rule; Among them, each encoding rule is used to indicate each encoding content, the order of each encoding content and the number of character bits occupied by each encoding content.

6. The method according to any one of claims 1 to 4, characterized in that: The coded content carried in the distribution request further includes at least one of a service code, year, date and sequence number.

7. A coding processing device, characterized in that: include: The receiving module is configured to receive at least one query request, wherein the query request carries a first client identifier requesting a query, a target code to be queried, and a code type to which the target code belongs; A query module, configured to query the weight of each character position according to the order of each character position in the target code; A weighting module is configured to perform weighted summation on the values ​​at the positions of the characters except the check bit character in the target code according to the weights of the positions of the characters to obtain a weighted sum; A processing module is configured to query, according to the target code, a database corresponding to the coding type to which the target code belongs, to obtain query data when a standard check value corresponding to the weighted sum matches a value on a check bit in the target code; a sending module, configured to send a query response carrying the query data to a corresponding client according to the first client identifier; The device also includes: The receiving module is further configured to receive at least one distribution request, wherein each distribution request carries a client identifier of a request code and a code type; An allocation module is configured to allocate an idle thread in a thread pool to each of the distribution requests to determine a thread to be executed corresponding to each of the distribution requests; A competition module is configured to determine the cache lock corresponding to each of the threads to be executed according to the region identifier included in the encoded content carried by each of the distribution requests, so that each of the threads to be executed calls the target method respectively to compete for the corresponding cache lock; A second determination module is configured to determine a target thread that competes for a cache lock from among the threads to be executed; An execution module is configured to execute the target thread to query a corresponding encoding rule according to an encoding type carried by a distribution request corresponding to the target thread, and encode according to the encoding rule to obtain a target encoding; The sending module is further configured to send a distribution response carrying the target code according to the client identifier carried by the distribution request corresponding to the target thread.

8. The device according to claim 7, characterized in that The device further comprises: The first determination module is configured to perform modulo calculation based on the weighted sum to obtain a reference value, and query the corresponding relationship between the reference value and the check value based on the reference value to determine a standard check value corresponding to the weighted sum.

9. The device according to claim 8, characterized in that The first determining module is configured to: Substituting the weighted sum into the formula Y=S Mod N to perform modulo calculation to obtain the reference value; Among them, S is the weighted sum, Y is the reference value, and N is a first constant, and its value range is a positive integer.

10. The device according to claim 7, characterized in that The query module is configured as follows: Substitute the order of any character position in the target code into the formula Wi=2 (i-1) Mod N' to obtain the weight of the character position; Wherein, i is the order of the character position, Wi is the weight of the character position, and N' is a second constant, and its value range is a positive integer.

11. The device according to any one of claims 7 to 10, characterized in that: There are multiple encoding types, and each encoding type has a corresponding encoding rule; Among them, each encoding rule is used to indicate each encoding content, the order of various encoding contents and the number of character bits occupied by various encoding contents.

12. The device according to any one of claims 7 to 10, characterized in that: The coded content carried in the distribution request further includes at least one of a service code, year, date and sequence number.

13. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the method according to any one of claims 1 to 6. 14 . A computer-readable storage medium, when instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method according to claim 1 .

15. A computer program product comprising computer instructions, characterized in that When the computer instructions are executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Identification code processing method and device

    CN112396425A