CN113206873A - Method for constructing intelligent irrigation area e platform routing layer by node - Google Patents

Method for constructing intelligent irrigation area e platform routing layer by node Download PDF

Info

Publication number
CN113206873A
CN113206873A CN202110438519.8A CN202110438519A CN113206873A CN 113206873 A CN113206873 A CN 113206873A CN 202110438519 A CN202110438519 A CN 202110438519A CN 113206873 A CN113206873 A CN 113206873A
Authority
CN
China
Prior art keywords
layer
module
request
service
data
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
CN202110438519.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.)
Harbin Hongde Yitai Digital Technology Co ltd
Original Assignee
Harbin Hongde Yitai Digital 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 Harbin Hongde Yitai Digital Technology Co ltd filed Critical Harbin Hongde Yitai Digital Technology Co ltd
Priority to CN202110438519.8A priority Critical patent/CN113206873A/en
Publication of CN113206873A publication Critical patent/CN113206873A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/30Definitions, standards or architectural aspects of layered protocol stacks
    • H04L69/32Architecture of open systems interconnection [OSI] 7-layer type protocol stacks, e.g. the interfaces between the data link level and the physical level

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The invention provides a method for constructing an e platform routing layer of an intelligent irrigation area by adopting node.js, which comprises the following steps: s1: receiving an event request initiated by an application layer, and compiling the request into machine code for being executed by a CPU through a V8 engine; s2: the Bingding module of node. js sends the compiled machine code to an event driving module for processing, and sends a processing result to a V8 engine; s3: the V8 engine performs decompiling on the received processing result and then sends the decompiled result to the application layer; the method for constructing the e platform routing layer of the intelligent irrigation area by adopting the node.js provided by the invention ensures that the html code of the application layer and the java code of the service layer cannot be directly communicated, reduces the coupling degree of front and back end programs, and realizes the low coupling of the front and back ends when the application layer program or the service layer program is changed or expanded; the service layer API can provide data service for one appointed front-end application, can be classified according to data processing, and achieves the aim of high cohesion of back-end service.

Description

Method for constructing intelligent irrigation area e platform routing layer by node
Technical Field
The invention belongs to the technical field of communication, and particularly relates to a method for constructing an e platform routing layer of an intelligent irrigation area by adopting node.
Background
The existing irrigation area platform adopts a traditional three-layer full-stack architecture mode, namely, a presentation layer, a service layer and a data layer, and the mode has the advantages of convenience in development and low requirement on technical personnel, but also has a plurality of problems, such as: the front-end and back-end programs are high in coupling degree, system change and upgrade are difficult, dynamic assembly of modules cannot be achieved, load balancing capacity is weak, large concurrent access cannot be processed, and especially at present when the internet and cloud technologies are developed at a high speed, the architecture mode cannot meet the requirement of large centralized cloud deployment.
Disclosure of Invention
In order to solve the technical problem, the invention provides a method for constructing an intelligent irrigation area e platform routing layer by adopting node.
The specific technical scheme of the invention is as follows:
a method for constructing an e platform routing layer of an intelligent irrigation area by adopting node.
S1: receiving an event request initiated by an application layer, and compiling the request into machine code for the CPU to execute through a V8 engine;
s2: the Bingding module of node. js sends the compiled machine code to an event driving module for processing, and sends a processing result to a V8 engine;
s3: the V8 engine performs decompiling on the received processing result and then sends the decompiled result to the application layer;
wherein, step S2 includes the following steps:
s21: the Bingding module puts the received machine code into an event queue;
s22: the execution module delivers the machine codes in the event queue to a working thread to asynchronously call a service layer and returns a processing result to the binging module;
s23: the execution module returns the processing results sent by the event queue to the V8 engine.
The invention also provides an intelligent irrigation area e platform which comprises an application layer, a routing layer, a service layer and a data layer, wherein the application layer is used for sending the user request to the routing layer and receiving the processing result of the routing layer, the routing layer is used for receiving the user request sent by the application layer, sending the processing result to the application layer and asynchronously calling the service layer, the service layer is used for feeding back the calling of the routing layer and accessing the data layer, and the data layer is used for storing all data and receiving and responding the request of the service layer.
The construction method of the routing layer comprises the following steps:
s1: the routing layer receives a request initiated by the application layer, and the request is compiled into machine code for being executed by the CPU through a V8 engine;
s2: the Bingding module of node. js sends the compiled machine code to an event driving module for processing, and sends a processing result to a V8 engine;
s3: the V8 engine performs decompiling on the received processing result and then sends the decompiled result to the application layer;
further, the step S2 includes the following steps:
s21: the Bingding module puts the received machine code into an event queue;
s22: the execution module delivers the events in the event queue to a working thread to asynchronously call a service layer and returns the processing result to the binging module;
s23: the execution module returns the processing results sent by the event queue to the V8 engine.
According to the method for constructing the e platform routing layer of the intelligent irrigation area by adopting the node.js, because of the occurrence of the routing layer, the html code of the application layer and the java code of the service layer cannot be directly communicated, the coupling degree of front and back end programs is reduced, the application layer program or the service layer program cannot influence each other when being changed or expanded, and the purpose of low coupling of the front and back ends is realized; and the service layer API can not only provide data service for a specified front-end application any more, but also can be classified according to data processing, so that the aim of high cohesion of the back-end service is fulfilled.
Drawings
Fig. 1 is a flowchart of a method for constructing an e-platform routing layer of an intelligent irrigation area by node. js in embodiment 1;
fig. 2 is a flowchart of a method for constructing an e-platform routing layer of an intelligent irrigation area by node. js in embodiment 1;
fig. 3 is a flowchart of a method for constructing a routing layer of an e-platform in an intelligent irrigation area by node. js in embodiment 2;
fig. 4 is a flowchart of a method for constructing a routing layer of an e-platform in an intelligent irrigation area by node. js in embodiment 3;
fig. 5 is a flowchart of a method for constructing a routing layer of an e-platform in an intelligent irrigation area by node. js in embodiment 4;
fig. 6 is a flowchart of a method for constructing a routing layer of an e-platform in an intelligent irrigation area by node. js in embodiment 5;
FIG. 7 is a schematic diagram of the intelligent irrigation area e platform of embodiment 6;
FIG. 8 is a diagram showing the intelligent irrigation area e platform of example 6.
Detailed Description
The invention is further described with reference to the following figures and examples, which are provided for the purpose of illustrating the general inventive concept and are not intended to limit the scope of the invention.
Example 1
As shown in fig. 1 and fig. 2, a method for constructing an intelligent irrigation area e platform routing layer by node.
S1: receiving an event request initiated by an application layer, and compiling the event request into machine code for being executed by a CPU through a V8 engine;
s2: the Bingding module of node. js sends the compiled machine code to an event driving module for processing, and sends a processing result to a V8 engine;
s3: the V8 engine decompiles the received processing result and then sends the decompiled result to the application layer, namely the routing layer is built;
wherein, step S2 includes the following steps:
s21: the Bingding module puts the received machine code into an event queue;
s22: the execution module delivers the machine codes in the event queue to a working thread to asynchronously call a service layer and returns a processing result to the binging module;
s23: the execution module returns the processing result sent by the event queue to the V8 engine;
it should be noted that the version of the V8 engine is 4.4.63.25, the version of node.js is 0822, and the event request is an operation performed by a user at a client, specifically including but not limited to an alarm request, a water level query request, a traffic query request, or a pipeline query request; the V8 engine is a script engine used by Google Chrome, can be used for executing JavaScript codes and managing memory, and is also responsible for garbage collection, interaction with a host language and the like; the machine code is a system of instruction sets, such as machine code, which is data that can be directly interpreted by a CPU of a computer; an instruction is a statement in machine language, which is a meaningful set of binary codes, the basic format of the instruction is, for example, an opcode field and an address field, where the opcode specifies the nature and function of the operation of the instruction and the address gives the operand or the address of the operand; the binding module is used for binding and is equivalent to a data bridge; the event queue (event queue) refers to a queue entry corresponding to each event, and each queue entry comprises an event handle pointer pointing to an event handle queue of the event; an event kind, which is one of the basic events, when communication is carried out once, the method-driven event adds the program handle corresponding to the event and the priority thereof into the event program handle queue according to the event kind to be executed; a worker thread is typically used to perform some background task, such as data computation, etc.
By the method, the html codes of the application layer and the java codes of the service layer cannot be directly communicated, so that the coupling degree of front and back end programs is reduced, the application layer programs or the service layer programs cannot be influenced when changed or expanded, and the low coupling target of the front and back ends is realized; and the service layer API can not only provide data service for a specified front-end application any more, but also can be classified according to data processing, so that the aim of high cohesion of the back-end service is fulfilled.
Example 2
Embodiment 3 provides a method for constructing an intelligent irrigation area e platform routing layer by node. js, as shown in fig. 3, which is different from embodiment 1 in that step S1 includes the following steps:
s11: judging whether the application layer sends an event request, if so, performing step S12, and if not, performing step S13;
s12: taking out the request sent by the application layer and the related callback function thereof, judging whether the related callback function exists or not, if so, executing the callback, and then performing step S11, otherwise, directly performing step S11;
s13: after the interval T, step S11 is performed again.
Wherein, T can be set according to the requirement; by the method, whether the application layer sends the time request or not does not need to be monitored constantly, and waste is avoided while the time request is circularly monitored.
Example 3
Embodiment 3 provides a method for constructing a routing layer of an e-platform of an intelligent irrigation area by node. js, as shown in fig. 4, which is different from embodiment 2 in that step S21 is preceded by step S20: and establishing a corresponding request object for the received machine code, packaging the request object, and setting parameters and a callback function.
The invention is used for ensuring that the Node at the upper layer and the user-defined thread pool and the IOCP at the lower layer are independent respectively through the method.
Example 4
Embodiment 4 provides a method for constructing an intelligent irrigation area e platform routing layer by node. js, as shown in fig. 5, which is different from embodiment 3 in that step S22 includes the following steps:
s221: the execution module delivers the request object to a working thread;
s222: judging whether the current working thread is available, if so, performing step S223, and if not, replacing the working thread until the replaced working thread is the available working thread;
s223: the asynchronous calling service layer executes the I/O operation in the request object;
s224: returning the result of the execution completion to the request object;
s225: and sending the request object to the event queue, and returning the processing result in the event queue to the V8 engine by the execution module.
The invention gives a detailed asynchronous calling process by specifically limiting the step S22, thereby achieving the purpose of asynchronous calling.
Example 5
Embodiment 5 provides an intelligent irrigation e platform, as shown in fig. 6, the intelligent irrigation e platform includes an application layer, a routing layer, a service layer, and a data layer, the application layer is configured to send a user request to the routing layer and receive a processing result of the routing layer, the routing layer is configured to receive the user request sent by the application layer, send the processing result to the application layer, and asynchronously invoke the service layer, the service layer is configured to feed back invocation of the routing layer and access the data layer, and the data layer is configured to store all data and receive and respond to a request of the service layer;
the construction method of the routing layer comprises the following steps:
s1: the routing layer receives a request initiated by the application layer, and compiles the request into machine code for the CPU to execute through a V8 engine;
s2: the Bingding module of node. js sends the compiled machine code to an event driving module for processing, and sends a processing result to a V8 engine;
s3: the V8 engine performs decompiling on the received processing result and then sends the decompiled result to the application layer;
further, step S2 includes the following steps:
s21: the Bingding module puts the received machine code into an event queue;
s22: the execution module delivers the events in the event queue to a working thread to asynchronously call a service layer and returns the processing result to the binging module;
s23: the execution module returns the processing result sent by the event queue to the V8 engine;
the application layer comprises an application container and a page library, and the application container comprises: the system comprises a style library, a control library, a resource library, a method library and an application space prepared for a user request page; the application layer calls a specified page from the page library according to the processing result sent by the routing layer and loads the page into an application space of the application container; the style library, the control library, the resource library and the method library are used for providing support for pages running in an application space and displaying an interface requested by a user in a browser for the user to use;
the service layer comprises an RESTFUL layer and a DAO layer, the RESTFUL layer receives and corresponds to a routing layer request through a Jersey framework, program intercommunication between the RESTFUL layer and the DAO layer is achieved through a Spring framework, finally the DAO layer achieves access to various relational databases through a JDBC interface, and the data layer is constructed through two relational databases of an Oracle Server and a Sql Server.
By the method, the judgment method is more scientific and reasonable, the judgment accuracy is further improved, and the user experience is improved.
Example 6
Embodiment 6 provides an intelligent irrigation area e platform, which is different from embodiment 5 in that, as shown in fig. 7, the data layer includes:
the spatial database building module 1 is used for acquiring spatial data and elevation relief data of an irrigation area and building a spatial database;
the service database construction module 2 is used for acquiring service data of the irrigation area and constructing a service database;
the thematic map drawing module 3 is used for loading maps of the irrigation areas through a map control method library, calling data in the spatial database construction module and the business database construction module to draw water conservancy thematic maps of the corresponding irrigation areas in the maps, and drawing a water conservancy thematic map for each irrigation area to comprehensively show the condition of the corresponding irrigation area;
after the spatial database construction module 1 and the business database construction module 2 finish data acquisition, the spatial database and the business database are respectively constructed after data are cleaned and data noise is removed.
The map control method library stores a plurality of functional controls, and can automatically load a plurality of application modules for the water conservancy thematic maps of the irrigation areas; the data layer integrates all service management data in the platform based on a geographic information management technology, is used for providing spatial data and irrigation area services for users, drawing a water conservancy thematic map of an irrigation area, acquiring elevation relief data, and the visual centralized display function of the irrigation area can be customized according to different requirements of different irrigation areas according to the requirements of the irrigation areas so as to meet the key points of information and data which are expected to be outstanding in management of different irrigation areas and the corresponding display form meeting the requirements of the irrigation areas; in the embodiment, when the platform has large geographical span, multiple service functions, centralized display areas and high operation and maintenance difficulty, non-blocking calling can be achieved by setting the routing layer, the aims of reducing the memory occupation and the CPU operation pressure of the server and processing high concurrent access are fulfilled.

Claims (10)

1. A method for constructing an e platform routing layer of an intelligent irrigation area by adopting node.js is characterized by comprising the following steps:
s1: receiving an event request initiated by an application layer, and compiling the event request into machine code for being executed by a CPU through a V8 engine;
s2: the Bingding module of node. js sends the compiled machine code to an event driving module for processing, and sends a processing result to a V8 engine;
s3: the V8 engine decompiles the received processing result, and then sends the decompiled result to the application layer to complete the construction of the routing layer;
wherein the step S2 includes the following steps:
s21: the Bingding module puts the received machine code into an event queue;
s22: the execution module delivers the machine codes in the event queue to a working thread to asynchronously call a service layer and returns a processing result to the binging module;
s23: the execution module returns the processing results sent by the event queue to the V8 engine.
2. The method of claim 1, wherein the step S1 comprises the steps of:
s11: judging whether the application layer sends an event request, if so, performing step S12, and if not, performing step S13;
s12: taking out the request sent by the application layer and the related callback function thereof, judging whether the related callback function exists or not, if so, executing the callback, and then performing step S11, and if not, directly performing step S11;
s13: after the interval T, step S11 is performed again.
3. The method of claim 1, wherein the step S21 is preceded by a step S20: and establishing a corresponding request object for the received machine code, packaging the request object, and setting parameters and a callback function.
4. The method of claim 3, wherein the step S22 comprises the steps of:
s221: the execution module delivers the request object to a working thread;
s222: judging whether the current working thread is available, if so, performing step S223, and if not, replacing the working thread until the replaced working thread is the available working thread;
s223: the asynchronous calling service layer executes the I/O operation in the request object;
s224: returning the result of the execution completion to the request object;
s225: and sending the request object to the event queue, and returning the processing result in the event queue to the V8 engine by the execution module.
5. An intelligent irrigation e platform is characterized by comprising an application layer, a routing layer, a service layer and a data layer, wherein the application layer is used for sending a user request to the routing layer and receiving a processing result of the routing layer, the routing layer is used for receiving the user request sent by the application layer, sending the processing result to the application layer and asynchronously calling the service layer, the service layer is used for feeding back the calling of the routing layer and accessing the data layer, and the data layer is used for storing all data and receiving and responding to the request of the service layer;
the construction method of the routing layer comprises the following steps:
s1: the routing layer receives a request initiated by the application layer, and the request is compiled into machine code for being executed by the CPU through a V8 engine;
s2: the Bingding module of node. js sends the compiled machine code to an event driving module for processing, and sends a processing result to a V8 engine;
s3: the V8 engine performs decompiling on the received processing result and then sends the decompiled result to the application layer;
further, the step S2 includes the following steps:
s21: the Bingding module puts the received machine code into an event queue;
s22: the execution module delivers the events in the event queue to a working thread to asynchronously call a service layer and returns the processing result to the binging module;
s23: the execution module returns the processing results sent by the event queue to the V8 engine.
6. The intelligent irrigated area e platform of claim 5, wherein the application layer comprises an application container and a page library, the application container comprising: the system comprises a style library, a control library, a resource library, a method library and an application space prepared for a user request page; the application layer calls a specified page from the page library according to a processing result sent by the routing layer and loads the page into an application space of an application container; the style library, the control library, the resource library and the method library are used for providing support for pages running in an application space and displaying an interface requested by a user in a browser for the user to use.
7. The intelligent irrigation e-platform of claim 5, wherein the service layer comprises a RESTFUL layer and a DAO layer, the RESTFUL layer realizes reception and corresponding routing layer request through a Jersey framework, and then realizes program intercommunication between the RESTFUL layer and the DAO layer by using a Spring framework, and finally the DAO layer realizes access to a plurality of relational databases by using a JDBC interface.
8. The smart irrigated area e platform of claim 5, wherein the data layer is constructed by two relational databases, Oracle and Sql Server.
9. The intelligent irrigated area e platform of claim 5, wherein the data layer comprises:
the system comprises a spatial database construction module (1) for acquiring spatial data and elevation relief data of an irrigation area and constructing a spatial database;
the service database construction module (2) is used for acquiring service data of the irrigation area and constructing a service database;
and the thematic map drawing module (3) is used for loading the maps of the irrigation areas through the map control method library, calling the data in the spatial database construction module and the service database construction module to draw the water conservancy thematic maps of the corresponding irrigation areas in the maps, and drawing one water conservancy thematic map in each irrigation area to comprehensively display the condition of the corresponding irrigation area.
10. The intelligent irrigation e-platform as claimed in claim 5, wherein the spatial database building module (1) and the business database building module (2) respectively build the spatial database and the business database after cleaning the data and removing data noise after collecting the data.
CN202110438519.8A 2021-04-22 2021-04-22 Method for constructing intelligent irrigation area e platform routing layer by node Pending CN113206873A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110438519.8A CN113206873A (en) 2021-04-22 2021-04-22 Method for constructing intelligent irrigation area e platform routing layer by node

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110438519.8A CN113206873A (en) 2021-04-22 2021-04-22 Method for constructing intelligent irrigation area e platform routing layer by node

Publications (1)

Publication Number Publication Date
CN113206873A true CN113206873A (en) 2021-08-03

Family

ID=77027988

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110438519.8A Pending CN113206873A (en) 2021-04-22 2021-04-22 Method for constructing intelligent irrigation area e platform routing layer by node

Country Status (1)

Country Link
CN (1) CN113206873A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109857801A (en) * 2019-01-02 2019-06-07 哈尔滨鸿德亦泰数码科技有限责任公司 Wisdom irrigated area e platform and data processing method based on four layer architectures
CN109857047A (en) * 2019-01-02 2019-06-07 哈尔滨鸿德亦泰数码科技有限责任公司 Wisdom irrigated area e platform based on dual architecture technology
CN112862628A (en) * 2021-01-15 2021-05-28 哈尔滨鸿德亦泰数码科技有限责任公司 Visual comprehensive display application platform for irrigation area

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109857801A (en) * 2019-01-02 2019-06-07 哈尔滨鸿德亦泰数码科技有限责任公司 Wisdom irrigated area e platform and data processing method based on four layer architectures
CN109857047A (en) * 2019-01-02 2019-06-07 哈尔滨鸿德亦泰数码科技有限责任公司 Wisdom irrigated area e platform based on dual architecture technology
CN112862628A (en) * 2021-01-15 2021-05-28 哈尔滨鸿德亦泰数码科技有限责任公司 Visual comprehensive display application platform for irrigation area

Similar Documents

Publication Publication Date Title
CN110321152B (en) Software development platform
CN109857801B (en) Intelligent irrigation area e platform based on four-layer architecture and data processing method
US7886278B2 (en) Object reference monitoring
CN111061788A (en) Multi-source heterogeneous data conversion integration system based on cloud architecture and implementation method thereof
Lee et al. U-city portal for smart ubiquitous middleware
CN102880503A (en) Data analysis system and data analysis method
JP2005516272A (en) Computing system and method for implicitly committing non-saved data for world wide web applications
CN111752959B (en) Real-time database cross-database SQL interaction method and system
CN100538646C (en) A kind of method and apparatus of in distributed system, carrying out the SQL script file
CN101551760A (en) Representation of data transformation processes for parallelization
CN101454777A (en) Method and system for ensuring consistency over time of data gathered by distinct software applications
CN103020058A (en) Multi-version data acquisition method and device
Zou et al. From a stream of relational queries to distributed stream processing
CN106446289B (en) Information query method and device based on Pinpoint
CN111459991B (en) Information query method and device
US8286181B2 (en) Supporting administration of a multi-application landscape
CN107153679B (en) Extraction statistical method and system for semi-structured big data
CN113206873A (en) Method for constructing intelligent irrigation area e platform routing layer by node
US8473954B2 (en) Executing operations via asynchronous programming model
CN100483398C (en) Electronic data table calculation method and device
CN103631594A (en) Asynchronous scheduling method and asynchronous scheduling system for general flow
CN112860225A (en) Intelligent irrigation area e platform with excellent expandability and secondary development structure construction method thereof
US20070185882A1 (en) Method and system for selective tracking of semantic web data using distributed update events
CN112685485A (en) Data acquisition method, data acquisition device, electronic equipment, storage medium and program product
CN107402752B (en) Timing triggering method and device for application

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