CN107479891B - MVC model-based data processing system and method - Google Patents

MVC model-based data processing system and method Download PDF

Info

Publication number
CN107479891B
CN107479891B CN201710706542.4A CN201710706542A CN107479891B CN 107479891 B CN107479891 B CN 107479891B CN 201710706542 A CN201710706542 A CN 201710706542A CN 107479891 B CN107479891 B CN 107479891B
Authority
CN
China
Prior art keywords
data
module
control module
view
model
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710706542.4A
Other languages
Chinese (zh)
Other versions
CN107479891A (en
Inventor
龙超华
王震坡
刘鹏
孙逢春
陈奕昆
易密
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Institute of Technology BIT
Original Assignee
Beijing Institute of Technology BIT
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 Institute of Technology BIT filed Critical Beijing Institute of Technology BIT
Priority to CN201710706542.4A priority Critical patent/CN107479891B/en
Publication of CN107479891A publication Critical patent/CN107479891A/en
Application granted granted Critical
Publication of CN107479891B publication Critical patent/CN107479891B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a data processing system and a method based on an MVC model, wherein the system comprises: the device comprises a view module, a model module, a control module and a service module. The MVC model data processing system is provided with the view module, the model module, the control module and the service module, and each module stores corresponding data, so that the data can be directly called at the later stage, the data acquisition and processing time is reduced, the burden of the control module is lightened, the phenomenon of swelling of the control module in the follow-up process is avoided, and the maintenance efficiency is higher; meanwhile, blocking processing is realized, and only corresponding modules need to be transplanted into a new project aiming at similar parts which are common in a plurality of projects of a developer, so that the development time is greatly reduced.

Description

MVC model-based data processing system and method
Technical Field
The invention relates to the field of data processing, in particular to a data processing system and method based on an MVC model.
Background
Model View Controller (MVC) Model systems are generally composed of a Model module, a View module, and a control module, allowing for loose coupling among the various components that make up the system, to make program development more flexible, and to reduce repetitive code and enable code reuse, where:
the view module presents information representing model data and logical relationships and states to a user in a particular form, and the model module obtains display information that can be in a plurality of different display forms for the same information.
The control module is used for processing the interactive operation between the user and the software, and the responsibility of the control module is to control and provide the propagation of any change in the model module and ensure the corresponding relation between the user interface and the model module; the model module receives the input of a user, feeds the input back to the model module, further realizes the calculation control of the model module, and is a key component for enabling the model module and the view module to work coordinately.
The model module represents an enterprise database and business rules, and stores data required by the view module and the controller module; it encapsulates the computational relationships of core data, logic and functions of the problem, independent of specific interface expressions and I/O operations.
Fig. 1 shows a specific conventional MVC model, where a view module in the conventional MVC model sends a data receiving request to a control module according to a command sent by a client, the control module sends a data obtaining request to the model module according to the data receiving request sent by the view module, the model module sends data to the control module after receiving the data obtaining request sent by the control module, and the control module processes the data and sends the processed data to the view module for display. As can be seen from the above discussion, a large number of services such as all static and dynamic view modules, data storage, logic processing, and the like are completed by the control module, which easily causes the control module to be overstaffed, and has low post-maintenance efficiency and long data processing time; in addition, due to the problems of poor portability and the like among the existing MVCs, the development time is greatly increased.
In view of the above problems, how to overcome the above disadvantages is a technical problem that needs to be solved urgently in the field of digital processing technology.
Disclosure of Invention
The invention aims to provide a data processing system and a data processing method based on an MVC model, which are used for realizing blocking processing, reducing data processing time and lightening the burden of a control module.
To achieve the above object, the present invention provides an MVC model-based data processing system, comprising: the system comprises a view module, a model module, a control module and a service module;
the view module is respectively connected with the service module and the control module and is used for acquiring page actions and sending action requests to the control module; the view module is also used for receiving view data sent by the service module and initial data sent by the control module;
the control module is respectively connected with the model module and the service module, and is used for receiving the action request sent by the view module, judging whether view data corresponding to the action request exists or not and obtaining a first judgment result; when the first judgment result is yes, directly sending the view data to the view module; when the first judgment result is negative, sending a data acquisition request to the model module; the control module is further configured to receive initial data sent by the model module, determine whether the initial data is the view data, and obtain a second determination result; when the second judgment result is yes, sending the initial data to the view module, and storing the initial data; when the second result is negative, the initial data is sent to the service module; the control module is also used for receiving and storing the view data sent by the service module;
the model module is used for receiving a data acquisition request sent by the control module and sending initial data to the control module;
the service module is used for receiving the initial data sent by the control module, processing the initial data to obtain the view data, and respectively sending the view data to the control module and the view module.
Optionally, the model module includes:
the receiving unit is used for receiving the data acquisition request sent by the control module;
the judging unit is connected with the receiving unit and used for judging whether the initial data corresponding to the data acquisition request exists in the model module or not and acquiring a third judgment result;
the first sending unit is respectively connected with the judging unit and the control module and is used for directly sending the initial data to the control module when a third judging result is yes;
and the second sending unit is respectively connected with the judging unit and the control module and used for acquiring json data through a network interface, processing the json data to obtain initial data, storing the initial data and sending the initial data to the control module when the third judging result is negative.
Optionally, the second sending unit specifically includes:
the acquiring subunit is used for acquiring json data through a network interface;
the key value coding processing subunit is connected with the acquiring subunit and is used for carrying out key value coding processing on the json data to acquire first data;
the data conversion processing subunit is connected with the key value coding processing subunit and is used for performing data conversion processing on the first data to obtain initial data;
and the sending subunit is respectively connected with the data conversion processing subunit and the control module and is used for storing the initial data and sending the initial data to the control module.
The invention also provides an MVC model-based data processing method, which is applied to the MVC model-based data processing system and comprises the following steps:
acquiring page actions by using a view module, and sending action requests to a control module;
receiving the action request sent by the view module by using the control module, and judging whether view data corresponding to the action request exists or not by using the control module to obtain a first judgment result; when the first judgment result is yes, directly sending the view data in the control module to a view module; when the first judgment result is negative, sending a data acquisition request to the model module through the control module;
receiving a data acquisition request sent by the control module by using the model module, and sending initial data corresponding to the data acquisition request in the model module to the control module;
receiving the initial data sent by the model module by using the control module, and judging whether the initial data is the view data or not by using the control module to obtain a second judgment result; when the second judgment result is yes, the initial data are sent to the view module through the control module, and the initial data are stored in the control module; when the second result is negative, the initial data is sent to a service module through the control module;
the service module is used for receiving the initial data sent by the control module, processing the initial data through the service module to obtain the view data, and sending the view data to the view module;
and receiving the view data sent by the service module and the initial data sent by the control module by using the view module.
Optionally, the receiving, by the model module, the data acquisition request sent by the control module, and sending the initial data corresponding to the data acquisition request in the model module to the control module includes:
receiving a data acquisition request sent by the control module by using the model module, and judging whether the initial data corresponding to the data acquisition request exists in the model module by using the model module to obtain a third judgment result;
when the third judgment result is yes, directly sending the initial data in the model module to the control module;
and when the third judgment result is negative, acquiring json data through a network interface in the model module, processing the json data to obtain initial data, storing the initial data in the model module, and sending the initial data to the control module.
Optionally, the processing the json data to obtain initial data specifically includes:
performing key value coding processing on the json data to obtain first data;
and performing data conversion processing on the first data to obtain initial data.
Optionally, after the receiving, by the service module, the initial data sent by the control module, processing the initial data by the service module to obtain the view data, and sending the view data to the view module, the method further includes:
and sending the view data to the control module by utilizing the service module so that the control module stores the view data.
According to the specific embodiment provided by the invention, the invention discloses the following technical effects: the MVC model data processing system is provided with the view module, the model module, the control module and the service module, and each module stores corresponding data, so that the MVC model data processing system is convenient to call directly at a later stage, the data processing time is shortened, and the burden of the control module is reduced. In addition, the MVC model data processing system is provided with a view module, a model module, a control module and a service module, so that the blocking processing is realized, and the portability is strong.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings without inventive exercise.
FIG. 1 is a prior art MVC model according to an embodiment of the present invention;
FIG. 2 is a diagram of an MVC model data processing system according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The invention aims to provide a data processing system and a data processing method based on an MVC model, which are used for realizing blocking processing, reducing data processing time and lightening the burden of a control module.
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
Fig. 2 is a structural diagram of an MVC model data processing system according to an embodiment of the present invention, and as shown in fig. 2, the present invention provides an MVC model-based data processing system, which includes: the system comprises a view module 1, a control module 2, a model module 3 and a service module 4.
The control module 2 is respectively connected with the view module 1, the model module 3 and the service module 4 in a bidirectional manner, and the view module 1 is connected with the service module 4 in a unidirectional manner.
The view module 1 is used for acquiring page actions and sending action requests to the control module 2. The control module 2 is configured to receive the action request sent by the view module 1, determine whether view data corresponding to the action request exists, and obtain a first determination result; when the first judgment result is yes, the view data is directly sent to the view module 1; and when the first judgment result is negative, sending a data acquisition request to the model module 3.
The model module 3 is configured to receive a data acquisition request sent by the control module 2, and send initial data corresponding to the data acquisition request to the control module 2.
The model module 3 specifically includes: the device comprises a receiving unit, a judging unit, a first sending unit and a second sending unit.
The receiving unit is configured to receive a data acquisition request sent by the control module 2.
The judging unit is connected with the receiving unit and is used for judging whether the initial data corresponding to the data acquisition request exists in the model module or not and acquiring a third judgment result.
The first sending unit is respectively connected with the judging unit and the control module 2, and the first sending unit is used for directly sending the initial data to the control module 2 when the third judging result is yes.
The second sending unit is respectively connected to the judging unit and the control module 2, and the second sending unit is configured to, when the third judgment result is negative, obtain json (JavaScript Object notification, a lightweight data exchange format) data through a network interface, process the json data to obtain initial data, store the initial data, and send the initial data to the control module 2.
The second sending unit specifically includes: the device comprises an acquisition subunit, a key value coding processing subunit, a data conversion processing subunit and a sending subunit.
The acquiring subunit is configured to acquire json data through a network interface.
The Key Value Coding processing subunit is connected to the obtaining subunit, and the Key Value Coding processing subunit is configured to perform Key Value Coding (KVC) processing on the json data to obtain first data.
The data conversion processing subunit is connected to the key value encoding processing subunit, and the data conversion processing subunit is configured to perform data conversion processing on the first data to obtain initial data.
The sending subunit is connected to the data conversion processing subunit and the control module 2, and is configured to store the initial data and send the initial data to the control module 2.
The control module 2 is further configured to receive initial data sent by the model module 3, determine whether the initial data is the view data, and obtain a second determination result; when the second judgment result is yes, sending the initial data to the view module 1, and storing the initial data; and when the second result is negative, sending the initial data to the service module 4.
The service module 4 is connected to the control module 2 and the view module 1, respectively, and configured to receive the initial data sent by the control module 2, process the initial data to obtain the view data, and send the view data to the control module 2 and the view module 1, respectively.
The control module 2 is further configured to receive and store the view data sent by the service module 4.
The view module 1 is further configured to receive view data sent by the service module 4 and initial data sent by the control module 2.
The invention also provides a data processing method based on the MVC model, which comprises the following steps:
step 100: and acquiring page actions by using the view module 1, and sending action requests to the control module 2.
Step 200: receiving the action request sent by the view module 1 by using the control module 2, and judging whether view data corresponding to the action request exists or not by using the control module 2 to obtain a first judgment result; when the first judgment result is yes, directly sending the view data in the control module 2 to a view module 1; and when the first judgment result is negative, sending a data acquisition request to the model module 3 through the control module 2.
Step 300: and receiving a data acquisition request sent by the control module 2 by using the model module 3, and sending initial data corresponding to the data acquisition request in the model module 3 to the control module 2.
Receiving a data acquisition request sent by the control module 2 by using the model module 3, and judging whether the initial data corresponding to the data acquisition request exists in the model module 3 by using the model module 3 to obtain a third judgment result; when the third judgment result is yes, directly sending the initial data in the model module to the control module 2; if the third determination result is negative, acquiring json (lightweight data exchange format) data through a network interface in the model module 3, performing KVC processing on the json data to acquire first data, performing data conversion processing on the first data to acquire initial data, storing the initial data in the model module, and sending the initial data to the control module 2.
Step 400: receiving the initial data sent by the model module 3 by using the control module 2, and judging whether the initial data is the view data or not by using the control module 2 to obtain a second judgment result; when the second judgment result is yes, the control module 2 sends the initial data to the view module 1, and stores the initial data in the control module; and when the second result is negative, sending the initial data to the service module 4 through the control module 2.
Step 500: receiving the initial data sent by the control module 2 by using the service module 4, processing the initial data by using the service module 4 to obtain the view data, and sending the view data to the view module 1; the service module 4 also sends the view data to the control module 2; the control module 2 receives and saves the view data.
Step 600: and receiving the view data sent by the service module 4 and the initial data sent by the control module 2 by using the view module 1.
The MVC model data processing system and the method have the following advantages that:
1. the MVC model data processing system is provided with a view module 1, a model module 3, a control module 2 and a service module 4, and each module stores corresponding data, so that the MVC model data processing system is convenient to directly call in the later period, the data acquisition and processing time is reduced, the burden of the control module 2 is reduced, the phenomenon that the control module 2 is bloated in the subsequent period is avoided, and the maintenance efficiency is higher.
2. Portability-the present invention sets the view module 1, the model module 3, the control module 2, and the service module 4 in the MVC model data processing system, realizes the blocking process, and only needs to transplant the corresponding module to a new project aiming at the common similar part in a plurality of projects of a developer, thereby greatly reducing the development time.
The principles and embodiments of the present invention have been described herein using specific examples, which are provided only to help understand the method and the core concept of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, the specific embodiments and the application range may be changed. In view of the above, the present disclosure should not be construed as limiting the invention.

Claims (7)

1. An MVC model-based data processing system, the system comprising: the system comprises a view module, a model module, a control module and a service module;
the view module is respectively connected with the service module and the control module and is used for acquiring page actions and sending action requests to the control module; the view module is also used for receiving view data sent by the service module or initial data sent by the control module;
the control module is respectively connected with the model module, the service module and the view module, and is used for receiving the action request sent by the view module, judging whether view data corresponding to the action request exists or not and obtaining a first judgment result; when the first judgment result is yes, directly sending the view data to the view module; when the first judgment result is negative, sending a data acquisition request to the model module; the control module is further configured to receive initial data sent by the model module, determine whether the initial data is the view data, and obtain a second determination result; when the second judgment result is yes, sending the initial data to the view module, and storing the initial data; when the second result is negative, the initial data is sent to the service module; the control module is also used for receiving and storing the view data sent by the service module;
the model module is used for receiving a data acquisition request sent by the control module and sending initial data to the control module;
the service module is used for receiving the initial data sent by the control module, processing the initial data to obtain the view data, and respectively sending the view data to the control module and the view module.
2. The MVC model-based data processing system of claim 1, wherein the model module comprises:
the receiving unit is used for receiving the data acquisition request sent by the control module;
the judging unit is connected with the receiving unit and used for judging whether the initial data corresponding to the data acquisition request exists in the model module or not and acquiring a third judgment result;
the first sending unit is respectively connected with the judging unit and the control module and is used for directly sending the initial data to the control module when a third judging result is yes;
and the second sending unit is respectively connected with the judging unit and the control module and used for acquiring json data through a network interface, processing the json data to obtain initial data, storing the initial data and sending the initial data to the control module when the third judging result is negative.
3. The MVC model-based data processing system of claim 2, wherein the second transmitting unit specifically includes:
the acquiring subunit is used for acquiring json data through a network interface;
the key value coding processing subunit is connected with the acquiring subunit and is used for carrying out key value coding processing on the json data to acquire first data;
the data conversion processing subunit is connected with the key value coding processing subunit and is used for performing data conversion processing on the first data to obtain initial data;
and the sending subunit is respectively connected with the data conversion processing subunit and the control module and is used for storing the initial data and sending the initial data to the control module.
4. An MVC model-based data processing method applied to the MVC model-based data processing system according to any one of claims 1 to 3, the method comprising:
acquiring page actions by using a view module, and sending action requests to a control module;
receiving the action request sent by the view module by using the control module, and judging whether view data corresponding to the action request exists or not by using the control module to obtain a first judgment result; when the first judgment result is yes, directly sending the view data in the control module to a view module; when the first judgment result is negative, sending a data acquisition request to the model module through the control module;
receiving a data acquisition request sent by the control module by using the model module, and sending initial data corresponding to the data acquisition request in the model module to the control module;
receiving the initial data sent by the model module by using the control module, and judging whether the initial data is the view data or not by using the control module to obtain a second judgment result; when the second judgment result is yes, the initial data are sent to the view module through the control module, and the initial data are stored in the control module; when the second result is negative, the initial data is sent to a service module through the control module;
the service module is used for receiving the initial data sent by the control module, processing the initial data through the service module to obtain the view data, and sending the view data to the view module;
and receiving the view data sent by the service module or the initial data sent by the control module by using the view module.
5. The MVC model-based data processing method according to claim 4, wherein the step of receiving the data acquisition request sent by the control module by the model module and sending initial data corresponding to the data acquisition request in the model module to the control module comprises:
receiving a data acquisition request sent by the control module by using the model module, and judging whether the initial data corresponding to the data acquisition request exists in the model module by using the model module to obtain a third judgment result;
when the third judgment result is yes, directly sending the initial data in the model module to the control module;
and when the third judgment result is negative, acquiring json data through a network interface in the model module, processing the json data to obtain initial data, storing the initial data in the model module, and sending the initial data to the control module.
6. The MVC model-based data processing method according to claim 5, wherein the json data is processed to obtain initial data, and the specific steps are as follows:
performing key value coding processing on the json data to obtain first data;
and performing data conversion processing on the first data to obtain initial data.
7. The MVC model-based data processing method of claim 4, wherein after receiving the initial data sent by the control module by the service module, processing the initial data by the service module to obtain the view data, and sending the view data to the view module, the MVC model-based data processing method further comprises:
and sending the view data to the control module by utilizing the service module so that the control module stores the view data.
CN201710706542.4A 2017-08-17 2017-08-17 MVC model-based data processing system and method Active CN107479891B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710706542.4A CN107479891B (en) 2017-08-17 2017-08-17 MVC model-based data processing system and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710706542.4A CN107479891B (en) 2017-08-17 2017-08-17 MVC model-based data processing system and method

Publications (2)

Publication Number Publication Date
CN107479891A CN107479891A (en) 2017-12-15
CN107479891B true CN107479891B (en) 2020-05-12

Family

ID=60600723

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710706542.4A Active CN107479891B (en) 2017-08-17 2017-08-17 MVC model-based data processing system and method

Country Status (1)

Country Link
CN (1) CN107479891B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108334322B (en) * 2017-12-30 2021-07-13 方正璞华软件(武汉)股份有限公司 Data request method and system of MVC framework
CN109460226B (en) * 2018-11-26 2022-04-22 深圳乐信软件技术有限公司 Test certificate image generation method, device, equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9269095B1 (en) * 2015-03-20 2016-02-23 TappingStone Inc. Methods and systems for visual replay of predictive engine performance
CN105955714A (en) * 2016-04-15 2016-09-21 北京海尔广科数字技术有限公司 Mixed development front end MVC frame implementation method and system
CN106560787A (en) * 2016-12-29 2017-04-12 武汉斗鱼网络科技有限公司 MVVM-framework-based view page displaying method and apparatus

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9269095B1 (en) * 2015-03-20 2016-02-23 TappingStone Inc. Methods and systems for visual replay of predictive engine performance
CN105955714A (en) * 2016-04-15 2016-09-21 北京海尔广科数字技术有限公司 Mixed development front end MVC frame implementation method and system
CN106560787A (en) * 2016-12-29 2017-04-12 武汉斗鱼网络科技有限公司 MVVM-framework-based view page displaying method and apparatus

Also Published As

Publication number Publication date
CN107479891A (en) 2017-12-15

Similar Documents

Publication Publication Date Title
US20190228303A1 (en) Method and apparatus for scheduling resource for deep learning framework
CN111782365B (en) Timed task processing method, device, equipment and storage medium
CN110413673B (en) Database data unified acquisition and distribution method and system
CN110825807B (en) Data interactive conversion method, device, equipment and medium based on artificial intelligence
WO2019047441A1 (en) Communication optimization method and system
KR20210040332A (en) Application construction method and apparatus, electronic device and storage medium
CN110955715A (en) ERP system, data conversion method and device of target platform and electronic equipment
CN113094125B (en) Business process processing method, device, server and storage medium
CN110990482A (en) Data synchronization method and device between asynchronous databases
CN107479891B (en) MVC model-based data processing system and method
CN108900627B (en) Network request method, terminal device and storage medium
JP7375089B2 (en) Method, device, computer readable storage medium and computer program for determining voice response speed
CN103685083A (en) Communication method in asynchronous management network
CN113658351B (en) Method and device for producing product, electronic equipment and storage medium
CN111294377B (en) Dependency network request sending method, terminal device and storage medium
CN111917814A (en) Data publishing method, data subscribing method, data publishing device, data subscribing system and readable storage medium
CN113419880A (en) Cloud mobile phone root authority acquisition method, related device and computer program product
CN103729455A (en) Master data storage method based on primary copy storage pattern
CN116932147A (en) Streaming job processing method and device, electronic equipment and medium
CN104735134B (en) A kind of method and apparatus serviced for providing calculating
CN114971689B (en) Task processing method, device, equipment and storage medium
CN113537954B (en) Project milestone processing method and device, storage medium and electronic equipment
CN115827265A (en) Transaction processing method, device, equipment and storage medium
CN110018906B (en) Scheduling method, server and scheduling system
CN107291455B (en) Method and system for realizing transfer service based on factory mode

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
GR01 Patent grant
GR01 Patent grant