CN104517143B - For code coding, decoded method and apparatus and code coding/decoding system - Google Patents

For code coding, decoded method and apparatus and code coding/decoding system Download PDF

Info

Publication number
CN104517143B
CN104517143B CN201310461839.0A CN201310461839A CN104517143B CN 104517143 B CN104517143 B CN 104517143B CN 201310461839 A CN201310461839 A CN 201310461839A CN 104517143 B CN104517143 B CN 104517143B
Authority
CN
China
Prior art keywords
code
coding
encoded
image
content
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201310461839.0A
Other languages
Chinese (zh)
Other versions
CN104517143A (en
Inventor
杨扬
袁志俊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Banma Zhixing Network Hongkong Co Ltd
Original Assignee
Alibaba Group Holding Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201310461839.0A priority Critical patent/CN104517143B/en
Publication of CN104517143A publication Critical patent/CN104517143A/en
Priority to HK15105360.4A priority patent/HK1205313A1/en
Application granted granted Critical
Publication of CN104517143B publication Critical patent/CN104517143B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

This application discloses a kind of method and apparatus, a kind of method and apparatus for code decoding for code coding, a kind of code coding solution code system.The wherein method for code coding includes:Coding techniques and optional code system are selected according to code content to be encoded;Code system is selected, the code content to be encoded is encoded using selected coding techniques and code system;Coded graphics or image are generated according to coding result and export the coded graphics or image.The present processes make it that code duplication between different devices or exchange are simplified, and step is simple, and accuracy rate is high, can effectively improve the efficiency of software learning and exploitation.

Description

For code coding, decoded method and apparatus and code coding/decoding system
Technical field
This application involves encoding and decoding technique field, more particularly to a kind of method and apparatus for code coding, code Decoded method and apparatus, and a kind of code decoding system.
Background technology
The form of expression of information is varied, in order to facilitate the storage, transmission and use of information, many information occurs and compiles Code technology, such as:GB2312 Chinese character encodings technology, the image coding technique based on dot matrix or polar plot and one-dimensional Bar code and two-dimensional bar(Abbreviation Quick Response Code)Coding techniques etc..Current widely used planar bar code technology is with specific several What figure is according to certain rules in plane(On two-dimensional directional)The chequered with black and white rectangle square formation record data symbol information of distribution Barcode technology of new generation, have contain much information, error correcting capability is strong, recognition speed it is fast the features such as, be widely used in logistics, storage, The fields such as mobile payment, electronic certificate.Mobile phone two-dimension code is then application of the planar bar code technology on mobile phone.At present, Quick Response Code with And other coding techniques are all mainly that information is encoded, input information typically includes the character string of specific meanings, example Such as:The URL of website, billing information, public service information etc..
On the other hand, the form of expression unification of code, is shown with meeting the character string forms of certain syntax rule Or storage, thus the operation such as code duplication between different devices, exchange also can only all use conventional method, usually by Network connection, is realized or is used the storage mediums such as USB in a manner of file-sharing either mail transmission, and step is comparatively laborious, And to rely on network or other storage devices.Specifically in field of software development, developer is in study or work sometimes During want to quickly see the implementation effect of code snippet, but the duplication of code snippet, deployment and implementation procedure are but It is relative complex, it is especially particularly evident in the exploitation of mobile interchange application program.Such as:Tradition does mobile phone WebApp exploitations When, if necessary to run one section of code snippet, edit code fragment and complete code frame is copied to usually on exploitation machine In frame, then again by under the particular category of network copy to server, passing through the browser access server on mobile terminal On WebApp programs, finally check operational effect on mobile terminals.Whole process step is more, error-prone so that software Practise or development efficiency is low.
If using the direct scanning recognition code of OCR technique, the reproduction process of above-mentioned code can be simplified, but current Identification technology accuracy is very poor, can not ensure the correctness of the code after identification, can not equally solve software learning or exploitation The problem of inefficiency.
The content of the invention
The application provides a kind of method and apparatus for code coding, to solve asking for the method for existing code coding Topic.In addition the application provides a kind of method and apparatus for code coding, code coding solution code system.
A kind of method for code coding of the application, including:
Coding techniques and optional code system are selected according to code content to be encoded;
Code system is selected, the code content to be encoded is encoded using selected coding techniques and code system;
Coded graphics or image are generated according to coding result and export the coded graphics or image.
Optionally, it is described to select coding techniques and optional code system to specifically include according to code content to be encoded:
The coding techniques that selection can be exported code content coding result with figure or image mode, and selection can The code system of alphabet included in support code and symbol.
Optionally, the coding techniques is Quick Response Code coding techniques.
Optionally, the code system for QRCode, Data Matrix, Maxi Code, Aztec, QR Code, Vericode, It is a kind of in PDF417, Ultracode, Code49 or Code16K.
Optionally, the selection code system, using selected coding techniques and code system to the code content to be encoded Carrying out coding includes:
A kind of code system is selected in optional code system;
Code is treated with the code system of selection to be encoded;
Judge whether the code length after coding is less than or equal to the maximum capacity of currently used code system, if so, coding Code afterwards is coding result, end-of-encode;
A kind of if not, the step of selecting code system in optional code system described in returning.
Optionally, before described the step of being encoded with the code system of selection to code, to the code to be encoded into Row compression;Alternatively,
Code length after judging to encode is more than the maximum capacity of currently used code system, and the code to be encoded is carried out Compression, and be back to and treat the step of code is encoded with the code system of selection.
Optionally, it is described the code to be encoded is compressed including:
Chinese content in the code content to be encoded is encoded by UTF-8, and coding is resolved into 1-3 byte, Each byte is encoded into hexadecimal code by ASCII;
Compression processing is performed to the remainder for being encoded to hexadecimal code and content to be encoded.
Optionally, it is described for each optional code system, judge whether the maximum capacity of the code system is not less than generation to be encoded In the length step of code,
If in all optional coding techniques and code system, if the capacity of each optional code system is respectively less than the compression of code to be encoded Length afterwards;Do not perform the step of being encoded to the code content to be encoded then, perform following steps:
And the code is uploaded onto the server end;
Receive the universal resource locator for the code storage that server end issues;
The universal resource locator is encoded.
Optionally, the selection code system, using selected coding techniques and code system to the code content to be encoded Carrying out coding includes:
Coded object classification is write in the encoded content of coding generation.
Optionally, the coded graphics or image generated according to coding result is image in 2 D code.
Correspondingly, the application also provides a kind of device for code coding, including:
Selecting unit, for according to code content to be encoded select coding techniques and with optional code system;
Coding unit, for selecting code system and using selected coding techniques and code system in the code to be encoded Appearance is encoded;
Generation and output unit, for generating coded graphics or image and by the coded graphics or figure according to coding result As output.
Optionally, the selecting unit, can be by code content coding result with figure or image side specifically for selection The coding techniques of formula output, and selection being capable of the code system of alphabet and symbol included in support code.
Optionally, the coding unit, specifically for using any one in Quick Response Code coding techniques and following code systems Code system encodes the code content to be encoded:QRCode、Data Matrix、Maxi Code、Aztec、QR Code、 Vericode, PDF417, Ultracode, Code49 or Code16K
Optionally, the coding unit includes:
Code system selecting unit, for selecting a kind of code system in optional code system;
Encoding performing unit, is encoded for treating code with the code system of selection;
Judging unit, holds for judging whether the code length after encoding is less than or equal to the maximum of currently used code system Amount, if so, the code after coding is coding result, end-of-encode.
Optionally, the coding unit further includes:
Compression unit, for before described the step of being encoded with the code system of selection to code, to described to be encoded Code is compressed;Alternatively, the code length after judging to encode is more than the maximum capacity of currently used code system, wait to compile to described Code code is compressed, and is back to and is treated the step of code is encoded with the code system of selection.
Optionally, the compression unit includes:
Chinese language processing unit, for the Chinese content in the code content to be encoded to be encoded by UTF-8, and will coding 1-3 byte is resolved into, each byte is encoded into hexadecimal code by ASCII;
Execution unit is compressed, for being held to the remainder for being encoded to hexadecimal code and content to be encoded Row compression is handled.
Optionally, the coding unit includes:
Classification writing unit, for writing coded object classification in the encoded content of coding generation.
In addition, the application also provides a kind of method for code decoding, including:
Obtain coded graphics or image;
Identify coded graphics or the coding techniques and code system of image use;
Coded graphics or image are parsed;
Coded object type after parsing is decoded for the code of code coding, obtains source code.
Optionally, the coding techniques and code system that the identification coded graphics or image use include, by coded graphics Or image is scanned, the given shape or view finding figure of coded graphics or image are recognized, determines the coding techniques and code used System.
Optionally, coded object type carries out decoding and includes for the code of code coding after described pair of parsing:
Read type field in the word after parsing;
Judge the field contents code coding classification or universal resource locator coding sorts;
If code coding classification, then perform to after the parsing the step of content decoding;
If universal resource locator coding sorts, then in original generation, is obtained by server end by the universal resource locator Code.
Optionally, further include:The source code of acquisition is injected into default performing environment and container, and is run original Code.
Optionally, the default performing environment and container are to run on Web Runtime and provide WebApp Run the WebApp skeleton code set of required Runtime Library.
Correspondingly, the application, which also provides one kind, is used for code decoding device, including:
Coded image acquiring unit, for obtaining coded graphics or image;
Code system recognition unit, for identifying the coding techniques and code system of coded graphics or image use;
Resolution unit, for being parsed to coded graphics or image;
Decoding unit, for being decoded to coded object type after parsing for the code of code coding, obtains original generation Code.
Optionally, the decoding unit includes:
Reading unit, for reading type field in the word after parsing;
Type judging unit, for judging the field contents code coding classification or universal resource locator coding class Not;
Figure or image code execution unit, for content solution after being performed when coding sorts are code coding to the parsing The step of code;
Source code acquiring unit, for passing through the unified money when coding sorts are universal resource locator coding sorts Source finger URL obtains source code by server end.
Optionally, further include:
Code injection running unit, for the source code of acquisition to be injected into default performing environment and container, and Run source code.
In addition, the application also provides a kind of code coding/decoding system, including:Code coding according to any of the above-described Device and any one of them code decoding device.
Compared with prior art, the application has the following advantages:The method for code coding that the application provides, to generation Code book body is encoded, and is exported in the form of coded graphics or image, this is not only easy to passing through figure during code decoding Or figure acquisition equipment captured after decode, and code duplication between different devices or exchange are able to simply Change, and whole process need not be by Internet resources or other storage devices, and also step is simple, and accuracy rate is high, Ke Yiyou Effect improves the efficiency of software learning and exploitation.
Brief description of the drawings
Fig. 1 is the flow chart of the embodiment of the method for code coding of the application;
Fig. 2 is the schematic diagram of the embodiment of the device for code coding of the application;
Fig. 3 is the flow chart of the embodiment of the method for code decoding of the application;
Fig. 4 is the schematic diagram of the embodiment of the device for code decoding of the application;
Fig. 5 is the schematic diagram of the embodiment of the code coding/decoding system of the application.
Embodiment
Many details are elaborated in the following description in order to fully understand the application.But the application can be with Much implement different from other manner described here, those skilled in the art can be in the situation without prejudice to the application intension Under do similar popularization, therefore the application is from the limitation of following public specific implementation.
In this application, a kind of method and apparatus for code coding, the method for code decoding are each provided And device, and a kind of code coding/decoding system.It is described in detail one by one in the following embodiments.
Please refer to Fig.1, it is a kind of flow diagram of embodiment for code coding method of the application.The side Method includes the following steps:
Step 101:Coding techniques and available code system are selected according to code content to be encoded.
The method of the present embodiment, the content for treating code are encoded, and not as believed in the prior art code Breath is encoded;In addition exported after the method coding of the present embodiment with image or figure.It is then desired in generation, is encoded according to band Digital content chooses suitable coding techniques and corresponding code system.That is, in the present embodiment, select the coding techniques that uses and Optional code system, should mainly meet that following both sides requires:First, the coding result of selected coding techniques can be with figure Or image mode output;Secondly, the code system in selected coding techniques being capable of alphabet and symbol included in support code.
For example, for a certain section of code, Quick Response Code coding techniques can be selected.Because the output of Quick Response Code coding techniques is Chequered with black and white rectangle square formation, Quick Response Code coding techniques include QRCode, Data Matrix, Maxi Code, Aztec, QR A variety of code systems such as Code, Vericode, PDF417, Ultracode, Code49 or Code16K.During if content to be encoded includes Man's information such as text, may be selected QRCode code systems, because what the 8bit bytes pattern of the code system can be included with support code Alphabet and symbol, including Chinese character.Certainly, in other embodiments, other coding techniques and code system can also be selected, such as One-dimension code encodes, and can select the combination of multiple code systems, as long as meeting above-mentioned two condition.
Setting for selected coding techniques and optional code system, can be previously defined in the code for performing code coding method In, patterned user interface or the control panel with button can also be used, prompts user to make a choice, or is used Other modes, are not limited thereto.
Step 102, code system is selected, the code content to be encoded is carried out using selected coding techniques and code system Coding;
After coding techniques is selected, it is also necessary to select a certain code system to treat code and encoded.When selecting code system, Whether one of problem needed to be considered code system maximum capacity can accommodate code content to be encoded.Specifically, first, can A kind of code system is selected in code selection system;Code is treated with the code system of selection to be encoded;Next, it is determined that the code length after coding Whether degree is less than or equal to the maximum capacity of currently used code system, if so, the code after coding is coding result, coding knot Beam;If it is not, then continuing to select a kind of code system not used to encode code in the optional code system, and continue to compiling Code after code is compared with corresponding code system capacity, is encoded to until choosing and treating code to available code system Only.
If, can also be to the generation to be encoded after the maximum capacity for judging a certain code system is less than the length of code to be encoded Code is compressed, and judges whether the maximum capacity of the code system is not less than the length of code to be encoded again.Wherein, the pressure Contracting is in order to make source code byte number as small as possible, to meet requirement of the corresponding code system to code length or capacity.Because appoint What code system is all corresponding capacity limit, has exceeded the capacity, then can not use the code system.With regard to needing to return to unified money Source finger URL(URL)It is long-range to obtain fetcher code mode.So compression is to accommodate more codes.Compress mode has very More such as more popular LZ and serial mutation(Deflate, LZW, LZR, LZX)Compression algorithm etc..Compression algorithm can be used Relatively common compression algorithm.
For example, select the above-mentioned code enumerated for one section of code for including Chinese, optional Quick Response Code coding techniques, code system System.For example, selection QRCode code systems are encoded.The code to be encoded is read first, is then pre-processed, will wherein Chinese character encoded according to UTF-8, and coding is resolved into 1-3 byte, each byte is encoded into hexadecimal by ASCII, then Add " % "(The processing of encodeURIComponent () in similar JavaScript), then by processed research content into 8 Bit ASCII code.
Code length is obtained, judges whether the code length after coding is less than or equal to the maximum appearance of the code system currently selected Amount.The max number of characters or byte number that every kind of code system can accommodate are different, such as:The 8bit bytes of QRCode code systems Pattern can accommodate 2953 bytes, and Data Matrix code systems can accommodate 1556 byte datas.If the code length after coding Beyond the maximum capacity of selected code system, then can not just generate correct coded graphics or image, or the code pattern of generation The code information that shape or image include is imperfect.Therefore to check whether the code length after coding is less than or equal to selected code system Maximum capacity, if it is, labeled as available code system;If not, currently used code system is identified as unusable, Ran Houchong Duplicate step, attempts to be encoded and judged using other code systems.
For long code, it is possible that the code length after coding is more than the feelings of selected code system maximum capacity Condition, in addition to other original code systems can be selected to be encoded, it is also an option that being compressed processing to code. , can be with before carrying out code coding, or when judging that the code length after coding is more than the maximum capacity of currently used code system Processing is compressed to code, the application is not construed as limiting for the compression method specifically used, as long as being ensured of for code Lossless compression, and achieve the purpose that shortening code length can.
If in all optional coding techniques and code system, if the capacity of each optional code system, which is respectively less than, encodes post code;Then will The code uploads onto the server end;Receive the universal resource locator for the record access code resource that server end issues (URL);The universal resource locator is encoded.
After suitable coding method and code system are chosen to code content coding, the code after being encoded, or fruit are adopted Upload code obtains URL to server-side and URL is encoded.That is, the coding result is probably after encoding Code, or can access and read the URL of code, in coding in the writable coding in the encoded content for encoding generation Object type, it is code or URL which, which is used for identification code data, in order to being distinguished when code decoding.
Step 103:Coded graphics or image are generated according to coding result and export the coded graphics or image.
Using planar bar code technology, the coded graphics or image generated according to coding result is the present embodiment above-mentioned steps Image in 2 D code.The generating process can be realized by calling the api function of open generation Quick Response Code, such as ZXing classes The encode () function for the MultiFormatWriter classes that storehouse provides, or realize using other api function of identical function.
If what is selected in above-mentioned steps is other coding techniques or code system, corresponding interface function can also be called, Or according to selected coding techniques and the standard and specification of code system, perform codeword sequence piecemeal, generation error correcting code, construction code word mould Block, arrange the similar steps such as code word module, mask to generate corresponding coded graphics or image.
The present embodiment is by the image in 2 D code of generation display output over the display.In other embodiments, can also Either on paper medium or use other patterned modes defeated in other display equipment coded graphics or image output Go out.
In the above-described embodiment, there is provided a kind of method for code coding, corresponding, the application also carries For a kind of device for code coding.Fig. 2 is refer to, it is illustrated for a kind of implementation of device for code coding of the application It is intended to.Since device embodiment is substantially similar to embodiment of the method, so describing fairly simple, related part is real referring to method Apply the part explanation of example.Device embodiment described below is only schematical.
A kind of device for code coding of the present embodiment, including:Selecting unit 201, for according to code to be encoded Content selection coding techniques and with optional code system;Coding unit 202, for selecting code system and using selected coding skill Art and code system encode the code content to be encoded;Generation and output unit 203, are compiled for being generated according to coding result Code figure or image simultaneously export the coded graphics or image.
Optionally, the selecting unit, can be by code content coding result with figure or image side specifically for selection The coding techniques of formula output, and selection being capable of the code system of alphabet and symbol included in support code.
Optionally, the coding unit, specifically for using any one in Quick Response Code coding techniques and following code systems Code system encodes the code content to be encoded:QRCode、Data Matrix、Maxi Code、Aztec、QR Code、 Vericode, PDF417, Ultracode, Code49 or Code16K
Optionally, the coding unit includes:Code system selecting unit, for selecting a kind of code system in optional code system;Compile Code execution unit, is encoded for treating code with the code system of selection;Judging unit, for judging the code after encoding Whether length is less than or equal to the maximum capacity of currently used code system, if so, the code after coding is coding result, coding Terminate.
Optionally, the coding unit further includes:Compression unit, for being compiled described with the code system of selection to code Before the step of code, the code to be encoded is compressed;Alternatively, the code length after judging to encode is more than currently used The maximum capacity of code system, is compressed the code to be encoded, and is back to and treats code with the code system of selection and carry out The step of coding.
Optionally, the compression unit includes:Chinese language processing unit, for by the Chinese in the code content to be encoded Content is encoded by UTF-8, and coding is resolved into 1-3 byte, and each byte is encoded into hexadecimal code by ASCII;Pressure Contracting execution unit, for being performed to the remainder for being encoded to hexadecimal code and content to be encoded at compression Reason.
Optionally, the coding unit includes:Classification writing unit, is compiled for being write in the encoded content of coding generation Code object type.
Corresponding with the above-mentioned method for code coding, the application also provides a kind of side for code decoding Method.Please refer to Fig.3, a kind of flow diagram of its embodiment for code decoding method provided for the application, the side Method includes:
Step 301, coded graphics or image are obtained.
For the coded graphics or image to be decoded using patterned way output, using with camera device or light The equipment of electric scanner, obtains the coded graphics or image.It is, for example, possible to use the mobile terminal with camera is treated Decoded coded graphics or image are taken pictures.It can also will show the application journey that image recognition is introduced directly into image on screen In sequence, to obtain the information of image or figure.
Step 302, coded graphics or the coding techniques and code system of image use are identified.
Before coded graphics or image are parsed and decoded, coding techniques and code system that identification uses are first had to. Various coding techniques and the code system rule that may be used according to coded graphics or image, one by one in scanning encoding image or image View finding figure either other possess the figures of similar functions and searched according to view finding figure or other figures for possessing similar functions Rope is as a result, determine coding techniques and the code system used.
For example, include three using Quick Response Code coding techniques and QRCode code systems, view finding figure in the present embodiment The identical position sensing figure in position, respectively positioned at the upper left of image in 2 D code, upper right, lower-left, and its module width ratio is 1:1:3:1:1, by searching the view finding figure of satisfactory QRCode code systems in view picture image in 2 D code, so that it is determined that Using planar bar code technology and QRCode code systems.
Step 303, coded graphics or image are parsed.
After the coding techniques and the code system that identify use, it is possible to which coded graphics or image are parsed.The mesh of parsing , the data content in coded graphics or image is exactly obtained, as carrying out decoded basis in next step.Adopt in the present embodiment It is QRCode code systems, resolving is exactly the data in the coding region read in image in 2 D code.Specifically implementing The MultiFormatReader classes that Cheng Zhong, the api function that open Quick Response Code can be called to parse, such as ZXing class libraries provide Decode () function, or realize using other api function of identical function.
Step 304, coded object type after parsing is decoded for the code of code coding, obtains source code.
For the coded graphics or figure formed after the above-mentioned coding to code content, coded graphics or image are parsed Afterwards, original code can be obtained by carrying out decoding using corresponding coding/decoding method.Specifically, to the number of coded graphics or image Decoded according to content, be the inverse process of code coding process.For example, above-mentioned encoded using 8 bit ASCII modes, first by number According to content recovery into the code stream carried out before 8 bit ASCII codings, then identify in code stream whether include Chinese character, if Chinese character, Just decoded according to UTF-8(Similar to the treated of decodeURIComponenet () function in JavaScript Journey), obtain source code.Decoding finishes, and judges whether decoded code includes data compression information, if including data pressure Contracting information, using with coding when the corresponding decompression algorithm of compression algorithm used, place is unziped it to decoded code Reason, obtains source code.
In addition, coded graphics or figure are possible to the situation encoded for URL, after being parsed to coded graphics or image, Judge whether comprising classification information and identify classification, if do not include classification information, or classification is code, then just to coding The data content of figure or image is decoded, and reduces source code;If if comprising reading is given birth in coding in coding Into encoded content in writable coded object classification.To comprising classification information be URL situation, illustrate coded graphics or figure The data content of picture is URL, then reads URL, and accesses the code of URL storages, obtains source code.
The above-mentioned method for being used for code coding and code decoding, is greatly improved the efficiency of coding and decoding, and puts The limitation to networking requirements in code transmittance process is taken off.
The code of commissioning test is needed for some, for the ease of seeing the operational effect of source code, will can also be led to Cross and above-mentioned code is coded and decoded;The source code of acquisition is very easily injected into performing environment and container, and Run source code.Specifically, when tradition does mobile phone WebApp exploitations, if necessary to run one section of code sample, it is necessary to will This section of code copies into a complete code frame, then again integral deployment to operation on WebOS or by clear on mobile phone Device of looking at accesses and WebApp on runtime server.Whole process is cumbersome and easy error, is intended merely to learn code sometimes, Effect is had a look, but to carry out many steps could complete to see operational effect., can be directly by WebApp by above-mentioned method Code sample carry out being encoded to two-dimension code image, then scanned by mobile phone camera on mobile phone, and used on mobile phone The method stated is decoded.Further, using WebApp codes in itself it is possessed can Dynamic Execution the characteristics of, by code It is placed on mobile phone in preassembled performing environment and container, so that code normal operation.
The performing environment and container are a kind of special WebApp run on Web Runtime pre-set Code skeleton, the inside load and refer to the various storehouses of code needs.For example, the one section of WebApp code obtained for decoding, The performing environment and container pre-set is exactly a most basic HTML/JavaScript/CSS code skeleton, and the inside adds Carry code and performed required various storehouses, by code skeleton described in decoded WebApp code injections, utilize WebApp generations Possessed by code book body can Dynamic Execution the characteristics of, it is possible to direct operation code, it is seen that operation result.
Due to providing these Runtime Libraries, in addition WebApp codes have the characteristics that in itself can Dynamic Execution, one section WebApp codes can the ability based on these storehouses directly run on Web Runtime, without any compilation process.Than Such as:What one section of WebApp code was so write:
$(“#result”).text(“hello world”);
It can be seen that above-mentioned code refer to jQuery storehouses, because having used this distinctive function in jQuery storehouses.And this This WebApp code of body in other common performing environments and container if no jQuery storehouses can not normally perform, That is at this moment if support without WebApp skeleton codes, this section of code can not just be run.The scheme of itself Performing environment and container itself built-in a variety of html templates and the common storehouses of a variety of WebApp or frame, and can be automatic Loading.
In addition, the Web Runtime additionally provide the detection that storehouse is quoted in a kind of code and installation mechanism, held when for the first time When the $ functions that row finds to quote are not present, Web Runtime can automatically be downloaded from the Internet and be installed these storehouses, and perform ring These references are automatically added in border and container.In this way, this section of WebApp code can be suitable in this performing environment and container The transparent execution of profit.
In the above-described embodiment, there is provided a kind of method for code decoding, corresponding, the application also carries For a kind of device for code decoding.Fig. 4 is refer to, it is illustrated for a kind of implementation of device for code decoding of the application It is intended to.Since device embodiment is substantially similar to embodiment of the method, so describing fairly simple, related part is real referring to method Apply the part explanation of example.Device embodiment described below is only schematical.
One kind of the present embodiment is used for code decoding device, including:Coded image acquiring unit 401, encodes for obtaining Figure or image;Code system recognition unit 402, for identifying the coding techniques and code system of coded graphics or image use;Parsing is single Member 403, for being parsed to coded graphics or image;Decoding unit 404, for being code to coded object type after parsing The code of coding is decoded, and obtains source code.
Optionally, the decoding unit includes:Reading unit, for reading type field in the word after parsing;Type Judging unit, for judging the field contents code coding classification or universal resource locator coding sorts;Figure or image Code execution unit, for when coding sorts are code coding perform to the parsing after content decoding the step of;Source code Acquiring unit, for when coding sorts are universal resource locator coding sorts by the universal resource locator by server End obtains source code.
Optionally, further include:Code injection running unit, for the source code of acquisition to be injected into default execution ring In border and container, and run source code.
The embodiment of the present application additionally provides a kind of code coding/decoding system, as shown in figure 5, the system includes above-described embodiment The code coding device 501 and code decoding device 502.The code coding device and code decoding device, can be with cloth Computer is placed in, mobile terminal can also be arranged in, but is not limited to both equipment, above-mentioned code can be that by Coding method or any equipment of code decoding method.For example, code coding device is arranged on computer, code can be read And perform code coding method and exported in the form of figure or image over the display, code decoding device is arranged in carry and takes the photograph As head mobile terminal on, taken pictures using camera to the coded graphics on computer display or image, and perform generation Code coding/decoding method, it is possible to restore source code on mobile terminals.If source code have the characteristics that can Dynamic Execution, Such as WebApp codes, and mobile terminal has been prefixed performing environment and container, then can quickly see original The operational effect of code.
Code decoding method provided by the embodiments of the present application, device and system, can quickly realize that code is set in difference Duplication and exchange between standby, whole process need not be by Internet resources or other storage devices, and step is simple, accurately Property it is high, so as to effectively improve the efficiency of software learning and exploitation.
In a typical configuration, computing device includes one or more processors (CPU), input/output interface, net Network interface and memory.
Memory may include computer-readable medium in volatile memory, random access memory (RAM) and/or The forms such as Nonvolatile memory, such as read-only storage (ROM) or flash memory (flash RAM).Memory is computer-readable medium Example.
1st, computer-readable medium can be by any side including permanent and non-permanent, removable and non-removable media Method or technology realize that information stores.Information can be computer-readable instruction, data structure, the module of program or other numbers According to.The example of the storage medium of computer includes, but are not limited to phase transition internal memory (PRAM), static RAM (SRAM), dynamic random access memory (DRAM), other kinds of random access memory (RAM), read-only storage (ROM), electrically erasable programmable read-only memory (EEPROM), fast flash memory bank or other memory techniques, read-only optical disc are read-only Memory (CD-ROM), digital versatile disc (DVD) or other optical storages, magnetic cassette tape, tape magnetic rigid disk storage or Other magnetic storage apparatus or any other non-transmission medium, the information that can be accessed by a computing device available for storage.According to Herein defines, and computer-readable medium does not include non-temporary computer readable media (transitory media), such as modulates Data-signal and carrier wave.
2nd, it will be understood by those skilled in the art that embodiments herein can be provided as method, system or computer program production Product.Therefore, the application can use the embodiment in terms of complete hardware embodiment, complete software embodiment or combination software and hardware Form.Moreover, the application can use the computer for wherein including computer usable program code in one or more can use Storage medium(Including but not limited to magnetic disk storage, CD-ROM, optical memory etc.)The computer program product of upper implementation Form.
Although the application is disclosed as above with preferred embodiment, it is not for limiting the application, any this area skill Art personnel are not being departed from spirit and scope, can make possible variation and modification, therefore the guarantor of the application Shield scope should be subject to the scope that the application claim is defined.

Claims (26)

  1. A kind of 1. method for code coding, it is characterised in that including:
    Coding techniques and optional code system are selected according to code content to be encoded;
    Code system is selected, the code content to be encoded is encoded using selected coding techniques and code system, is compiled Code result;
    Coded graphics or image are generated according to coding result and export the coded graphics or image.
  2. 2. the method according to claim 1 for code coding, it is characterised in that described according to code content to be encoded Selection coding techniques and optional code system specifically include:
    The coding techniques that selection can be exported code content coding result with figure or image mode, and selection can be supported The code system of alphabet included in code and symbol.
  3. 3. the method according to claim 2 for code coding, it is characterised in that the coding techniques is compiled for Quick Response Code Code technology.
  4. 4. the method according to claim 3 for code coding, it is characterised in that the code system is QRCode, Data In Matrix, Maxi Code, Aztec, QR Code, Vericode, PDF417, Ultracode, Code 49 or Code 16K It is a kind of.
  5. 5. the method according to claim 1 for code coding, it is characterised in that the selection code system, using described The coding techniques and code system of selection carry out coding to the code content to be encoded to be included:
    A kind of code system is selected in optional code system;
    Code is treated with the code system of selection to be encoded;
    Judge whether the code length after coding is less than or equal to the maximum capacity of currently used code system, if so, after coding Code is coding result, end-of-encode;
    A kind of if not, the step of selecting code system in optional code system described in returning.
  6. 6. the method according to claim 5 for code coding, it is characterised in that in the code system with selection to generation Before the step of code is encoded, the code to be encoded is compressed;Alternatively,
    Code length after judging to encode is more than the maximum capacity of currently used code system, and the code to be encoded is pressed Contracting, and be back to and treat the step of code is encoded with the code system of selection.
  7. 7. according to any method for code coding of claim 5 or 6, it is characterised in that described to wait to compile to described Code code be compressed including:
    Chinese content in the code content to be encoded is encoded by UTF-8, and coding is resolved into 1-3 byte, each Byte is encoded into hexadecimal code by ASCII;
    Compression processing is performed to the remainder for being encoded to hexadecimal code and content to be encoded.
  8. 8. the method according to claim 6 for code coding, it is characterised in that the code length judged after coding Whether degree is less than or equal in the maximum capacity step of currently used code system,
    If in all optional coding techniques and code system, if the capacity of each optional code system is respectively less than length after the compression of code to be encoded Degree;Do not perform the step of being encoded to the code content to be encoded then, perform following steps:
    And the code is uploaded onto the server end;
    Receive the universal resource locator for the code storage that server end issues;
    The universal resource locator is encoded.
  9. 9. the method for code coding according to claim 1 or 8, it is characterised in that the selection code system, using institute State the coding techniques of selection and code system carries out coding to the code content to be encoded and includes:
    Coded object classification is write in the encoded content of coding generation.
  10. 10. the method according to claim 3 for code coding, it is characterised in that the volume generated according to coding result Code figure or image are image in 2 D code.
  11. A kind of 11. device for code coding, it is characterised in that including:
    Selecting unit, for according to code content to be encoded select coding techniques and with optional code system;
    Coding unit, for select code system and using selected coding techniques and code system to the code content to be encoded into Row coding, obtains coding result;
    Generation and output unit, for generating coded graphics or image and the coded graphics or image is defeated according to coding result Go out.
  12. 12. the device according to claim 11 for code coding, it is characterised in that
    The selecting unit, the coding that code content coding result can be exported with figure or image mode specifically for selection Technology, and selection being capable of the code system of alphabet and symbol included in support code.
  13. 13. the device according to claim 12 for code coding, it is characterised in that the coding unit, it is specific to use Any one code system in using Quick Response Code coding techniques and following code systems encodes the code content to be encoded: QRCode、Data Matrix、Maxi Code、Aztec、QR Code、Vericode、PDF417、Ultracode、Code 49 Or Code 16K.
  14. 14. the device according to claim 11 for code coding, it is characterised in that the coding unit includes:
    Code system selecting unit, for selecting a kind of code system in optional code system;
    Encoding performing unit, is encoded for treating code with the code system of selection;
    Judging unit, for judging whether the code length after encoding is less than or equal to the maximum capacity of currently used code system, such as Fruit is, the code after coding is coding result, end-of-encode.
  15. 15. the device according to claim 14 for code coding, it is characterised in that the coding unit further includes:
    Compression unit, for before described the step of being encoded with the code system of selection to code, to the code to be encoded It is compressed;Alternatively, the code length after judging to encode is more than the maximum capacity of currently used code system, to the generation to be encoded Code is compressed, and is back to and is treated the step of code is encoded with the code system of selection.
  16. 16. the device according to claim 15 for code coding, it is characterised in that the compression unit includes:
    Chinese language processing unit, for the Chinese content in the code content to be encoded to be encoded by UTF-8, and coding is decomposed Into 1-3 byte, each byte is encoded into hexadecimal code by ASCII;
    Execution unit is compressed, for performing pressure to the remainder for being encoded to hexadecimal code and content to be encoded Contracting is handled.
  17. 17. the device according to claim 11 for code coding, it is characterised in that the coding unit includes:
    Classification writing unit, for writing coded object classification in the encoded content of coding generation.
  18. A kind of 18. method for code decoding, it is characterised in that including:
    Obtain coded graphics or image;
    Identify coded graphics or the coding techniques and code system of image use;
    Coded graphics or image are parsed;
    Coded object type after parsing is decoded for the code of code coding, obtains source code.
  19. 19. the method according to claim 18 for code decoding, it is characterised in that the identification coded graphics or figure As the coding techniques and code system that use include, by being scanned to coded graphics or image, coded graphics or image are recognized Given shape or view finding figure, determine coding techniques and the code system used.
  20. 20. the method according to claim 18 for code decoding, it is characterised in that coded object after described pair of parsing Type carries out decoding for the code of code coding to be included:
    Read type field in the word after parsing;
    Judge the field contents code coding classification or universal resource locator coding sorts;
    If code coding classification, then perform to after the parsing the step of content decoding;
    If universal resource locator coding sorts, then source code is obtained by server end by the universal resource locator.
  21. 21. the method according to claim 18 for code decoding, it is characterised in that further include:By the original of acquisition Code injection runs source code into default performing environment and container.
  22. 22. the method according to claim 21 for code decoding, it is characterised in that the default performing environment and Container is to run on WebApp skeleton code collection that is on Web Runtime and providing the required Runtime Library of WebApp operations Close.
  23. 23. a kind of device for code decoding, is characterized in that, including:
    Coded image acquiring unit, for obtaining coded graphics or image;
    Code system recognition unit, for identifying the coding techniques and code system of coded graphics or image use;
    Resolution unit, for being parsed to coded graphics or image;
    Decoding unit, for being decoded to coded object type after parsing for the code of code coding, obtains source code.
  24. 24. the device according to claim 23 for code decoding, it is characterised in that the decoding unit includes:
    Reading unit, for reading type field in the word after parsing;
    Type judging unit, for judging the field contents code coding classification or universal resource locator coding sorts;
    Figure or image code execution unit, for content decoding after being performed when coding sorts are code coding to the parsing Step;
    Source code acquiring unit, for being determined when coding sorts are universal resource locator coding sorts by the unified resource Position symbol obtains source code by server end.
  25. 25. the device according to claim 23 for code decoding, it is characterised in that further include:
    Code injection running unit, for the source code of acquisition to be injected into default performing environment and container, and runs Source code.
  26. A kind of 26. code coding/decoding system, it is characterised in that including:According to any one of the claims 11 to 17 Code coding device;And
    Code decoding device according to any one of claim 23 to 25.
CN201310461839.0A 2013-09-30 2013-09-30 For code coding, decoded method and apparatus and code coding/decoding system Active CN104517143B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201310461839.0A CN104517143B (en) 2013-09-30 2013-09-30 For code coding, decoded method and apparatus and code coding/decoding system
HK15105360.4A HK1205313A1 (en) 2013-09-30 2015-06-05 Method and device for encoding and decoding and codec system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310461839.0A CN104517143B (en) 2013-09-30 2013-09-30 For code coding, decoded method and apparatus and code coding/decoding system

Publications (2)

Publication Number Publication Date
CN104517143A CN104517143A (en) 2015-04-15
CN104517143B true CN104517143B (en) 2018-04-20

Family

ID=52792407

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310461839.0A Active CN104517143B (en) 2013-09-30 2013-09-30 For code coding, decoded method and apparatus and code coding/decoding system

Country Status (2)

Country Link
CN (1) CN104517143B (en)
HK (1) HK1205313A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105677553A (en) * 2016-01-13 2016-06-15 浪潮(北京)电子信息产业有限公司 Method and system for recoding BUG

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101493901A (en) * 2009-02-27 2009-07-29 深圳华为通信技术有限公司 Two-dimensional code data compressing and decompressing method and terminal
CN101639899A (en) * 2008-07-30 2010-02-03 华为技术有限公司 Methods and devices for encoding and decoding two-dimension code and terminal
CN102004935A (en) * 2010-11-08 2011-04-06 佟野 LDPC (Low Density Parity Code)-based method for encoding and decoding two dimensional bar codes
CN102034127A (en) * 2009-09-28 2011-04-27 上海易悠通信息科技有限公司 Novel high-capacity two-dimensional barcode and system, encoding and decoding methods and applications thereof
CN102438067A (en) * 2011-10-25 2012-05-02 福州博远无线网络科技有限公司 Method for installing mobile phone software by mobile phone scanning two-dimension code
CN102882993A (en) * 2012-10-19 2013-01-16 北京奇虎科技有限公司 Computing device and downloading method thereof
CN102984364A (en) * 2012-11-14 2013-03-20 苏州薇思雨软件科技有限公司 Method of downloading software through two-dimension code recognition by cell phone

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101639899A (en) * 2008-07-30 2010-02-03 华为技术有限公司 Methods and devices for encoding and decoding two-dimension code and terminal
CN101493901A (en) * 2009-02-27 2009-07-29 深圳华为通信技术有限公司 Two-dimensional code data compressing and decompressing method and terminal
CN102034127A (en) * 2009-09-28 2011-04-27 上海易悠通信息科技有限公司 Novel high-capacity two-dimensional barcode and system, encoding and decoding methods and applications thereof
CN102004935A (en) * 2010-11-08 2011-04-06 佟野 LDPC (Low Density Parity Code)-based method for encoding and decoding two dimensional bar codes
CN102438067A (en) * 2011-10-25 2012-05-02 福州博远无线网络科技有限公司 Method for installing mobile phone software by mobile phone scanning two-dimension code
CN102882993A (en) * 2012-10-19 2013-01-16 北京奇虎科技有限公司 Computing device and downloading method thereof
CN102984364A (en) * 2012-11-14 2013-03-20 苏州薇思雨软件科技有限公司 Method of downloading software through two-dimension code recognition by cell phone

Also Published As

Publication number Publication date
CN104517143A (en) 2015-04-15
HK1205313A1 (en) 2015-12-11

Similar Documents

Publication Publication Date Title
CN104185845B (en) For the system and method for the binary representation for providing webpage
US9390437B2 (en) Method and system for monitoring advertisement displays
US9208420B2 (en) Techniques for generating customized two-dimensional barcodes
CN107341399B (en) Method and device for evaluating security of code file
CN110688307B (en) JavaScript code detection method, device, equipment and storage medium
US10325097B2 (en) Static detection of context-sensitive cross-site scripting vulnerabilities
US8807434B1 (en) Techniques for generating customized two-dimensional barcodes
US8209341B2 (en) Configurable transformation macro
Brody et al. A structural model for contextual code changes
CN111125598A (en) Intelligent data query method, device, equipment and storage medium
US20150215372A1 (en) Information Sharing Method and System
CN101526963A (en) Method for identifying web page coding, device and terminal equipment
CN109145235B (en) Method and device for analyzing webpage and electronic equipment
CN104699706A (en) Directory tree generation method, device and system
US20210064453A1 (en) Automated application programming interface (api) specification construction
CN106843878A (en) A kind of model generating method and system
CN107463935A (en) Application class methods and applications sorter
US20210271494A1 (en) Vector-space representations of graphical user interfaces
CN104978325B (en) A kind of web page processing method, device and user terminal
CN107944525A (en) A kind of method and system of the expansion Quick Response Code capacity based on data segmentation
CN108388796B (en) Dynamic domain name verification method, system, computer device and storage medium
CN104517143B (en) For code coding, decoded method and apparatus and code coding/decoding system
WO2024113874A1 (en) Encoding method and decoding method for annular 2-dimensional bar code
CN109685186A (en) Extensive content customization method based on two-dimentional idle bit
CN112069549B (en) Method and system for downloading picture when Bootstrap-table plug-in exports table

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 1205313

Country of ref document: HK

GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20201118

Address after: Room 603, 6 / F, Roche Plaza, 788 Cheung Sha Wan Road, Kowloon, China

Patentee after: Zebra smart travel network (Hong Kong) Limited

Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands

Patentee before: Alibaba Group Holding Ltd.

TR01 Transfer of patent right