Graphic code generation method, device and system
By dynamically updating the attribute information of the graphics code, the code solution update and code generation operations are simplified, the problem of complexity in the graphics code generation in the prior art is solved, and the user experience and efficiency are improved.
Patent Information
- Application Number
- CN202411230661.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-03
- Publication Date
- 2025-01-10
AI Technical Summary
In the prior art, the process of updating and generating graphic code schemes is complicated, and users need to write code and define logic by themselves, with high thresholds and difficult to meet flexible application needs.
A graphic code generation method and system are provided, allowing users to dynamically update the attribute information of the target code scheme through attribute update instructions, and the code management platform generates corresponding graphic codes to simplify code update and code generation operations.
It greatly reduces the complexity and difficulty of code scheme updates and code generation, improves user experience and efficiency, and allows users to flexibly configure the attribute information of graphics codes to meet different needs.
Smart Images

Figure CN119294428A_ABST
Abstract
Description
Technical Field
[0001] One or more embodiments of the present specification relate to the field of image processing technology, and in particular, to a method, device and system for generating a graphic code. Background Art
[0002] A graphic code is a pattern that uses several specific geometric shapes arranged in a certain pattern to record information. The generation (or coding) and decoding of the graphic code are achieved through a code scheme composed of multiple attribute information.
[0003] Traditional code schemes are usually static code schemes, that is, the attribute information in the created code scheme is fixed, and the graphic codes generated based on the code scheme also conform to these fixed attribute information. When the application scenario or usage requirements of the graphic code change, it is necessary to create a new code scheme and generate the code, which is inconvenient to use.
[0004] In this regard, the related art proposes a programmable graphic code solution, that is, the user writes code to define the code solution and generate a graphic code to meet personalized application needs. However, this solution not only requires the user to write code by themselves, but also requires the user to define the logic, algorithm and rules of the graphic code by themselves, which makes the implementation threshold of the solution high and difficult. Especially when the functions and interactions of the graphic code are relatively complex, the implementation is extremely difficult and the user experience is poor. Summary of the invention
[0005] In view of this, one or more embodiments of this specification provide the following technical solutions:
[0006] According to a first aspect of one or more embodiments of this specification, a method for generating a graphic code is proposed, comprising:
[0007] In response to an attribute update instruction issued for a target code scheme, determining first attribute information to be updated from a plurality of attribute information of the target code scheme, and updating the first attribute information to second attribute information indicated by the attribute update instruction;
[0008] In response to a code generation request initiated for the updated target code scheme, a graphic code is generated based on the updated target code scheme.
[0009] According to a second aspect of one or more embodiments of this specification, a device for generating a graphic code is provided, comprising:
[0010] an updating unit, configured to, in response to an attribute updating instruction issued for a target code scheme, determine first attribute information to be updated from a plurality of attribute information of the target code scheme, and update the first attribute information to second attribute information indicated by the attribute updating instruction;
[0011] The code generating unit is used to generate a graphic code based on the updated target code scheme in response to a code generating request initiated for the updated target code scheme.
[0012] According to a third aspect of one or more embodiments of this specification, a system for generating a graphic code is provided, comprising:
[0013] The code management client is used to send a property update instruction to the code management server for the target code scheme managed by the code management server;
[0014] The code management server is used to determine, in response to the attribute update instruction, first attribute information to be updated from the multiple attribute information of the target code scheme, and update the first attribute information to the second attribute information indicated by the attribute update instruction;
[0015] A code generation client, used for initiating a code generation request to the code management server for the updated target code scheme;
[0016] The code management server is further configured to generate a graphic code based on the updated target code scheme in response to the code generation request.
[0017] According to a fourth aspect of one or more embodiments of this specification, an electronic device is proposed, comprising: a processor; a memory for storing processor-executable instructions; wherein the processor implements the steps of the method described in the first aspect by running the executable instructions.
[0018] According to a fifth aspect of one or more embodiments of the present specification, a computer-readable storage medium is provided, on which computer instructions are stored, and when the instructions are executed by a processor, the steps of the method described in the first aspect are implemented.
[0019] According to a sixth aspect of one or more embodiments of the present specification, a computer program product is proposed, comprising a computer program / instruction, which implements the steps of the method described in the first aspect when executed by a processor.
[0020] It can be seen from the above embodiments that the embodiments of the present specification can update the code scheme in response to an attribute update instruction issued for the target code scheme, that is, according to the instruction, the first attribute information among multiple attribute information of the target code scheme is updated to the second attribute information specified by the user, and then the graphic code is generated based on the updated target code scheme.
[0021] It can be seen that this solution can dynamically update the target code scheme that has been created, thereby achieving the effect of dynamically configuring the code scheme, so that users can flexibly configure / update the specific attribute information of the code scheme at any time according to actual code requirements to generate a graphic code that can meet the above requirements. Compared with the relevant technical solutions in which users write codes by themselves, this solution only requires users to indicate how to update attribute information and request code generation through interactive operations, and the code management platform can automatically generate the corresponding graphic code according to the updated target code scheme, which greatly simplifies the code scheme update operation and the graphic code generation operation, and helps to improve the user's code scheme update efficiency and code generation efficiency, thereby improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 It is a schematic diagram of the architecture of a system for generating a graphic code provided by an exemplary embodiment.
[0023] Figure 2 The present invention is a flowchart of a method for generating a graphic code provided by an exemplary embodiment.
[0024] Figure 3 It is a flowchart of a process for generating a graphic code provided by an exemplary embodiment.
[0025] Figure 4 It is a structural schematic diagram of a device provided by an exemplary embodiment.
[0026] Figure 5 It is a block diagram of a device for generating a graphic code provided by an exemplary embodiment. DETAILED DESCRIPTION
[0027] In order to solve the above-mentioned technical problems existing in the related art, the embodiments of this specification propose a new graphic code generation solution, that is, allowing users to dynamically update the code scheme by updating attribute information, and the graphic code generation system (or code management platform) generates the corresponding graphic code according to the updated code scheme. The following is a detailed description of the solution in conjunction with the accompanying drawings and embodiments.
[0028] Figure 1 FIG. 1 is a schematic diagram of the architecture of a system for generating a graphic code provided by an exemplary embodiment. Figure 1 As shown, the system may include a network 10, a server 11 and several electronic devices, such as a PC (Personal Computer) 12, a PC 13 and a mobile phone 14.
[0029] The server 11 can be a physical server including an independent host, or it can also be a virtual server, cloud server, etc. carried by a host cluster. During operation, the server 11 can run the server-side program of a certain application to implement the relevant functions of the application. For example, when the server 11 runs the program of the code management service, it can be implemented as a corresponding code management server. Among them, the code management server can be built using a microservice architecture. Under this architecture, the code management server can be composed of one or more microservice components at the logical level. At this time, the client can access each microservice component on demand (of course, some service components can only be accessed if they have access rights), thereby achieving access to the code management server, which will not be repeated.
[0030] During operation, any of the above electronic devices can run a program on the client side of a certain application to implement the relevant functions of the application. For example, when PC12 runs the program of the code management service, it can be implemented as the client of the code management service, hereinafter referred to as the code management client; when PC13 runs the program of the code generation service, it can be implemented as the client of the code generation service, hereinafter referred to as the code generation client; when the mobile phone 13 runs the program of the decoding service, it can be implemented as the client of the decoding service, hereinafter referred to as the decoding client. Among them, the code management client and the code generation client can be the same client. For example, a certain APP integrates both the code management function and the code generation function. The APP can be used as both a code management client and a code generation client. This is hereby explained. Any of the above clients can be in a suitable form, such as the installation package of the application program (such as .exe or .ipa format) can be pre-installed in PC12, so that the client of the application can be started and run in PC12 (at this time, the client and the server adopt a C / S architecture). Alternatively, when an online "client" such as HTML5 technology is used, the client can be obtained and run without installing the corresponding application on the electronic device, such as PC13 can access the server through a browser (in this case, the client and the server adopt a B / S architecture), which will not be repeated. Of course, computers and mobile phones are just some types of electronic devices that users can use. In fact, users can also use electronic devices such as the following types: workstations (Work Station), PDAs (Personal Digital Assistants), wearable devices (such as smart glasses, smart watches, etc.), VR (Virtual Reality) devices, AR (Augmented Reality) devices, etc., and the embodiments of this specification do not limit this.
[0031] In addition, the network 10 may include various types of wired or wireless networks, which is not limited in this embodiment of the present specification.
[0032] It should be noted that Figure 1 The mobile phone 14 is only used to illustrate the present solution in conjunction with the following embodiments, and does not limit the system for generating the graphic code to necessarily include a decoding client. In fact, the graphic code may only be composed of a code management server, a code management client, and a code generation client, but does not include a decoding client.
[0033] exist Figure 1 In the system shown, the code management client can interact with the code management server to update the target code scheme, and the code management client or the code generation client can interact with the code management server to generate a graphic code. The generated graphic code can be displayed to the user in an appropriate manner (such as Figure 1 The two-dimensional code QR1 shown in the figure allows the user to scan the graphic code using a decoding client, and further implement the analysis of the graphic code (i.e., decoding the graphic code) by interacting with the code management server.
[0034] This specification proposes a system for generating a graphic code, which can be used to update a created target code scheme and generate a graphic code based on the updated target code scheme. The system can include a code management server (such as Figure 1 The server program running in the server 11 shown in FIG. 11 ), the management client (such as Figure 1 The client program running in PC12 as shown) and the code generating client (as shown Figure 1 The client program running in PC13 shown in FIG. 1 ).
[0035] The code management client is used to send a property update instruction to the code management server for the target code scheme managed by the code management server;
[0036] The code management server is used to determine, in response to the attribute update instruction, first attribute information to be updated from the multiple attribute information of the target code scheme, and update the first attribute information to the second attribute information indicated by the attribute update instruction;
[0037] A code generation client, used for initiating a code generation request to the code management server for the updated target code scheme;
[0038] The code management server is further configured to generate a graphic code based on the updated target code scheme in response to the code generation request.
[0039] In one embodiment, the code management client and the code generation client may be the same client, such as the two may be the same application, which may be used to manage code schemes (such as creating a new code scheme, or updating an already created code scheme, etc.), and to generate graphic codes. Of course, the processes of managing code schemes and generating graphic codes may be achieved by interacting with the code management server.
[0040] In one embodiment, after generating the graphic code, the code management server may send the graphic code to the code generation client, so that the latter can display it through the above-mentioned means or send it to other devices for display / printing, etc.; alternatively, the code management server may also directly send the graphic code to a third-party device specified by the code generation client, so that the device can display / print these graphic codes, etc., which will not be repeated here. Among them, the displayed graphic code or the graphic code that is printed and posted can be photographed (or scanned) and parsed by an electronic device. Among them, the electronic device can perform the parsing itself after shooting, or send the photographed image to other electronic devices for parsing, and the embodiments of this specification do not limit this. Among them, the scanned graphic code can be parsed by a client (i.e., a decoding client) running in the above-mentioned electronic device.
[0041] It should be noted that the graphic code described in this specification can be in various forms such as barcode, QR code (Quick Response Code, or QR Code), and Visual Recognition Code (Visual Recognition Code, or VR Code). Taking QR code as an example, it can adopt various formats such as Data Matrix, MaxiCode, Aztec, PDF417, etc. After the code generation is completed, the graphic code generated based on the target code scheme can be published through APP (Application), mini program, public platform and other channels; thereafter, the user can scan the published graphic code through the corresponding scanning channel. The published graphic code can be printed on a physical object, displayed on a screen, or projected on the surface of an object of any shape or in space, so that it can be scanned by a scanning terminal. The code value obtained by scanning can be a string in any format such as binary, decimal or hexadecimal, and this specification does not limit this.
[0042] The code scheme described in this specification can be used for code generation (or code making, i.e. drawing graphic codes) and decoding (i.e. parsing graphic codes or their code values). Any code scheme can be regarded as an information set consisting of multiple attribute information, wherein any attribute information can include one or more specific information. Taking the target code scheme to be updated as an example, the multiple attribute information it contains can include code category, code standard, code issuing agency identification, code application identification, code style, etc. Among them, the code category can be determined by the description object of the graphic code to be generated, such as person code, object code, place code, etc., or it can also be determined by the function / application scenario of the graphic code to be generated, which is used for government services, scenic spot sightseeing, park management, campus management, logistics management, medical voucher, smart transportation, digital fire protection, etc. Any category of code scheme can include at least one field content, such as the person code can include the person's name, certificate number, permanent address, etc., and the place code can include the type, address, opening hours, admission rules, etc. of the place. The application scenario of the graphic code corresponding to the code scheme can be flexibly set through the code category, so as to meet the user's code needs as much as possible and flexibly. The code standard (or code protocol) is a series of rules that the graphic code to be generated needs to follow. These rules can be jointly determined by standard operators and the logical relationships between them (such as AND, OR, NOT, numerical judgment, content judgment, etc.). Exemplarily, the code standard can be PDF417, QR Code, Code 49, Code 16K, Code One, etc., and the embodiments of this specification do not limit this. The code issuing agency identifier is used to specify the legal agency that can use the code scheme to generate graphic codes. In addition to the identifier, the code issuing agency can also be configured with corresponding key information (such as public and private key pairs), etc., so as to achieve authority control of the code issuing agency and ensure the security of the published graphic code. The code application identifier is used to specify the application (or service) that can legally publish / use the graphic code generated by the code scheme. The identifier can be used to verify the application's permission to use the graphic code to avoid the generated graphic code from being abused by unauthorized applications. Among them, the application identifier set of any code scheme can include one or more application identifiers, and the application represented by each application identifier is a legal application corresponding to the code scheme. The code style is used to specify the appearance style of the generated graphic code. For example, the layer, color, background image, text, logo and other style parameters of the graphic code can be configured, which will not be repeated here.
[0043] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this manual are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0044] In addition, the attribute information of any code scheme also includes code extension (such as extended / associated data that can be obtained after scanning the code, etc.), three-party code (such as other graphic codes associated with the graphic code generated by the code scheme), code SPI (accessible services associated with the graphic code generated by the code scheme, etc.), one code with thousands of faces (such as scanning the graphic code generated by the code scheme can jump to any pre-configured page, etc.). In addition, illustratively, any code scheme managed by the graphic code generation system can be a building code scheme, a personal code scheme, a health code scheme, a ride code scheme, a one-code appointment code scheme, a one-code sign-in code scheme, a medical code scheme, a payment code scheme, a household registration code scheme, etc., which will not be repeated here.
[0045] Figure 2 This is a flowchart of a method for generating a graphic code provided by an exemplary embodiment. The method can be applied to the aforementioned graphic code generation system, and specifically can be applied to the code management server in the system. Figure 2 As shown, the method includes steps 202-204.
[0046] Step 202, in response to an attribute update instruction issued for a target code scheme, determining first attribute information to be updated from a plurality of attribute information of the target code scheme, and updating the first attribute information to second attribute information indicated by the attribute update instruction.
[0047] As a code management platform open to users, the graphic code described in this specification can be used to manage at least one code scheme. Among them, any code scheme managed by the system (such as the target code scheme described in the embodiment of this specification) can be created by the user (i.e. the user who manages the code scheme) on other platforms or devices, and migrated to the platform for maintenance and management after creation; or, it can also be created by the user within the system based on the resources provided by the system, that is, the system can also support the function of creating code schemes.
[0048] In one embodiment, the aforementioned user can interact with the code management server through the code management client used by the user to create the target code scheme (of course, the creation of the code scheme occurs before the update of the code scheme, so when the code scheme is created, it is not known that the code scheme is the "target code scheme" to be updated later). For example, the code management client can initiate a code scheme generation instruction to the code management server, and the server can determine the multiple attribute information specified by the instruction in response to the code scheme generation instruction, and further generate the target code scheme based on these attribute information. Among them, the code scheme generation instruction can include the multiple attribute information, which can be determined by the user at the code management client; or, the instruction can also include the identifiers of the multiple attribute information, and the attribute information represented by these identifiers can be displayed to the user by the code management client and selected by the user. It can be understood that in the process of creating the target code scheme, the user can reasonably configure the multiple attribute information according to the actual scene or demand to create a target code scheme composed of these attribute information. It can be seen that through this method, the user can flexibly create different code schemes for different scenes, so as to create a code scheme that adapts to the needs of the actual scene as much as possible.
[0049] The user can issue the aforementioned attribute update instruction for any code scheme managed by the system for generating the graphic code, so that the code scheme becomes the target code scheme described in the embodiment of this specification. As mentioned above, the target code scheme includes multiple attribute information, and the attribute update instruction can be used to instruct to update the first attribute information in these attribute information to the corresponding second attribute information. Among them, the first attribute information can specifically include one or more information, and when including multiple information, these information can belong to one or more attribute information.
[0050] It is understandable that the "update" described in the embodiments of this specification involves the modification of the attribute information of the target code scheme, and the graphic codes generated before and after the modification will be different. Therefore, in order to prevent irrelevant users from arbitrarily modifying the code scheme, the code management server can verify the authority of the initiator of the attribute update instruction (i.e., the aforementioned user or the account currently logged in by the code management client used by the aforementioned user), and respond to the instruction if the verification is passed. Exemplarily, any user can be allowed to update the code scheme that he manages or owns; alternatively, the superior-subordinate relationship and / or authority relationship between users can be determined according to the architecture information of the organization to which multiple users belong, and the superior user is assigned the update authority for the code scheme managed or owned by the subordinate user; alternatively, it can also be determined according to the user's management role whether he has the update authority for a certain code scheme, which will not be repeated here.
[0051] In one embodiment, the code management server may respond to a scheme update request initiated for the target code scheme, provide the initiator of the scheme update request with multiple candidate attribute information corresponding to the target code scheme for selection, and determine at least one selected candidate attribute information as the second attribute information. For example, in the case of determining that a target code scheme needs to be updated, the user may first initiate a scheme update request to the code management server through the code management client; accordingly, the code management server may return multiple candidate attribute information corresponding to the target code scheme to the code management client in response to the request, and the code management client displays the candidate attribute information to the user for viewing. Further, the user may select the first attribute information to be updated according to the actual scenario requirements, so that the code management client submits the candidate first attribute information or its identifier to the code management server, so as to specify which attribute information to be used as the first attribute information to the code management server. In this way, the user can accurately know which attribute information the target code scheme includes, so as to facilitate the user to accurately specify the first attribute information to be updated.
[0052] In another embodiment, the attribute update instruction may carry a first attribute identifier of the first attribute information and corresponding second attribute information, so that the code management server can determine the first attribute information matching the identifier from multiple attribute information of the target code scheme based on the first attribute information, and update the first attribute information to the corresponding second attribute information carried in the instruction.
[0053] Among them, the second attribute information described in the embodiments of this specification can be selected by the user from the candidate information provided by the code management server, or can be customized by the user according to actual needs, and the embodiments of this specification do not limit this. It should also be noted that the so-called "updating the first attribute information to the second attribute information" can replace each of the first attribute information in the multiple attribute information maintained locally with the corresponding second attribute information; or, in order to facilitate the user's subsequent possible solution rollback (or recovery) needs, each second attribute information can also be saved locally and the association relationship between these second attribute information and the remaining attribute information (i.e., the attribute information that has not been updated) is recorded, and the association relationship between each first attribute information and the remaining attribute information is disconnected, which will not be repeated.
[0054] Step 204: In response to a code generation request initiated for the updated target code scheme, generate a graphic code based on the updated target code scheme.
[0055] It is understandable that after the above-mentioned first attribute information is updated to the corresponding second attribute information, the update process for the target code scheme is completed, and the target code scheme at this time is the "updated target code scheme". In this regard, the code generation client can initiate a code generation request for the updated target code scheme to trigger the code management server to generate a graphic code based on the updated target code scheme. It should be noted that one or more graphic codes can be generated in response to a code generation request, and the specific number can be determined according to the relevant information carried in the code generation request, and the embodiments of this specification do not limit this.
[0056] As can be seen from the above embodiments, this solution can dynamically update the target code scheme that has been created, thereby achieving the effect of dynamically configuring the code scheme, so that users can flexibly configure / update the specific attribute information of the code scheme at any time according to actual code requirements to generate a graphic code that can meet the above requirements. Compared with the related technical solutions in which users write codes by themselves, this solution only requires users to indicate how to update attribute information and request code generation through interactive operations, and the code management platform can automatically generate the corresponding graphic code according to the updated target code scheme, which greatly simplifies the code scheme update operation and the graphic code generation operation, and helps to improve the user's code scheme update efficiency and code generation efficiency, thereby improving the user experience.
[0057] In one embodiment, in order to facilitate the management of the target code scheme, thereby avoiding information confusion and even errors in generating graphic codes, the system for generating graphic codes can set corresponding version numbers for each code scheme it manages. For the target code scheme, the above-mentioned update process can be regarded as the upgrade process of the scheme, so the corresponding version number can be assigned to the updated target code scheme. For example, in the case where the target code scheme before the update has a first version number, a second version number different from the first version number can be assigned to the updated target code scheme. Among them, in order to intuitively reflect the content of this update through the version number, the information proportion of this update (such as the ratio of the number of the first attribute information to the number of all attribute information of the target code scheme) can be calculated first, and the second version number can be determined according to the information proportion, so that the difference between the second version number and the first version number is positively correlated with the information proportion. In addition, when generating a graphic code based on the updated target code scheme, the second version number (or the hash value of the version number, etc.) can also be included in its code value to meet the subsequent knowledge requirements of the decoding client for the version number.
[0058] In one embodiment, the target code scheme may be associated with a corresponding development interface (hereinafter referred to as the first code scheme development interface) so that the corresponding client can call the code scheme through the interface. For example, in the above embodiment, the code management client can initiate an attribute update instruction or a scheme update request for the target code scheme to the code management server through the first code scheme development interface. In this regard, after the code management server completes the update of the target code scheme, it can associate the updated target code scheme with the first code scheme development interface to replace the target code scheme before the update. This method keeps the development interface unchanged, so that the client can call the updated target code scheme according to the original development interface without changing its access configuration information, thereby avoiding access anomalies that may be caused by incompatibility after changing the access configuration information or information errors after the change, and ensuring the stability of the interaction. Of course, the updated target code scheme can also be associated with the second code scheme development interface, which is different from the aforementioned first code scheme development interface. It can be understood that this method actually allocates a new development interface for the updated target code scheme, so that the client can call the updated target code scheme according to the new second code scheme development interface, and can also continue to call the target code scheme before the update according to the original first code scheme development interface. The specific calling path can be flexibly selected, which not only helps to meet the client's diverse code scheme calling needs, but also avoids interference or calling confusion that may be caused by different code schemes.
[0059] like Figure 3 As shown, third-party services such as APP1 to APPn can call code scheme i through the code scheme development interface. For example, APP1 can be used as a code management client to initiate a scheme update request or send an attribute update instruction to the code management server through the interface; APP2 can be used as a code generation client to initiate a code generation request to the code management server through the interface; APPn can be used as a decoding client to initiate a decoding request to the code management server through the interface, etc.
[0060] In one embodiment, the various attribute information of the target code scheme may include the aforementioned code standard. In this case, the code management server may generate corresponding code generation scripts and decoding scripts based on the code standard in the updated target code scheme. The code generation script is used to generate graphic codes that conform to the target code scheme, and the decoding script is used to decode these graphic codes or their code values. For example, when generating graphic codes based on the updated target code scheme, the code management server may generate graphic codes by executing the code generation script. In this way, the code management server automatically generates code generation scripts and decoding scripts with the help of its own code generation function, so that these scripts can be executed later to complete automatic code generation and decoding, without the need for users to manually write scripts, which greatly reduces the user's code generation / decoding workload and improves script generation efficiency.
[0061] As mentioned above, the target code scheme includes multiple attribute information, and the updated first attribute information is at least part of it. Therefore, any attribute information of the updated target code scheme may not be updated, or may be the updated second attribute information. Therefore, the code standard may be the original code standard that has not been updated (in this case, the second attribute information does not include the code standard), or may be the updated new code standard (in this case, the second attribute information includes the code standard). The attribute information such as code application and code style in the following embodiments is similar to this and will not be described one by one.
[0062] like Figure 3 As shown, it is assumed that code scheme i is the target code scheme, and graphic code j can be generated based on the code scheme. It should be noted that although Figure 3 The code scheme i and the various attribute information such as "code category" below it are drawn separately, but logically it should be considered that these attribute information together constitute the code scheme i.
[0063] In one embodiment, when the second attribute information includes the code standard, the code management server may provide a plurality of candidate standard operators for the user, and determine the code standard in the second attribute information based on at least one target standard operator selected by the user from the plurality of candidate standard operators. For example, the code management server may return a plurality of candidate standard operators to the client in response to a scheme update request or an attribute update instruction sent by the code management client; the client may display these candidate standard operators to the user so that the user may select at least some of the candidate standard operators according to actual scenario requirements - these candidate standard operators will be determined as target standard operators by the code management server, and the code management server may further determine the code standard based on these standard operators for updating the original code standard in the first attribute information.
[0064] In one embodiment, the graphic code can be parsed by executing the aforementioned decoding script. For example, the code management server can respond to the first type of decoding request initiated for the graphic code, extract the graphic code image obtained by photographing the displayed graphic code from the request, and parse the graphic code image by executing the decoding script. The graphic code image only contains the graphic code and does not contain other irrelevant content. In order to achieve this effect, the graphic code can be recognized in real time during the preview process before shooting, and only the graphic code can be photographed after the graphic code is recognized to obtain the graphic code image; or the graphic code can be photographed to obtain a complete image, and then the part where the graphic code is located can be intercepted from the complete image to obtain the graphic code image. It can be seen that the first type of decoding request contains the aforementioned graphic code image, and the decoding script can not only recognize the graphic code from the graphic code image, but also further parse the graphic code (that is, convert the graphic information into a code value and then parse the code value). Alternatively, the code management server can also respond to the second type of decoding request initiated for the graphic code, extract the code value obtained by photographing and parsing the displayed graphic code from the second type of decoding request, and parse the code value by executing the decoding script. It can be seen that the second type of decoding request contains the aforementioned code value. The decoding client can identify the graphic code from the image obtained by shooting the displayed graphic code and convert it into a code value. The code management server only needs to execute the decoding script to parse the code value, that is, the decoding script at this time is used to parse the code value of the graphic code. The above two parsing methods have different requirements for the computing power and device communication capabilities of the decoding client. In the process of program practice, the appropriate method can be selected according to the actual situation.
[0065] In one embodiment, the various attribute information of the target code scheme may include the aforementioned code standard. At this time, the code management service end may verify the identity of the initiator of the request in response to the aforementioned code generation request, and after verifying that the initiator is the preset code issuing agency represented by the code issuing agency identifier, generate a graphic code based on the updated target code scheme. In this way, the legitimacy / code generation authority of the initiator of the code generation request can be verified using the code issuing agency identifier before the graphic code is generated, thereby avoiding the updated target code scheme from being abused for code issuance. And / or, for the preset code issuing agency represented by the code issuing agency identifier, the code management service end may also encrypt the generated graphic code based on the agency key of the agency, such as using the agency's public key to encrypt the graphic code and then returning the ciphertext to the agency, so as to ensure that even if data leakage occurs during the transmission of the graphic code, the transmitted graphic code will not be arbitrarily decrypted and used by a third party outside the agency (such as an eavesdropper).
[0066] In one embodiment, the various attribute information of the target code scheme may include the aforementioned code category. At this time, when the code management server generates a graphic code based on the updated target code scheme, it can calculate the code value corresponding to the field content of the code category according to the preset rules, and generate the graphic code based on the code value. Among them, the meaning of each field of the code category is related to the code category, and the meaning of each field of different code categories is often different. The specific field meaning can be selected by the user from the candidate field meanings provided by the system, or it can be customized by the user. Among them, the field content of any field can be pre-configured, or it can be extracted from the aforementioned code generation request, such as the field content of the "category" field of the bus code is the preset text "bus" or the number "1", and the field content of the "certificate number" field of the health code is the user's actual certificate number (the certificate number can be entered by the user through the code generation client, and is included in the aforementioned code generation request and sent to the code management server). The meaning and field content of each field in the above code category can be flexibly set by the user according to actual needs, which helps to meet the diverse needs of different scenarios.
[0067] In one embodiment, the various attribute information of the target code scheme may include the aforementioned code style. In this case, when the code management server generates a graphic code based on the updated target code scheme, it may render and generate the graphic code according to the style parameters specified by the code style. The style parameters may include layers, colors, background images, text, logos, etc., which will not be described in detail.
[0068] The graphic code generated by the above method can be published by appropriate means so as to show the graphic code to the user (i.e. the user who views the graphic code). For example, it can be displayed on a page or printed and posted on an object so that the user can scan the code through a decoding client. Figure 1 As shown, the mobile phone 14 can use a camera to shoot the displayed QR code QR1, and further initiate a decoding request for the QR code to the code management server by the decoding client running inside it. Alternatively, the graphic code can also be displayed on the page of the APP or mini program, so that the graphic code can be scanned by the built-in code scanning program of the APP or mini program (such as the "long press to identify the QR code" function).
[0069] In one embodiment, the various attribute information of the target code scheme may include the aforementioned code application identifier. In this case, the code management server may respond to a decoding request initiated for the graphic code, and upon verifying that the initiator of the decoding request is the preset code application represented by the code application identifier, parse the graphic code based on the updated target code scheme. Figure 3In the embodiment, after receiving a decoding request including a code value of graphic code j initiated by a decoding client, the code management server can extract the application identifier of the decoding client from the request, and try to query the application identifier from the identification set used in code scheme i: if the application identifier is found, it means that the decoding client is a legitimate application corresponding to code scheme i, and the code value of graphic code j can be parsed at this time; otherwise, the parsing of the code value is rejected, and a corresponding decoding failure notification message can be returned to the decoding client. This method can ensure that the code management server only parses the graphic code in response to the decoding request of the legitimate application corresponding to the target code scheme, thereby preventing the code scheme or the graphic code generated by it from being abused by unauthorized applications.
[0070] Figure 4 is a schematic structural diagram of a device provided by an exemplary embodiment. Figure 4 At the hardware level, the device includes a processor 402, an internal bus 404, a network interface 406, a memory 408, and a non-volatile memory 410, and may also include hardware required for other functions. One or more embodiments of this specification may be implemented based on software, such as the processor 402 reading the corresponding computer program from the non-volatile memory 410 into the memory 408 and then running it. Of course, in addition to the software implementation, one or more embodiments of this specification do not exclude other implementations, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0071] Please refer to Figure 5 This specification also proposes a device for generating a graphic code, which can be applied to Figure 4 The device shown in the figure can realize the technical solution of this specification. The device can include:
[0072] An updating unit 501 is configured to, in response to an attribute update instruction issued for a target code scheme, determine first attribute information to be updated from a plurality of attribute information of the target code scheme, and update the first attribute information to second attribute information indicated by the attribute update instruction;
[0073] The code generating unit 502 is configured to generate a graphic code based on the updated target code scheme in response to a code generating request initiated for the updated target code scheme.
[0074] Optionally, the attribute updating unit 501 is specifically used for:
[0075] According to the first attribute identifier carried by the attribute update instruction, first attribute information matching the first attribute identifier is determined from multiple attribute information of the target code scheme, and the first attribute information is updated to the second attribute information carried by the attribute update instruction.
[0076] Optionally, also include:
[0077] The attribute information determination unit 503 is used to respond to a scheme update request initiated for the target code scheme, provide a plurality of candidate attribute information corresponding to the target code scheme to the initiator of the scheme update request, and determine at least one selected candidate attribute information as the second attribute information.
[0078] Optionally, also include:
[0079] The code scheme generating unit 504 is used to determine the multiple types of attribute information specified by the code scheme generating instruction in response to the received code scheme generating instruction, and generate the target code scheme based on the multiple types of attribute information.
[0080] Optionally, the target code scheme before updating has a first version number, and the apparatus further includes:
[0081] The version number assigning unit 505 is used to assign a second version number different from the first version number to the updated target code scheme.
[0082] Optionally, the target code scheme before updating is associated with a first code scheme development interface, and the apparatus further includes:
[0083] The interface associating unit 506 is used to associate the updated target code solution with the first code solution development interface to replace the target code solution before the update; or to associate the updated target code solution with a second code solution development interface different from the first code solution development interface.
[0084] Optionally, the multiple types of attribute information include a code standard, and the device further includes:
[0085] The script generating unit 507 is used to generate corresponding code generation script and decoding script based on the code standard in the updated target code scheme.
[0086] Optionally, when the second attribute information includes the code standard, the apparatus further includes:
[0087] The code standard determining unit 508 is configured to provide a plurality of candidate standard operators for the user, and determine the code standard in the second attribute information based on at least one target standard operator selected by the user from the plurality of candidate standard operators.
[0088] Optionally, the code generation unit 502 is specifically used to generate a graphic code by executing the code generation script.
[0089] Optionally, a decoding unit 509 is further included, configured to:
[0090] In response to a first type of decoding request initiated for the graphic code, extracting a graphic code image obtained by photographing the displayed graphic code from the first type of decoding request, and parsing the graphic code image by executing the decoding script; or
[0091] In response to a second type of decoding request initiated for the graphic code, a code value obtained by photographing and parsing the displayed graphic code is extracted from the second type of decoding request, and the code value is parsed by executing the decoding script.
[0092] Optionally, the multiple types of attribute information include code categories, and the code generation unit 502 is specifically used to:
[0093] The code value corresponding to the field content of the code category is calculated according to a preset rule, and a graphic code is generated based on the code value.
[0094] Optionally, the multiple types of attribute information include code styles, and the code generating unit 502 is specifically configured to:
[0095] The graphic code is generated by rendering according to the style parameters specified by the code style.
[0096] Optionally, the multiple attribute information includes a code issuing agency identifier,
[0097] The code generating unit 502 is specifically configured to: generate a graphic code based on the updated target code scheme when verifying that the initiator of the code generating request is the preset code issuing agency represented by the code issuing agency identifier;
[0098] and / or,
[0099] The device further comprises an encryption unit 510, which is used to encrypt the generated graphic code based on the agency key of the preset code issuing agency represented by the code issuing agency identifier.
[0100] Optionally, the multiple types of attribute information include a code application identifier, and the device further includes:
[0101] The application verification unit 511 is used to respond to a decoding request initiated for the graphic code, and parse the graphic code based on the updated target code scheme when verifying that the initiator of the decoding request is the preset code application represented by the code application identifier.
[0102] Based on the same concept as the above method, this specification also provides an electronic device, including: a processor; a memory for storing processor executable instructions; wherein the processor implements the steps of the method described in any of the above embodiments by running the executable instructions.
[0103] Based on the same concept as the above method, this specification also provides a computer-readable storage medium on which computer instructions are stored. When the instructions are executed by a processor, the steps of the method described in any of the above embodiments are implemented.
[0104] Based on the same concept as the above method, this specification also provides a computer program product, including a computer program / instruction, which implements the steps of the method described in any of the above embodiments when executed by a processor.
Claims
1. A method for generating a graphic code, characterized in that: include: In response to an attribute update instruction issued for a target code scheme, determining first attribute information to be updated from a plurality of attribute information of the target code scheme, and updating the first attribute information to second attribute information indicated by the attribute update instruction; In response to a code generation request initiated for the updated target code scheme, a graphic code is generated based on the updated target code scheme.
2. The method according to claim 1, characterized in that The step of determining first attribute information to be updated from the multiple attribute information of the target code scheme, and updating the first attribute information to second attribute information indicated by the attribute update instruction, comprises: According to the first attribute identifier carried by the attribute update instruction, first attribute information matching the first attribute identifier is determined from multiple attribute information of the target code scheme, and the first attribute information is updated to the second attribute information carried by the attribute update instruction.
3. The method according to claim 1, characterized in that Also includes: In response to a scheme update request initiated for the target code scheme, multiple candidate attribute information corresponding to the target code scheme is provided to the initiator of the scheme update request, and at least one selected candidate attribute information is determined as the second attribute information.
4. The method according to claim 1, characterized in that: Also includes: In response to the received code scheme generation instruction, the plurality of attribute information specified by the code scheme generation instruction is determined, and the target code scheme is generated based on the plurality of attribute information.
5. The method according to claim 1, characterized in that The target code scheme before updating has a first version number, and the method further includes: The updated target code scheme is assigned a second version number different from the first version number.
6. The method according to claim 1, characterized in that The target code scheme before updating is associated with the first code scheme development interface, and the method further includes: Associating the updated target code solution to the first code solution development interface to replace the target code solution before the update; or, The updated target code scheme is associated with a second code scheme development interface that is different from the first code scheme development interface.
7. The method according to claim 1, characterized in that The plurality of attribute information includes a code standard, and the method further includes: Based on the code standard in the updated target code scheme, a corresponding code generation script and a decoding script are generated.
8. The method according to claim 7, characterized in that In the case where the second attribute information includes the code standard, the method further includes: A plurality of candidate standard operators are provided to a user, and the code standard in the second attribute information is determined based on at least one target standard operator selected by the user from the plurality of candidate standard operators.
9. The method according to claim 7, characterized in that: The generating of the graphic code based on the updated target code scheme comprises: The graphic code is generated by executing the code generation script.
10. The method according to claim 7, characterized in that Also includes: In response to a first type of decoding request initiated for the graphic code, extracting a graphic code image obtained by photographing the displayed graphic code from the first type of decoding request, and parsing the graphic code image by executing the decoding script; or, In response to a second type of decoding request initiated for the graphic code, a code value obtained by photographing and parsing the displayed graphic code is extracted from the second type of decoding request, and the code value is parsed by executing the decoding script.
11. The method according to claim 1, characterized in that: The plurality of attribute information includes code categories, and the generating of a graphic code based on the updated target code scheme includes: The code value corresponding to the field content of the code category is calculated according to a preset rule, and a graphic code is generated based on the code value.
12. The method according to claim 1, characterized in that The plurality of attribute information includes a code style, and the generating of a graphic code based on the updated target code scheme includes: The graphic code is generated by rendering according to the style parameters specified by the code style.
13. The method according to claim 1, characterized in that The multiple attribute information includes the code issuing agency identification, The generating of the graphic code based on the updated target code scheme includes: generating the graphic code based on the updated target code scheme when verifying that the initiator of the code generation request is the preset code issuing agency represented by the code issuing agency identifier; and / or, The method further includes: for a preset code issuing agency represented by the code issuing agency identifier, encrypting the generated graphic code based on an agency key of the preset code issuing agency.
14. The method according to claim 1, characterized in that The multiple types of attribute information include a code application identifier, and the method further includes: In response to a decoding request initiated for the graphic code, the graphic code is parsed based on the updated target code scheme when it is verified that the initiator of the decoding request is a preset code application represented by the code application identifier.
15. A device for generating a graphic code, characterized in that: include: an updating unit, configured to, in response to an attribute updating instruction issued for a target code scheme, determine first attribute information to be updated from a plurality of attribute information of the target code scheme, and update the first attribute information to second attribute information indicated by the attribute updating instruction; The code generating unit is used to generate a graphic code based on the updated target code scheme in response to a code generating request initiated for the updated target code scheme.
16. A system for generating a graphic code, characterized in that: include: The code management client is used to send a property update instruction to the code management server for the target code scheme managed by the code management server; The code management server is used to determine, in response to the attribute update instruction, first attribute information to be updated from the multiple attribute information of the target code scheme, and update the first attribute information to the second attribute information indicated by the attribute update instruction; A code generation client, used for initiating a code generation request to the code management server for the updated target code scheme; The code management server is further configured to generate a graphic code based on the updated target code scheme in response to the code generation request.
17. An electronic device, characterized in that: include: processor; A memory for storing processor-executable instructions; wherein the processor implements the steps of the method according to any one of claims 1 to 14 by executing the executable instructions.
18. A computer-readable storage medium, characterized in that: Computer instructions are stored thereon, and when the instructions are executed by a processor, the steps of the method according to any one of claims 1 to 14 are implemented.
19. A computer program product, characterized in that The method comprises a computer program / instruction, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 14.
Citation Information
Cited By
Generation of graphic code
WO2026051719A1