CN105426349A - Transmission exchange method and device of logic expression - Google Patents

Transmission exchange method and device of logic expression Download PDF

Info

Publication number
CN105426349A
CN105426349A CN201510733647.XA CN201510733647A CN105426349A CN 105426349 A CN105426349 A CN 105426349A CN 201510733647 A CN201510733647 A CN 201510733647A CN 105426349 A CN105426349 A CN 105426349A
Authority
CN
China
Prior art keywords
services request
client
logical expression
expression
normal form
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
CN201510733647.XA
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.)
Beijing Ruian Technology Co Ltd
Original Assignee
Beijing Ruian Technology Co 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 Beijing Ruian Technology Co Ltd filed Critical Beijing Ruian Technology Co Ltd
Priority to CN201510733647.XA priority Critical patent/CN105426349A/en
Publication of CN105426349A publication Critical patent/CN105426349A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/14Tree-structured documents

Abstract

The embodiment of the invention discloses a transmission exchange method and device of a logic expression. The transmission exchange method comprises the following steps: a client side obtains a search condition and generates a service request according to the search condition; the client side carries out disjunctive normal form processing by aiming at the logic expression contained in the service request; the client side sends the service request subjected to the disjunctive normal form processing to a service side; the service side receives the service request sent from the client side; the service side analyzes the logic expression in the received service request according to the disjunctive normal form and carries out searching according to the analyzed logic expression to obtain a search result; and the service side returns the search result to the client side. Since the embodiment of the invention carries out disjunctive form processing on the logic expression before data is subjected to transmission exchange, the service side can more friendly identify the logic expressions contained in the service request transmitted from the client side or accurately compare whether the logic expressions are consistent or not so as to obtain the more accurate search result.

Description

A kind of transmission switching method of logical expression and device
Technical field
The embodiment of the present invention relates to microcomputer data processing field, particularly relates to a kind of transmission switching method and device of logical expression.
Background technology
Webservice (network service) be a platform independently, low coupling, self-contained, based on the application program of programmable web, open XML (ExtensibleMarkupLanguage can be used, extending mark language) standard describes, issues, finds, coordinates and configures these application programs, for developing the application program of distributed interoperability.
But, when XML data transmission exchanges complex logic expression formula, do not define standard set logical expression specification.Therefore, when utilizing Webservice to transmit in complicated internet system and heterogeneous platform, logical expression that the transmission of data receiver's None-identified XML data exchanges or cannot problem that accurately whether comparison logical expression is consistent often can be run into.
Summary of the invention
The embodiment of the present invention provides a kind of transmission switching method and device of logical expression, with the logical expression of the identify customer end making service end more friendly, and analyse and compare accurately to obtain Search Results more accurately for the logical expression of client.
Embodiments provide a kind of transmission switching method of logical expression, comprising:
Client obtains search condition and generates services request according to described search condition;
The logical expression that client comprises for services request carries out disjunctive normal form process;
Services request after disjunctive normal form process is sent to service end by client;
Service end receives the services request that client sends;
Service end is carried out analysis according to disjunctive normal form for logical expression in the services request received and is also carried out searching for obtain Search Results according to the logical expression after analysis; And
Search Results is returned client by service end.
Embodiments provide a kind of transmission switch of logical expression, described transmission switch is configured at client and service end, wherein:
Described client comprises:
Services request generation module, for obtaining search condition and generating services request according to described search condition;
Extractor block, carries out disjunctive normal form process for the logical expression comprised for services request;
Delivery module, for being sent to service end by the services request after disjunctive normal form process; And
Described service end comprises:
Receiver module, for receiving the services request that client sends;
Search module, also carries out searching for obtain Search Results according to the logical expression after analysis for carrying out analysis according to disjunctive normal form for logical expression in the services request received;
Result returns module, for Search Results is returned client.
The transmission switching method of the logical expression provided in the embodiment of the present invention and device, because logical expression is carried out disjunction expression process by the embodiment of the present invention before data transmission exchanges, whether unanimously thus acquisition Search Results more accurately identify customer end that service end can be more friendly transmits logical expression that services request comprises or accurately than to logical expression.
Accompanying drawing explanation
The schematic flow sheet of the transmission switching method of a kind of logical expression that Fig. 1 provides for the embodiment of the present invention one;
The transmission switch of a kind of logical expression that Fig. 2 provides for the embodiment of the present invention two is configured in the structural representation of client.
Fig. 3 is the structural representation that the transmission switch of a kind of logical expression that the embodiment of the present invention two provides is configured in service end.
Embodiment
Technical scheme of the present invention is further illustrated by embodiment below in conjunction with accompanying drawing.Be understandable that, specific embodiment described herein is only for explaining the present invention, but not limitation of the invention.It also should be noted that, for convenience of description, illustrate only part related to the present invention in accompanying drawing but not entire infrastructure.
Before in further detail exemplary embodiment being discussed, it should be mentioned that some exemplary embodiments are described as the process or method described as process flow diagram.Although every step is described as the process of order by process flow diagram, many steps wherein can be implemented concurrently, concomitantly or simultaneously.In addition, the order of every step can be rearranged.When its step completes, described process can be terminated, but can also have the additional step do not comprised in the accompanying drawings.Described process can correspond to method, function, code, subroutine, subroutine etc.
Embodiment one
The transmission switching method of a kind of logical expression that Fig. 1 provides for the embodiment of the present invention one, the method can be performed by the transmission switch of logical expression, and this transmission switch can by software and/or hardware implementing, and general accessible site in a computer.The method of the present embodiment specifically coordinates execution by client and service end.
See Fig. 1, the method for the present embodiment comprises the steps:
Step S100, when obtain user input search condition time, client generate services request.
When client needs connecting Internet to complete a certain function, such as, user's input search condition is with the data of searching or when understanding certain knowledge, and the search condition obtaining user's input generates services request.
Described services request contains the logical expression of the search condition composition of user's input.The sequence that described logical expression is made up of operational symbol, operand, parenthesis or relation character etc., it is the formula be formed by connecting by operational symbol by constant, variable, function etc.Logical expression is the most fundamental of configuration program code.Please refer to following logical expression 1 and logical expression 2:
Logical expression 1:
((H010001in1030001)&((B050004=1234567)|(B050009=1234567)|(B040002=1234567))&(B050016in111,124,124,124,119,120,135,123,126,118,999,138,136)
Logical expression 2:
(H010001in1030001,1030009,1030005,1030003,1030002,1030004,1030029,1030027,1030035,1030026,1030028,1030022,1039999,1030010,1030032,1039999,1030036,1039999,1030030)&((B050004=6565465)|(B050009=6565465)|(B040002=6565465))&(B050016in111,124,124,124,119,120,135,123,126,118,999,138,136)
Above-mentioned logical expression 1 and logical expression 2 are made up of operational symbol, operand, relation character and parenthesis.
In the present embodiment, for convenience of description, client is defined as service requester, and service end is defined as service reception side.Above-mentioned definition is not make restriction to client and service end.
The logical expression that step S110, client comprise for services request carries out disjunctive normal form process.
Concrete, after services request generates, carry out disjunctive normal form process for the logical expression comprised in services request.After logical expression being done disjunctive normal form process, it is clear that logical expression becomes, can be friendly allow transmission both sides identify, calculate to realize cross-platform, cross-system, mutually carries out data transmission and exchanges between the platform across language.
In Boolean logic, disjunctive normal form (DNF) is the standardization of logical formula, and it is extracting of conjunctive clause.As canonical form, it is useful in automatic theorem proving.Logical expression is considered to DNF's, and and if only if, and it is extracting of one or more conjunction of one or more word.Proposition operator in DNF be with or and non-.
Exemplary, carry out disjunctive normal form processing procedure for following logical expression as follows:
Definition word: p, ┐ q, r, q;
Its simple disjunction: p, q, p ∨ q, p ∨ ┐ p ∨ r, ┐ p ∨ q ∨ ┐ r;
The disjunctive normal form obtaining it according to data extraction normal form formula is: (┐ p ∧ q) ∨ r ∨ (p ∧ r).
Doing in disjunctive normal form process, noting what time below:
1, can not occur in disjunctive normal form that logic no (NOT) is outermost operator;
Such as: ┐ ┐ A, ┐ (A ∧ B), ┐ (A ∨ B);
After transforming:
2, in disjunctive normal form, do not occur that a logical OR (OR) is nested in a logical and (AND);
Logical expression formula is converted to disjunctive normal form (DNF) and will logical equivalence be used, utilize the algorithm mentioned in mathematics, such as double denial removing, De Morgan's laws and law of distribution etc.All logical expressions can convert disjunctive normal form to.
Step S120, the services request after disjunctive normal form process is sent to service end.
Concrete, after disjunctive normal form process is carried out to logical expression, call Webservice interface, by XML format, the services request after disjunctive normal form process is encapsulated, by described Webservice interface, the services request after encapsulation is sent to service end.Usually, Webservice interface is by HTTP (HyperTextTransferProtocol, HTML (Hypertext Markup Language)) when sending request with reception result, the request content sent and resultant content all adopt XML format to encapsulate, and add some specific HTTP message headers, so that the content format of HTTP message to be described, the request content of these specific HTTP message headers and XML format encapsulation is exactly services request.
Step S130, service end receive described services request.
Service end calls the services request that Webservice interface sends in order to monitor client, and receives described services request.
Step S140, according to disjunctive normal form to the logical expression that services request comprises carry out analyzing and processing and according to identify logical expression search for.Describedly according to disjunctive normal form, analyzing and processing is carried out to described services request, the logical expression that the services request sent with better identify customer end comprises, and logical expression is analysed and compared accurately
Acquisition Search Results is returned client by step S150, service end.
Concrete, the logical expression that the services request that service end identify customer end sends comprises, and obtain Search Results according to this logical expression search after accurate analysis comparison is carried out to described logical expression, and by Webservice interface, Search Results is back to client.
Preferably, in order to distinguish for mixing expression formula and the transmission switching method of general expression, the logical expression comprised for services request in step S110 client also comprises before carrying out disjunctive normal form process:
Judge whether the logical expression that described services request comprises is mixing expression formula;
When judging that logical expression that services request comprises is as mixing expression formula, triggers the disjunctive normal form process performing mixing expression formula;
When judging that the logical expression that described services request comprises is general expression, directly this services request is undertaken encapsulating and being transferred to service end by XML format.
In the present embodiment, described logical expression is divided into mixing expression formula and general expression two kinds.Described mixing expression formula refers to that this logical expression accords with by multiple arithmetics such as arithmetic operator, character operator, relational operator, logical operator and assignment operators the logical operation formula formed.Described general expression refers to that the structure of this logical expression is comparatively simple, and not exclusively comprises above-mentioned all operational symbols.
Increasing this determining step is to mixing expression formula and general expression be distinguished.General expression is comparatively simple due to structure, directly can carry out XML format encapsulation and data transmission and exchange and disjunctive normal form process without the need to carrying out expression formula; Mixing expression formula, due to complex structure, just carries out XML format encapsulation after therefore needing to carry out to mix the disjunctive normal form process of expression formula cross-platform to realize, cross-system and across the data transmission exchange between language platform.
The technical scheme of the embodiment of the present invention, obtain user search condition by client and generate services request, the logical expression comprised for services request carries out disjunctive normal form process, and by XML format, the services request after disjunctive normal form process is encapsulated, then services request after encapsulation is sent to service end, carries out analyzing and processing after service end receives services request and carry out searching for obtain Search Results according to the logical expression identified.Because logical expression is carried out disjunctive normal form process by the embodiment of the present invention before data transmission exchanges, due to the logical expression after disjunctive normal form process can realize cross-platform, across recognition logic expression formula friendly between language and cross-system, avoid available data to transmit service end None-identified in exchange process or cannot the whether consistent problem of logical expression in the data of accurately comparison client transmission.
Embodiment two
The structural representation of the transmission switch of a kind of logical expression that Fig. 2 provides for the embodiment of the present invention two.Described transmission switch is configured in client and service end.As shown in Figure 2, the transmission switch of the present embodiment specifically comprises in the client: services request generation module 20, extractor block 21 and delivery module 22.
Wherein, described services request generation module 20, during for needing connecting Internet to complete a certain function when client, such as, user's input search condition, with the data of searching or when understanding certain knowledge, obtains the search condition of user's input and generates services request.
Described extractor block 21, carries out disjunctive normal form process for the logical expression comprised for services request.
Concrete, after services request generates, carry out disjunctive normal form process for the logical expression comprised in services request.After logical expression being done disjunctive normal form process, it is clear that logical expression becomes, can be friendly allow transmission both sides identify, calculate to realize cross-platform, cross-system, mutually carries out data transmission and exchanges between the platform across language.
Described delivery module 22, concrete, after disjunctive normal form process is carried out to logical expression, call Webservice interface, by XML format, the services request after disjunctive normal form process is encapsulated, by described Webservice interface, the services request after encapsulation is sent to service end.
As shown in Figure 3, the transmission switch of the present embodiment specifically comprises in service end: receiver module 30, search module 31 and result return module 32.
Receiver module 30, for by calling the services request that Webservice interface sends from client in order to monitoring, and receives described services request.
Search module 31, also searches for according to the logical expression identified for carrying out analyzing and processing according to disjunctive normal form to logical expression in services request.Describedly according to disjunctive normal form, analyzing and processing is carried out to described services request, the logical expression that the services request sent with better identify customer end comprises, and logical expression is analysed and compared accurately.
Result returns module 32, for service end, acquisition Search Results is returned client.
Preferably, described transmission switch also comprises a judge module in client, for:
Before the logical expression comprised for services request carries out disjunctive normal form process, judge whether the logical expression comprised in described services request is mixing expression formula; When the logical expression judging to comprise in described services request is as mixing expression formula, triggers described extractor block and performing respective operations; When decision logic expression formula is general expression, directly this services request is undertaken encapsulating and being transferred to service end by XML format.
The transmission switch of the logical expression that the technical scheme of the present embodiment provides, the search condition that wherein client utilizes services request generation module 20 to obtain user's input generates services request, and the logical expression utilizing extractor block 21 to comprise for services request carries out disjunctive normal form process; Utilize delivery module 22 service after disjunctive normal form process to be asked for instructions and be sent to service end; Service end utilizes receiver module 30 to receive the services request of client transmission; Utilize search module 31 to carry out analyzing and processing according to disjunctive normal form to logical expression in services request also to search for according to the logical expression identified, finally utilize result to return module 32 and acquisition Search Results is returned client by service end.
Because the embodiment of the present invention is before data transmission exchanges, by carrying out disjunctive normal form process to complex logic expression formula, then after being encapsulated by XML format, carry out transmission exchange.Thus allow service end with the logical expression of the identify customer end of more friendly mode, and analyse and compare accurately to obtain Search Results more accurately for the logical expression of client.
The said goods can perform the method that any embodiment of the present invention provides, and possesses the corresponding functional module of manner of execution and beneficial effect.The not ins and outs of detailed description in the present embodiment, the method that can provide see any embodiment of the present invention.
Note, above are only preferred embodiment of the present invention and institute's application technology principle.Skilled person in the art will appreciate that and the invention is not restricted to specific embodiment described here, various obvious change can be carried out for a person skilled in the art, readjust and substitute and can not protection scope of the present invention be departed from.Therefore, although be described in further detail invention has been by above embodiment, the present invention is not limited only to above embodiment, when not departing from the present invention's design, can also comprise other Equivalent embodiments more, and scope of the present invention is determined by appended right.

Claims (10)

1. a transmission switching method for logical expression, is characterized in that, comprising:
Client obtains search condition and generates services request according to described search condition;
The logical expression that client comprises for services request carries out disjunctive normal form process;
Services request after disjunctive normal form process is sent to service end by client;
Service end receives the services request that client sends;
Service end is carried out analysis according to disjunctive normal form for logical expression in the services request received and is also carried out searching for obtain Search Results according to the logical expression after analysis; And
Search Results is returned client by service end.
2. method according to claim 1, is characterized in that, client also comprises before carrying out disjunctive normal form process for the logical expression that services request comprises:
Described client judges whether the logical expression that services request comprises is mixing expression formula;
When judging that logical expression that services request comprises is as mixing expression formula, described client triggers the disjunctive normal form process performing described logical expression; And
When judging that the logical expression that services request comprises is general expression, services request is directly sent to service end by described client.
3. method according to claim 2, is characterized in that, described mixing expression formula refers to the logical operation formula that this logical expression is made up of arithmetic operator, character operator, relational operator, logical operator and assignment operator.
4. method according to claim 1, is characterized in that, the services request after disjunctive normal form process is sent to service end and comprises by client:
Described client call network service interface;
Described client is encapsulated the services request after disjunctive normal form process by the form expanding language tag;
Services request after encapsulation is sent to service end by described network service interface by described client.
5. method according to claim 1, is characterized in that, the services request that service end receives client transmission comprises:
Described service end calls network service interface in order to monitor and to receive the services request from client.
6. a transmission switch for logical expression, described transmission switch is configured at client and service end, it is characterized in that:
Described client comprises:
Services request generation module, for obtaining search condition and generating services request according to described search condition;
Extractor block, carries out disjunctive normal form process for the logical expression comprised for services request;
Delivery module, for being sent to service end by the services request after disjunctive normal form process; And
Described service end comprises:
Receiver module, for receiving the services request that client sends;
Search module, also carries out searching for obtain Search Results according to the logical expression after analysis for carrying out analysis according to disjunctive normal form for logical expression in the services request received;
Result returns module, for Search Results is returned client.
7. device according to claim 6, is characterized in that, also comprises in described client:
Judge module, for judging whether the logical expression that services request comprises is mixing expression formula; When judging that logical expression that services request comprises is as mixing expression formula, triggers the disjunctive normal form process performing described logical expression; And when judging that the logical expression that services request comprises is general expression, directly services request is sent to service end.
8. device according to claim 7, is characterized in that, described mixing expression formula refers to the logical operation formula that this logical expression is made up of arithmetic operator, character operator, relational operator, logical operator and assignment operator.
9. device according to claim 6, is characterized in that, described delivery module specifically for:
Call network service interface;
By the form expanding language tag, the services request after disjunctive normal form process is encapsulated;
By described network service interface, the services request after encapsulation is sent to service end.
10. device according to claim 6, is characterized in that, described receiver module specifically for: call network service interface in order to monitor and to receive the services request from client.
CN201510733647.XA 2015-11-03 2015-11-03 Transmission exchange method and device of logic expression Pending CN105426349A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510733647.XA CN105426349A (en) 2015-11-03 2015-11-03 Transmission exchange method and device of logic expression

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510733647.XA CN105426349A (en) 2015-11-03 2015-11-03 Transmission exchange method and device of logic expression

Publications (1)

Publication Number Publication Date
CN105426349A true CN105426349A (en) 2016-03-23

Family

ID=55504564

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510733647.XA Pending CN105426349A (en) 2015-11-03 2015-11-03 Transmission exchange method and device of logic expression

Country Status (1)

Country Link
CN (1) CN105426349A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107767922A (en) * 2017-10-25 2018-03-06 医渡云(北京)技术有限公司 Medical data receives discharge method and device, electronic equipment, storage medium
CN112541313A (en) * 2020-12-24 2021-03-23 山东高云半导体科技有限公司 Method and device for configuring trigger expression for logic analysis state
CN115037485A (en) * 2022-08-12 2022-09-09 北京智芯微电子科技有限公司 Method, device and equipment for realizing lightweight authentication encryption algorithm

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003030183A (en) * 2001-07-17 2003-01-31 Ricoh Co Ltd Character retrieval device and method, its program and recording medium with the program recorded thereon
US20030212662A1 (en) * 2002-05-08 2003-11-13 Samsung Electronics Co., Ltd. Extended markup language (XML) indexing method for processing regular path expression queries in a relational database and a data structure thereof
CN101183371A (en) * 2007-12-12 2008-05-21 中兴通讯股份有限公司 Method for quick finishing large data-handling and reporting system
CN104750781A (en) * 2015-03-06 2015-07-01 合一信息技术(北京)有限公司 Advertisement retrieval method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003030183A (en) * 2001-07-17 2003-01-31 Ricoh Co Ltd Character retrieval device and method, its program and recording medium with the program recorded thereon
CN1397895A (en) * 2001-07-17 2003-02-19 株式会社理光 Character search device, character search method and program thereof
US20030212662A1 (en) * 2002-05-08 2003-11-13 Samsung Electronics Co., Ltd. Extended markup language (XML) indexing method for processing regular path expression queries in a relational database and a data structure thereof
CN101183371A (en) * 2007-12-12 2008-05-21 中兴通讯股份有限公司 Method for quick finishing large data-handling and reporting system
CN104750781A (en) * 2015-03-06 2015-07-01 合一信息技术(北京)有限公司 Advertisement retrieval method

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107767922A (en) * 2017-10-25 2018-03-06 医渡云(北京)技术有限公司 Medical data receives discharge method and device, electronic equipment, storage medium
CN112541313A (en) * 2020-12-24 2021-03-23 山东高云半导体科技有限公司 Method and device for configuring trigger expression for logic analysis state
CN115037485A (en) * 2022-08-12 2022-09-09 北京智芯微电子科技有限公司 Method, device and equipment for realizing lightweight authentication encryption algorithm
CN115037485B (en) * 2022-08-12 2022-11-08 北京智芯微电子科技有限公司 Method, device and equipment for realizing lightweight authentication encryption algorithm

Similar Documents

Publication Publication Date Title
US10747505B1 (en) API specification generation
JP6912469B2 (en) Access request conversion method and device
US8375362B1 (en) Wizard for web service search adapter
CN107103004B (en) Method, device and system for processing data in webpage
CN107145784B (en) Vulnerability scanning method and device and computer readable medium
CN112187558B (en) Data verification method and device and electronic equipment
CN105573760A (en) Storm-based processing system and method of data of Internet of Things
CN105426349A (en) Transmission exchange method and device of logic expression
EP2648388A1 (en) Method, system, and device for displaying page
EP3777110A1 (en) Mechanisms for an intelligent service layer request abstraction service
CN102103519A (en) Method for optimizing Web service execution based on scripts
CN109600381B (en) Interface adaptation method, device and system
EP3433734A1 (en) Technologies for auto discover and connect to a rest interface
CN106407061B (en) Northbound interface testing device and northbound interface testing method
CN109672732B (en) Interface adaptation method, device and system
CN113760987A (en) Data processing method and data processing platform
CN107844366B (en) Power grid application service calling method and device, storage medium and computer equipment
CN114745681B (en) Rich media information display method, rich media information display equipment and computer storage medium
CN107357749B (en) Message processing method and device
CN113064583B (en) Multistage page route jump method, device, computer equipment and storage medium
CN112688947B (en) Internet-based network communication information intelligent monitoring method and system
CN112433752B (en) Page analysis method, device, medium and electronic equipment
CN115374207A (en) Service processing method and device, electronic equipment and computer readable storage medium
CN110166272A (en) The method, apparatus and system of terminal device index mediation service are provided
CN112559278B (en) Method and device for acquiring operation data

Legal Events

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

Application publication date: 20160323

RJ01 Rejection of invention patent application after publication