CN108876415A - A kind of agricultural input product traceability system and method - Google Patents

A kind of agricultural input product traceability system and method Download PDF

Info

Publication number
CN108876415A
CN108876415A CN201810732556.8A CN201810732556A CN108876415A CN 108876415 A CN108876415 A CN 108876415A CN 201810732556 A CN201810732556 A CN 201810732556A CN 108876415 A CN108876415 A CN 108876415A
Authority
CN
China
Prior art keywords
product
code
key
data
traceability code
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.)
Pending
Application number
CN201810732556.8A
Other languages
Chinese (zh)
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.)
Jiangsu Agri Animal Husbandry Vocational College
Original Assignee
Jiangsu Agri Animal Husbandry Vocational College
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 Jiangsu Agri Animal Husbandry Vocational College filed Critical Jiangsu Agri Animal Husbandry Vocational College
Priority to CN201810732556.8A priority Critical patent/CN108876415A/en
Publication of CN108876415A publication Critical patent/CN108876415A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/018Certifying business or products
    • G06Q30/0185Product, service or business identity fraud

Landscapes

  • Business, Economics & Management (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Accounting & Taxation (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Finance (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses the traceability code of agricultural input product traceability code coding, encryption and anti-fake retroactive methods, study the agricultural input product traceability system encoded based on EPC, system architecture, process are designed in conjunction with Taizhou agricultural input product supervision information platform, primary study data access, data parsing, coding are realized, trace the Implementation Technologies such as inquiry, and a kind of lightweight traceability system application solution is provided.This method has important practical value and directive significance to internet+agricultural input product safe tracing management.

Description

A kind of agricultural input product traceability system and method
Technical field
The invention belongs to agricultural product production information fields, have particularly related to agricultural input product traceability code Traceability code coding, encryption and anti-fake retroactive method.
Background technique
Agricultural input product is agricultural data used in agricultural product production process, including pesticide, fertilizer, seed, veterinary drug, fishing Medicine, feed and additive, growth regulation etc., agricultural input product are basis and the important composition of agricultural product and food safety safely Part.Agricultural input product traceable system provides the credible retrospect of agricultural input product and peace towards multidisciplinary, multiagent, multi-user Full management powerful measure, provides high-quality, lasting, High-effective Service for government, enterprise, consumer.Agricultural input product traceability system is The informationization of agricultural input product supply chain quality management, intelligentized control method network system, play the part of in agricultural input product safety management Key player.The technologies such as integrated use article mark, (movement) internet, Internet of Things, by production, storage, fortune, pin, with etc. supply Acquisition, exchange and the storage of chain critical control point information quick and precisely identify product, trace to the source, track, quality-monitoring and control System realizes product, quality, the retrospect target of responsibility, ensures agricultural input product safety.
Summary of the invention
The present invention is designed agricultural input product traceability code with EPC, proposes traceability code coding, encryption and anti-fake retrospect Method studies the agricultural input product traceability system encoded based on EPC, and in conjunction with JSTRP platform, (Taizhou agricultural input product supervises information Platform) system architecture, process are designed, primary study data access, data parsing, coding are realized, trace the skills such as inquiry Art implementation method provides a kind of lightweight traceability system application solution.This method chases after safely internet+agricultural input product Management of tracing back has important practical value and directive significance.
On the one hand, digital coding method is chased after the present invention provides a kind of agricultural input product, the method includes as follows Step:
(1) 64 traceability code structures are generated, code conversion is carried out to 64 traceability code structures, forms 21 initial codes;
(2) the initial traceability code is encrypted, including:The digital sequence being made of domain name supervising number, timestamp Column are used as initial key;
(3) initial code, initial key are inputted, key generator is created, key generator is used for according to initial key generation The dynamic key of encryption;
(4) dynamic key generates one group of expanded keys, creates encrypted object, and the encrypted object is close complete using extending It is operated at a group encryption, obtains encryption data;
(5) encryption data is converted to the traceability code of decimal representation;
(6) traceability code for being converted to decimal representation to encryption data is decrypted, including:Read traceability code, initial close Key generates dynamic key according to initial key, for decrypting by AES key generator;
(7) by one group of expanded keys of dynamic key production, object is decrypted in creation, and the decryption object is held using expanded keys One group of decryption oprerations of row obtain the ciphertext data of bytecode form;
(8) ciphertext data is converted into decimal code and is reduced to initial code.
In one embodiment, 64 traceability code structures are designed with minimal information amount cryptoprinciple, by Version number+supply trading company+product category number+sequence number is constituted.
In one embodiment, by 64 traceability code initial codes with decimal representation, length is 21 after converting.
In one embodiment, in 21 codings, version number is 1 bit digital N1 (N1=2);Supplying trading company is 5 (P1P2P3P4P5), number is in order since 00001 to 32768;Product category number 4 (T1T2T3T4), by countryside tax system Product major class+agricultural input product group composition, preceding 2 (T1T2) represent agricultural input product major class, including pesticide, fertilizer, seed, beast Medicine, fishing medicine, feed, feed addictive, growth regulation, agricultural film and other, number from 01 to 10, maximum number be 81;2 afterwards (T3T4) agricultural input product group, including Insecticides (tech) & Herbicides (tech), fungicide, biological pesticide, plant growth regulator, agriculture are indicated Medicine raw medicine, other pesticides etc., number from 01 to 92.Product ID is 11 (X1X2X3X4 ... X11), indicates similar product With a batch of single article, number expression from 00000000001 to 17179869184 in order.
At two aspects, digital coded system is chased after the present invention provides a kind of agricultural input product, the system comprises:Client End, server-side, communication layers;
The communication layers such as Internet network connection client and server-side, provide remote access and data are transmitted;
The client is located at View layers, provides the UI operational view interfaces such as user's login, product coding, retrospect inquiry;
The server-side builds cloud computing server platform, including tri- layers of IaaS, PaaS, SaaS.
In one embodiment, the client includes the bases such as PC host, intelligent read-write device, network interface card, storage equipment Infrastructure hardware equipment and software tool, intelligent read-write device are connect by RS232 or RS485 serial ports, RJ45 mode with PC host, are The software and hardware support platform of Web application service guarantees client basic function and performance requirement
In one embodiment, the server-side remote access, data parsing, traceability code coding, retrospect inquiry.
In one embodiment, the service end system is established long-range, executes traceability code coding, inquiry of the domain name, product The business such as identification, supply chain retrospect;
JSON data are converted to the persistence object of encapsulation visualized data by the data parsing;
The traceability code coding:User log in client after enter coded views, from view product list select product, Coding request is submitted, server-side executes coding business, returns to final traceability code and key, and reader marks traceability code write-in EPC Label, while key is presented to client user;
The retrospect inquiry:Product identification inquiry is provided when client retrospect inquiry, supply chain traces two selections, service End is passed to the label traceability code of reader recognition according to client, controls class by EPCAction to realize that traceability code is decrypted, remotely Access queries, data dissection process process.
At three aspects, the present invention provides the agricultural input product retrospect sides of the coded system using the second aspect of the present invention Method, including step:
(1) after user logs in FTP client FTP, product can be selected to be encoded from product list, after retrospect code encryption Label is written, and provides key for user, inquires and uses for product back-tracing;
(2) user holds label and key carries out product back-tracing inquiry, and read-write equipment reads label traceability code, by client It is committed to server-side by Internet network, server-side uses key recovery traceability code original text, analyzes, extracts fragment code letter Breath communicates with database platform foundation, accesses the database, nslookup, classification, batch number information;
(3) specified product is determined according to domain name, classification, batch number, remotely accesses the database, service termination again It is parsed after receiving retrospect inquiry data, parsing result is shown in client end interface, is presented to the user.
In one embodiment, the server-side remote access, data parsing, traceability code coding, retrospect inquiry.
In one embodiment, the service end system is established long-range, executes traceability code coding, inquiry of the domain name, product The business such as identification, supply chain retrospect;
JSON data are converted to the persistence object of encapsulation visualized data by the data parsing;
The traceability code coding:User log in client after enter coded views, from view product list select product, Coding request is submitted, server-side executes coding business, returns to final traceability code and key, and reader marks traceability code write-in EPC Label, while key is presented to client user;
The retrospect inquiry:Product identification inquiry is provided when client retrospect inquiry, supply chain traces two selections, service End is passed to the label traceability code of reader recognition according to client, controls class by EPCAction to realize that traceability code is decrypted, remotely Access queries, data dissection process process.
The agricultural input product traceability system that present invention research is encoded based on EPC, is designed agricultural input product traceability code, It is proposed traceability code coding, anti-fake encrpted method, in conjunction with Taizhou agricultural input product supervise information platform-JSTRP, to system architecture, Process is designed, and primary study data access, data parsing, coding are realized, trace the Implementation Technologies such as inquiry, provides one Kind lightweight application solution.Method of the invention efficiently solve singular id system trace back depth, the limitation of range and Deficiency reaches product, quality, Liability Retroact target, has important practical valence to internet+agricultural input product safe tracing management Value and directive significance.
Detailed description of the invention
By the following drawings, the present invention will be described
Fig. 1 shows a kind of traceability code coding structure.
Fig. 2 illustrates initial traceability code.
Fig. 3 shows the algorithm flow of ciphering process and decrypting process.
Fig. 4 shows exemplary system architecture.
Fig. 5 shows exemplary system flow.
Fig. 6 shows JSON data format.
Fig. 7 shows an illustrative Taizhou City agricultural input product retrospect inquiry system.
Specific embodiment
Agricultural input product is the basis of agricultural product and food safety safely, and agricultural input product traceability system is agricultural input product Quality management information intelligence control system realizes the product identification to supply chain critical control point, traces to the source, tracks, quality Monitoring and control, play an important role in agricultural input product safety management.Agricultural input product traceability system is by coded system, knowledge Other system, operation system, specialized database are constituted.Coded system establishes single article mark using the processing of coding quantification, Establish a product one yard, one one yard;Identifying system acquires article identification information, transmits, and the access of operation system shared data is handed over Function is changed, specialized database provides supply chain retrospect inquiry data, solves limitation of the singular id system on trace back depth, range And deficiency.Wherein, the technical methods such as traceability code coding, anti-fake certificate, supply chain retrospect inquiry are the emphasis of system building.
The present invention is based on the agricultural input product traceability systems of EPC coding, are designed to agricultural input product traceability code, propose Traceability code coding, anti-fake encrpted method supervise information platform-JSTRP in conjunction with Taizhou agricultural input product, to system architecture, process It is designed, primary study data access, data parsing, coding are realized, trace the Implementation Technologies such as inquiry, provide a kind of light Magnitude application solution.The system efficiently solves singular id system in trace back depth, the limitation of range and deficiency, reaches production Product, quality, Liability Retroact target there is important practical to be worth and instruct to anticipate internet+agricultural input product safe tracing management Justice.
The design of 1 agricultural input product traceability code
Agricultural input product traceability code is to carry the electronics mark that product identification information is presented when agricultural input product sale for user Know code.EPC (Electronic Product Code) i.e. product electronic code, the GS1 released for international article code tissue Global identity system a new generation coded system.Information reference effect is served as when the single item object of EPC identification, using management domain Name, object classification are main information-recording, replacement category, lot number, the numerous complicateds attribute information such as quantity, coded format is unified, Structure is simplified, working service facilitates, and linear parity position is avoided to distinguish, and identification read or write speed is fast.EPC coded system passes through Internet of Things FRID identifying system interconnects, Information share and exchange with internet platform, realize to supply chain production, service, position, The automatic accurate recognition and tracking of assets improves trade transparency, visuality and operational paradigm.
1.1 coding method
EPC is made of binary segmentation code, is had 64,96,256 three kinds of structures, can be identified single-item object number Up to 2nThe order of magnitude.The present invention uses EPC-64II coding structure, is designed with minimal information amount cryptoprinciple, by version number + supply trading company (management domain name)+product category number+sequence number constitutes (totally 64), can be 4.6 × 1018The single article of part provides Retrospect mark, much meets current demand.In view of traceability code label (usually FRID label) physical memory space is limited, remove Meet outside enough group/cording quantities, should also compression code length as far as possible, while being deposited convenient for code read-write, processing and network system It takes.Agricultural input product traceability code initial code is with decimal representation, and to reduce code length, 64 codes are carried out code conversion, Length is 21 (see Fig. 1, showing traceability code coding structure) after converting.In the coding, version number is 1 bit digital N1(N1= 2);Supply trading company is 5 (P1P2P3P4P5), it numbers in order since 00001 to 32768;Product category number 4 (T1T2T3T4), it is made of agricultural input product major class+agricultural input product group, preceding 2 (T1T2) agricultural input product major class is represented, it wraps Include pesticide, fertilizer, seed, veterinary drug, fishing medicine, feed, feed addictive, growth regulation, agricultural film and other, number from 01 to 10, maximum number is 81;2 (T afterwards3T4) indicate agricultural input product group, including Insecticides (tech) & Herbicides (tech), fungicide, biological agriculture Medicine, plant growth regulator, pesticide original medicine, other pesticides etc., number from 01 to 92.Product ID is 11 (X1X2X3X4…X11), indicate similar product with a batch of single article, in order number from 00000000001 to 17179869184 indicate.Illustrative initial traceability code is as shown in Figure 2.
1.2 encryption method
Traceability code is stored in EPC inside tags, and certain hidden function can be realized to traceability code.EPC label is to outgoing When sending plain code information, coding rule and information are easy to be monitored, crack, or even are illegally usurped, copied, distorted, and exist higher Security risk.For the safety for ensuring traceability code, it need to be encrypted using encryption method.Encryption technology is using symmetrical, non- It is symmetrical to wait key algorithms, traceability code is converted to the process of ciphertext in plain text.AES(Advanced Encryption Standard) For high-performance symmetric encipherment algorithm, the algorithm speed of service is fast, high-efficient, is difficult to crack after encryption, is highly-safe.AES encryption, solution The same key of secret emissary generates " key " using dynamic key (dynastic key) algorithm, i.e., what each encryption used Key is all different, effectively solves the problems, such as key safety.When AES hardware encrypts, according to initial key and lead on the terminal device Third wheel key algorithm generates each wheel dynamic key, control executes wheel number, and progress takes turns cryptographic calculation, is suitable for device memory Of less demanding, the limited situation of computing resource.
The present invention uses software enciphering method, and ciphering process, algorithm performance are realized under conditions of not having encryption device Height, complexity are low.Method of the invention executes cryptographic operation in user client, and remote service end runs encipheror, in this way Encrypted object can be positioned, while convenient for realizing that the anti-fake retrospect to information of supply chain is inquired by service platform database.It should In method, the Serial No. that initial key is domain name supervising number (domainID), timestamp (timestamp) is constituted, by servicing End distribution and offer.Domain name supervising number is vendor number, and timestamp is the character of server-side mark Internet correct time Sequence is accurate to ms (millisecond).Initial key has uniqueness and non-reproduction, guarantees encryption intensity and safety, is single One article initial code generates different traceability codes, it is ensured that traceability code uniqueness reaches one one yard of anti-fake retrospect effect.For example, Supply trading company is when to be 1011, the Internet time be 20171201036, initial key 101120171201036, to Fig. 2's Initial code 201310020500000001272 obtains decimal system retrospect code length and is less than 78bit after encrypting, meet EPC label and deposit It stores up capacity requirement (generally 1KB~10MB).Decryption is the inverse process of encryption, using the key authentication traceability code true and false and also originally Beginning code.Algorithm flow is as shown in Figure 3 (showing the algorithm flow of ciphering process and decrypting process).This method passes through Java language It realizes (complete code is shown in Table 1), algorithmic procedure is as follows:
Step1:Ciphering process
Step1-1 inputs initial code original, initial key iKey, creates AES key generator kgen, and key generates Device generates the 128bit dynamic key sercetKey for encryption according to initial key;
Step1-2 dynamic key generates one group of expanded keys kgen, creates encrypted object cipher, and cipher uses extension Key kgen completes group encryption operation, obtains byte encryption data;
Encryption data is converted to the traceability code of decimal representation by Step1-3.
Step2:Decrypting process
Step2-1 reads traceability code encrypted, initial key iKey, by AES key generator kgen according to initial close Key iKey generates 128bit dynamic key sercetKey for decrypting;
Step2-2 creates cipher object by one group of expanded keys kgen of dynamic key production, and cipher is close using extending Key executes one group of decryption oprerations, obtains the ciphertext data of bytecode form;
Decrypted result is converted into decimal code by Step2-3, is reduced to initial code.
The design of 2 systems
2.1 system architectures and process
Fig. 4 shows exemplary system architecture, and system uses the three-tier architecture based on B/S, i.e., client, server-side, Internet network (communication layers).Internet network connects client and server-side, provides remote access and data are transmitted.Visitor Family end includes infra structure hardwares equipment and the software tools such as PC host, intelligent read-write device, network interface card, storage equipment, intelligent read Device is connect by RS232 or RS485 serial ports, RJ45 mode with PC host, is the software and hardware support platform of Web application service, is protected Demonstrate,prove client basic function and performance requirement.Server-side builds cloud computing server platform, including tri- layers of IaaS, PaaS, SaaS. IaaS is basic facilities services layer, provides the United Dispatching management that multiple operating system, virtualization hardware and software resource, resource use, Mass data storage, calculating, complicated business processing are undertaken, service needed for user is quickly provided.PaaS is Component service layer, is provided Article code, smart-tag authentication and internal system data storage, processing, conversion etc. functions.SaaS is interface service layer, is provided long-range Access interface interconnects with JSTRP Platform Server, realizes data exchange, meets client data requirements for access.
JSTRP platform (http://tz.jstrp.com) it is towards prefecture-level area under one's jurisdiction supply chain modes, supervision and detection machine The three-level gridding agricultural input product of structure manages platform, and JSTRP database is the main source of system business data, provides enterprise Manage the basic number of the business datums and supplier's domain name, product, classification, batch etc. such as archives, supervision inspection and quality testing According to.System business process is:(1) after user logs in FTP client FTP, product can be selected to be encoded from product list, will chased after It traces back and label is written after code encryption, and provide key for user, inquire and use for product back-tracing;(2) user holds label and key Product back-tracing inquiry is carried out, read-write equipment reads label traceability code, is committed to server-side by Internet network by client, Server-side uses key recovery traceability code original text, analyzes, extracts fragment code information, communicates, accesses with the foundation of JSTRP platform JSTRP database, nslookup, classification, batch number information;(3) specified product is determined according to domain name, classification, batch number, then Secondary remote access JSTRP database, server-side are parsed after receiving retrospect inquiry data, parsing result are shown in client Interface is presented to the user.System flow is as shown in Figure 5.
2.2 tool and method of development
The present inventor selects MyEclipse8.5+Tomcat6.0 Integrated Development Environment IDE development system, MyEclipse8.5 is the Web application development tool of Genuitec company open source, and Tomcat6.0 is the clothes that Apache official provides Business device system deployment tool.Tomcat6.0 is integrated in MyEclipse8.5, disposes SSI (Struts2.0+Spring2.0+ IBatis) Lightweight J2EE Open Framework builds exploitation environment, is allowed to consistent with JSTRP platform, and it is poor to eliminate platform isomerization It is different.Using MVC design mode hierarchical design, including view layer (View), data exchange layer (Webservice), control layer (Action), operation layer (Biz), data persistence layer (DAO).Struts frame makes view layer, Web service layer and control layer phase point From control business jumps.IBatis serves as DAO layer assembly, completes data persistence operation.Journey is applied in the assembling of Spring frame Sequence, management global transaction, realize data interaction between server of the system and JSTRP platform.Simplify application program using SSI frame Assembling manages global application program in a manner of plug and play, reduces the software module degree of coupling, reduces overhead, improves operation Efficiency.Adaptive, the expansible characteristic of SSI frame keeps system development and maintenance more convenient, efficient.
3 systems are realized
System is divided into client and server-side.Client is located at View layers, provides user's login, product coding, retrospect are looked into The UI operational view interfaces such as inquiry.The controls such as HTML, Struts are placed in interface, utilize DIV+CSS set interface layout, control sample Formula is defined and is edited in engineering catalogue CSS, JS file.The offer of product coding view selects item to be encoded from product list, It traces query interface and the inquiry of product identification, supply chain retrospect is provided.The reception of client view interface, user bound event disappear Breath submits request with Form list, Ajax asynchronous system, shows result data.Server-side include EPC middleware, Service Component, Data exchange interface, Data Access Components are distributed in Webservice layers, Action layers, Biz layers, DAO layers, and each layer contains only one A component, interior component includes several operational approaches, and component is avoided excessively to cause server-side resource overhead problems of too.Among EPC Part is server-side Action layers of control assembly, receives client request, Biz layer assembly is called to be handled, realize service logic It executes, control and shifts, result data is presented for client user.Biz layer assembly definition retrospect coding, domain name and classification are looked into It askes, trace the operational approaches such as inquiry.DAO layer assembly executes system user login authentication SQL operation.Webservice layers of long-range visit It asks that interface and JSTRP Web Service interface establish communication interaction, inquires JSTRP database.In design of the invention, service The emphasis and key that end remotely accesses, data parse, traceability code encodes, retrospect inquiry is system realization.
3.1 remote access
When service end system executes the business such as traceability code coding, inquiry of the domain name, product identification, supply chain retrospect, need to establish Telecommunication, is interacted by server-side remote access interface with JSTRP platform and data exchange.With SOAP, WSDD, XML, UDDI send based on http protocol internet access request, including test communication connection, send remote request, establish session, Reception returns the result.
JSTRP platform provides point-to-point access by Web service interface and JSON data are transmitted.Design of the invention uses Customized remote access interface class RemoteAccess defines overloaded method getJSONData in class, by Action layer assembly institute It calls, realization is exchanged with JSTRP Platform communication.Step is:(1) RemoteAccess is created under webservice packet, HttpURLConnection instance objects and access identities are created in getJSONData method, are provided according to JSTRP platform Web service interface requests access to address URL, way of submission GET/POST, time delay for the setting of HttpURLConnection object The characteristics such as Timeout, protocol header Type C ontent-Type, caching UseCaches, are arranged parameter by passing when client call Enter;The tables of data and data item, including domain name, product, classification etc. of access identities instruction inquiry;(2) required parameter is appended to URL is submitted in a manner of POST, supports HTTP.UTF-8 coding transmission, test connection JSTRP server-side;(3) pass through GetResponseCode obtains server-side answer code, judges connection status, indicates to establish connection when answer code is 1;(4) first When connection, the client identification of JSTRP server-side distribution is obtained by the getHeaderFields of HttpURLConnection SessionId is stored in server of the system Cookie;(5) after successful connection, getJSONData receives JSTRP platform service end The JSON packaged data of transmission return to Action layer assembly (EPC middleware) method and do subsequent dissection process.
The parsing of 3.2 data
Remote access interface extracts the JSON data from network transmission, cannot directly be used by application program or as view The display data (text, number, symbol etc.) at figure interface.The target of data parsing is that it is visual that JSON data are converted to encapsulation Change the persistence object of data.JSON data are " key/value to " object, including JSONObject object, JSONArray set, JSONObject and JSONArray blending objects three types, Fig. 6 show JSON data format.For JSONObject, It is right by getString (key) the method acquisition " key/value " of JSONObject when JSON is parsed, it is packaged into persistence object VO; For JSONArray, JSON data are converted into ArrayList using JSONObject and ArrayList<VO>List;It is right JSONObject, JSONArray blending objects need simultaneously to be converted to JSON data using JSONArray, JSONObject HashMap<key,Vo>。
The open source library that the design uses Google to provide, using JSON data, when GSON is parsed, handled complex type data More it is simple and efficient.Resolving is:(1) jar file of GSON is imported in engineering project, configuration GSON parses environment, The lower creation Action layer assembly class EPCAction of action packet is as EPC middleware, the definition of the inside EPCAction GetObjectFromJSON (jsonData) analytic method, jsonData are that remote access interface getJSONData method obtains JSON parameter, be passed to when getObjectFromJSON is called by Action layer assembly practical business method;(2) GetObjectFromJSON analyzes JSON type, is directly converted by Gson instance method fromJson, JSON parameter type is VO object is converted to when JSONObject, when being JSONArray or JSONObject and JSONArray mixed type, is then converted For ArrayList<VO>;(3) EPCAction homophony method receives return data and is handled, to VO or ArrayList<VO> Simple process is carried out using the methods of get, the data such as number, text, image is can get, is presented on view interface.Complete code It is as follows.
3.3 traceability codes coding
User enters coded views after logging in client, and product is selected from view product list, submits coding request, clothes Business end executes coding business, returns to final traceability code and key, EPC label is written in traceability code by reader, while being in by key Now give client user.Implementation method is:(1) defined in Action layers of EPC middleware class EPCAction getProducts, Tri- methods of genTraceCode and encrypt, getProducts obtain product information to be encoded and are loaded into coded views; GenTraceCode executes initial code coding and ciphering process;Encrypt executes encipheror shown in table 1, by The control of Struts.xml frame executes;(2) it when coded views interface is loaded into, is called first by getProducts The getJSONData method of RemoteAccess remote access interface class obtains the JSON data of JSTRP platform passback, passes through GetObjectFromJSON analytic method is converted to ArrayList<productVo>List returns to the side getProducts Method;(3) getProducts analyzes ArrayList<productVo>Data extract productVo object, pass through ProductVo.getXXX method reads the information such as supplier, the name of an article, classification, specification, batch number, is presented on view interface;(4) When selecting appointed product in coded views, submitting coding request, genTraceCode receives incoming productVo object, mentions Domain name, the classification in productVo are taken, getJSONData remote inquiry is passed through and obtains vendor code, classification code and batch It number is encoded, generates initial code original;(5) initial code original is added when genTraceCode calls encrypt It is close, traceability code is generated, label is written by client serial ports.
3.4 retrospect inquiries
Two product identification inquiry, supply chain retrospect selections are provided when client retrospect inquiry, server-side is according to client The label traceability code of incoming reader recognition controls class by EPCAction to realize traceability code decryption, remote access inquiry, number According to dissection process process.Implementing step is:(1) query method and decrypt method are defined in EPCAction class, Check is main prosecutor method, for receiving request, controlling each layer assembly method call, executes retrospect query function;Decrypt quilt Query method is called, and for decrypting traceability code, decrypt uses 1 decipherment algorithm of table, restores initial code original;(2) Original data return to query, and query analysis data simultaneously extract supply trading company, three classification number, sequence number fragment codes As querying condition, access interface getJSONData method remote inquiry domain name, classification, batch number information are called, obtains JSON Data;(3) JSON data are resolved to productVo object using the getObjectFromJSON method in 3.3 sections by query; (4) checkTrace operational approach is created in Biz layers, and productVo parameter is received when checkTrace is called by query, Domain name domain, classification catagory, batch number batch are obtained using get method, and converts productVo according to selection For JSON formatted data, { " domain " is converted to when selecting product identification inquiry:domain,"catagory": catagory,"batch":Batch }, when selecting supply chain retrospect, using current supplier's domain name supplier as key value, turn It is changed to { " supplier ":[domain,catagory,batch]};(5) JSTRP platform data is accessed by getJSONData File data is managed in library, inquiry, obtains JSON data, and JSON encapsulates supply node product information in traceability chain, by CheckTrace calls getObjectFromJSON to be parsed and is converted to retrospect inquiry visualized data, is presented to the user.
4 application examples
This example encodes agricultural input product and Encryption Algorithm is transplanted in server of the system, with JSTRP platform actual number According to for sample, realizing that traceability code coding, label generate and anti-fake retrospect is inquired.Fig. 7 is the retrospect inquiry of Taizhou City agricultural input product System, which provides agricultural input product traceability code coding and user traces query interface.Fig. 7 (a) is shown traceability code and compiles Code, retrospect label generating process, agricultural input product list interface is entered after logging in system by user, select agricultural input product product into Row coding, generate traceability code, when reader connect with client serial ports traceability code write-in label, realize traceability code uniqueness with Antifalsification.The agricultural input product of Fig. 7 (b) display traces query process, when reader connects computer and reads label, input purchase After place (end retrospect query point) click determines, supply chain trace back process will be shown with table, show the name of an article, specification, detection The details such as quality, date of manufacture, validity period.Through system testing, when traceability code coding is with retrospect label write-in average response Between be 5s, anti-fake retrospect query information accuracy rate be 97% or more.
5 conclusions
The invention proposes agricultural input product coding, the anti-fake encrpted method of traceability code, integrated use internets, RFID, SSI The technologies such as frame, middleware, data access, data parsing, coding are realized, trace the technical methods such as inquiry, propose light weight Grade application system solution constructs the agricultural input product retrospect inquiry system based on EPC.After tested, system can reach production The retrospect target of product, quality and responsibility.The program is supply chain production identification, flow direction is tracked, Antiforge inquiry is traced to the source and provided Effect approach has realistic meaning and reference value to agricultural input product safety management.Due to agricultural input product safety management towards Multidisciplinary, multiagent and user, are related to supply chain upstream and downstream point of management control, and required anti-fake information of tracing to the source still is difficult to be detached from net Network platform database, this is contradicted with the current demand for relying on specialized database is reduced.Using different isomerization business platform, pass through Platform is mutually integrated with shared means and methods, to provide supply chain link real-time update data for all types of user, to solve reality Application problem, this is also the research work to be carried out in next step herein.

Claims (10)

1. a kind of agricultural input product chases after digital coding method, which is characterized in that described method includes following steps:
(1) 64 traceability code structures are generated, code conversion is carried out to 64 traceability code structures, forms 21 initial codes;
(2) the initial traceability code is encrypted, including:The Serial No. being made of domain name supervising number, timestamp is made For initial key;
(3) initial code, initial key are inputted, key generator is created, key generator is generated according to initial key for encrypting Dynamic key;
(4) dynamic key generates one group of expanded keys, creates encrypted object, and the encrypted object completes one using extension is close Group encryption operation, obtains encryption data;
(5) encryption data is converted to the traceability code of decimal representation;
(6) traceability code for being converted to decimal representation to encryption data is decrypted, including:Traceability code, initial key are read, by AES key generator generates dynamic key according to initial key, for decrypting;
(7) by one group of expanded keys of dynamic key production, object is decrypted in creation, and the decryption object executes one using expanded keys Group decryption oprerations, obtain the ciphertext data of bytecode form;
(8) ciphertext data is converted into decimal code and is reduced to initial code.
2. 1 method according to claim, 64 traceability code structures described in (1) use minimal information amount cryptoprinciple It is designed, is made of version number+supply trading company+product category number+sequence number.
3. 1 method according to claim, by 64 traceability code initial codes with decimal representation, conversion in (1) Length is 21 afterwards.
4. 1 method according to claim, in (1) in 21 codings, version number is 1 bit digital N1 (N1=2);For Answering trading company is 5 (P1P2P3P4P5), is numbered in order since 00001 to 32768;Product category number 4 (T1T2T3T4), It is made of agricultural input product major class+agricultural input product group, preceding 2 (T1T2) represent agricultural input product major class, including pesticide, fertilizer Material, seed, veterinary drug, fishing medicine, feed, feed addictive, growth regulation, agricultural film and other, number from 01 to 10, maximum number It is 81;2 (T3T4) expression agricultural input product groups afterwards, including Insecticides (tech) & Herbicides (tech), fungicide, biological pesticide, plant growth Regulator, pesticide original medicine, other pesticides etc., number from 01 to 92.Product ID is 11 (X1X2X3X4 ... X11), is referred to Show that similar product with a batch of single article, indicates number from 00000000001 to 17179869184 in order.
5. a kind of agricultural input product chases after digital coded system, the system comprises:Client, server-side, communication layers;
The communication layers such as Internet network connection client and server-side, provide remote access and data are transmitted;
The client is located at View layers, provides the UI operational view interfaces such as user's login, product coding, retrospect inquiry;
The server-side builds cloud computing server platform, including tri- layers of IaaS, PaaS, SaaS.
6. coded system according to claim 5, the client includes that PC host, intelligent read-write device, network interface card, storage are set It is standby that infra structure hardwares equipment and software tool, intelligent read-write device is waited to pass through RS232 or RS485 serial ports, RJ45 mode and PC master Machine connection, is the software and hardware support platform of Web application service, guarantees client basic function and performance requirement
7. coded system according to claim 5, the server-side remote access, data parsing, traceability code coding, retrospect Inquiry.
8. using the agricultural input product retroactive method of the described in any item coded systems of claim 5-7, including step:
(1) after user logs in FTP client FTP, product can be selected to be encoded from product list, will be written after retrospect code encryption Label, and key is provided for user, it inquires and uses for product back-tracing;
(2) user holds label and key carries out product back-tracing inquiry, and read-write equipment reads label traceability code, passed through by client Internet network is committed to server-side, and server-side uses key recovery traceability code original text, analyzes, extracts fragment code information, It is communicated with database platform foundation, accesses the database, nslookup, classification, batch number information;
(3) specified product is determined according to domain name, classification, batch number, remotely accesses the database again, server-side reception chases after It traces back and is parsed after inquiring data, parsing result is shown in client end interface, is presented to the user.
9. 8 method according to claim, the server-side remote access, data parsing, traceability code coding, retrospect are looked into It askes.
10. 9 method according to claim, the service end system is established remotely, executes traceability code coding, domain name is looked into The business such as inquiry, product identification, supply chain retrospect;
JSON data are converted to the persistence object of encapsulation visualized data by the data parsing;
The traceability code coding:User enters coded views after logging in client, and product is selected from view product list, is submitted Coding request, server-side execute coding business, return to final traceability code and key, and EPC label is written in traceability code by reader, together When key is presented to client user;
The retrospect inquiry:Product identification inquiry is provided when client retrospect inquiry, supply chain traces two selections, server-side root It is passed to the label traceability code of reader recognition according to client, class is controlled by EPCAction to realize traceability code decryption, remote access Inquiry, data dissection process process.
CN201810732556.8A 2018-07-05 2018-07-05 A kind of agricultural input product traceability system and method Pending CN108876415A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810732556.8A CN108876415A (en) 2018-07-05 2018-07-05 A kind of agricultural input product traceability system and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810732556.8A CN108876415A (en) 2018-07-05 2018-07-05 A kind of agricultural input product traceability system and method

Publications (1)

Publication Number Publication Date
CN108876415A true CN108876415A (en) 2018-11-23

Family

ID=64299646

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810732556.8A Pending CN108876415A (en) 2018-07-05 2018-07-05 A kind of agricultural input product traceability system and method

Country Status (1)

Country Link
CN (1) CN108876415A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108337082A (en) * 2017-12-28 2018-07-27 浙江兆信数码技术有限公司 Encryption method and system for security code
CN109656984A (en) * 2018-12-21 2019-04-19 树根互联技术有限公司 Data rule management system, method and apparatus
CN112184023A (en) * 2020-09-29 2021-01-05 山东浪潮通软信息科技有限公司 Grain and oil quality tracing method and device and readable medium
CN112489728A (en) * 2020-12-14 2021-03-12 华南农业大学 Classification and identification method of rice gene sample
CN113988892A (en) * 2021-11-15 2022-01-28 江西省智慧物联研究院有限公司 Salt system of traceing back based on thing networking commonality platform
CN116993373A (en) * 2023-09-27 2023-11-03 青岛君盛食品股份有限公司 Infant food information safety traceability management system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102521679A (en) * 2011-11-03 2012-06-27 北京农业信息技术研究中心 Agricultural product electronic tracing supervision code generation method and apparatus thereof
CN102800038A (en) * 2012-08-13 2012-11-28 南京鑫三强科技实业有限公司 Intelligence education E-card system platform based on internet of things and cloud computation
CN103220347A (en) * 2013-04-01 2013-07-24 无锡成电科大科技发展有限公司 CRP (compression reflection protocol) cloud interaction method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102521679A (en) * 2011-11-03 2012-06-27 北京农业信息技术研究中心 Agricultural product electronic tracing supervision code generation method and apparatus thereof
CN102800038A (en) * 2012-08-13 2012-11-28 南京鑫三强科技实业有限公司 Intelligence education E-card system platform based on internet of things and cloud computation
CN103220347A (en) * 2013-04-01 2013-07-24 无锡成电科大科技发展有限公司 CRP (compression reflection protocol) cloud interaction method

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108337082A (en) * 2017-12-28 2018-07-27 浙江兆信数码技术有限公司 Encryption method and system for security code
CN109656984A (en) * 2018-12-21 2019-04-19 树根互联技术有限公司 Data rule management system, method and apparatus
CN112184023A (en) * 2020-09-29 2021-01-05 山东浪潮通软信息科技有限公司 Grain and oil quality tracing method and device and readable medium
CN112489728A (en) * 2020-12-14 2021-03-12 华南农业大学 Classification and identification method of rice gene sample
CN113988892A (en) * 2021-11-15 2022-01-28 江西省智慧物联研究院有限公司 Salt system of traceing back based on thing networking commonality platform
CN116993373A (en) * 2023-09-27 2023-11-03 青岛君盛食品股份有限公司 Infant food information safety traceability management system
CN116993373B (en) * 2023-09-27 2023-12-22 青岛君盛食品股份有限公司 Infant food information safety traceability management system

Similar Documents

Publication Publication Date Title
CN108876415A (en) A kind of agricultural input product traceability system and method
Liu et al. Blockchain and machine learning for communications and networking systems
Zheng et al. Construct food safety traceability system for people’s health under the internet of things and big data
CN107704493A (en) It is a kind of to be used to provide the method and system that product is traced to the source
CN102693455B (en) A kind of data based on financial IC card prepare fully automatic system and method
CN104954234A (en) Microblog data acquisition method, microblog data acquisition device and public opinion analysis method
CN109002440A (en) Method, apparatus and system for big data multidimensional analysis
López-Pimentel et al. Blockchain and off-chain: A solution for audit issues in supply chain systems
CN112163952A (en) Intelligent supply chain AIOT SaaS information platform
CN108536522A (en) A kind of intelligent form application process and system
Li et al. An exploratory study on the design and management model of traditional Chinese medicine quality safety traceability system based on blockchain technology
Gangwani et al. Integration of data science and IoT with blockchain for Industry 4.0
Kirmse et al. An Architecture for Efficient Integration and Harmonization of Heterogeneous, Distributed Data Sources Enabling Big Data Analytics.
Peng et al. Application of information and communication technologies for eco-accounting
Ding et al. Architecture, operation, and implementation for Blockchain-driven turnkey project under I4. 0 workshop based on RAMI 4.0
Miranda et al. A new approach for crop rotation problem in Farming 4.0
Zhang 2-Tier Cloud Architecture with maximized RIA and SimpleDB via minimized REST
Zolotova et al. Architecture for a universal mobile communication module
WO2022119929A1 (en) Systems and methods for administrating a federated learning network
Ding et al. Research on Food Safety Traceability Technology Based on RFID Security Authentication and 2-Dimensional Code
Ding et al. A multimodal deep fusion network for mobile traffic classification
Hao et al. Food safety traceability technology based on block chain
Nawaz et al. Hyperledger Fabric in Precision Agriculture: A Study on Data Integrity and Availability
Kushwaha et al. Hyperledger architecture for Internet of things and supply chain management services
Zhu et al. The research and implementation of ERP-based Mobile Business Intelligence system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20181123