CN109460230B - Method and system for multiplexing transmission value and service logic between pages - Google Patents

Method and system for multiplexing transmission value and service logic between pages Download PDF

Info

Publication number
CN109460230B
CN109460230B CN201811328023.XA CN201811328023A CN109460230B CN 109460230 B CN109460230 B CN 109460230B CN 201811328023 A CN201811328023 A CN 201811328023A CN 109460230 B CN109460230 B CN 109460230B
Authority
CN
China
Prior art keywords
page
module
service
data
api
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
CN201811328023.XA
Other languages
Chinese (zh)
Other versions
CN109460230A (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.)
Nanyin Faba Consumer Finance Co ltd
Original Assignee
Suning Consumer Finance 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 Suning Consumer Finance Co ltd filed Critical Suning Consumer Finance Co ltd
Priority to CN201811328023.XA priority Critical patent/CN109460230B/en
Publication of CN109460230A publication Critical patent/CN109460230A/en
Application granted granted Critical
Publication of CN109460230B publication Critical patent/CN109460230B/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/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/36Software reuse

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Stored Programmes (AREA)
  • Storage Device Security (AREA)

Abstract

The invention provides a method for multiplexing page transmission value and service logic, which is suitable for a module with a plurality of pages, and comprises the following steps: and creating a common object class corresponding to the module for storing all page data and service logics of the module, wherein each page has read-write permission for the page data to which the page belongs and read-only permission for other page data, and the common object class is provided with a plurality of API interfaces which are in one-to-one correspondence with the service logics of the module. The invention can realize a quick page transmission method, and when other modules request to take the object, the API provided by the object can be directly called, thereby saving the development cost.

Description

Method and system for multiplexing transmission value and service logic between pages
Technical Field
The invention relates to the field of application program development, in particular to a method and a system for multiplexing page transmission values and service logic.
Background
A client side comprises a plurality of modules, such as modules for registration, login, setting and the like, and each module comprises a plurality of pages.
When one page jumps to another page, value transmission may be required, and if the second page is modified and the previous page needs to transmit more values, the value transmission code needs to be modified, and the code maintenance is difficult. Value transfer is more complicated if the current page requires much previous page data.
In addition, usually, the business logic of one module is packaged in a page of the module, and when one module needs the business logic processing capacity of other modules, the module is difficult to call, needs to be redeveloped, and is time-consuming and labor-consuming.
Disclosure of Invention
The invention aims to provide a method and a system for multiplexing inter-page value transfer and service logic, which are used for establishing a common object class corresponding to a module, and realizing a quick inter-page value transfer method by only transferring the object or reading data from the object among all pages. In addition, when other modules take the object, the API provided by the object can be directly called, so that the development cost is saved.
With reference to fig. 1, to achieve the above object, the present invention provides a method for multiplexing inter-page transmission value and service logic, which is suitable for a module having multiple pages, and the method includes:
and creating a common object class corresponding to the module for storing all page data and service logics of the module, wherein each page has read-write permission for the page data to which the page belongs and read-only permission for other page data, and the common object class is provided with a plurality of API interfaces which are in one-to-one correspondence with the service logics of the module.
Preferably, the common object class does not contain any UI code, and the stored business logic includes all the business logic required to process the pages, and the data of the pages are put together.
For example, the common object class of a module includes the following:
Page1Data:{data1,data2,…}
Page2Data:{data1,data2,…}
Page3Data:{data1,data2,…}
the rules for this common object class are set as follows:
each page can read and write the data of the page, and the data of other pages only have reading authority.
With reference to fig. 2, the present invention provides a method for transferring values between pages:
creating a common object class of the module, wherein all pages of the module comprise an instance of the common object class; responding to any page request in the module to jump other pages, creating a page object of the page after jumping, and then assigning the common object of the current page to the common object of the page after jumping.
In some examples, the initialization of the instance is null. For the foregoing case, the method further comprises:
and responding to any page request to read data from the public object class, if the corresponding page object is empty, creating the page object, and then reading the data.
As mentioned previously, it is yet another object of the common object class mentioned in the present invention to facilitate other modules or pages to quickly invoke the business logic of the current module or page.
With reference to fig. 3, the specific service logic multiplexing method is as follows:
and responding to any page of the module to receive a service request, calling an API (application programming interface) of relevant service logic of a public object class corresponding to the module, receiving a service response by the public object class, updating data after processing, calling back to inform a page processing result, and refreshing the current page by the page according to the returned page processing result.
The public object class provides a service processing API, internally processes a service request from a server end, completes the processing of response data and the assignment of the data, and then calls back a service processing result to an API caller.
For example, a page needs to obtain one of the service requests of a module, call the service request API provided by the common object of the module, the common object receives the service response, updates the data, calls back to inform that the page request is processed, and the page refreshes the current page according to the data provided by the common object.
Similarly, when another module needs to call the service logic of the module, the service logic can be realized by directly calling the API of the relevant service logic of the module.
In other examples, in conjunction with fig. 4, a service request for a first page of a module to call a second page may be implemented by:
the second page creates a public object and instantiates and provides an API interface of related service logic, the first page calls the API interface of the related service request of the public object of the second page, the public object receives the service request, the first page is called back to inform a processing result after the service request is processed, and the first page refreshes the page according to the processing result.
Based on the method, the invention also provides a system for multiplexing the page transmission value and the service logic, which is suitable for a module with a plurality of pages, and the system comprises the following two modules:
1) the module is used for creating a common object class corresponding to the module, wherein the common object class stores all page data and service logic of the module, and each page has read-write permission for the page data to which the page belongs and read-only permission for other page data;
2) and the module is used for setting a plurality of API interfaces for the public object class, and the API interfaces correspond to the service logics of the modules one to one.
Compared with the prior art, the technical scheme of the invention has the following remarkable beneficial effects:
1) the quick value transmission between the pages is realized, and the code maintenance is easy.
2) The service logic of the module is directly transferred, repeated development is avoided, and development cost is reduced.
It should be understood that all combinations of the foregoing concepts and additional concepts described in greater detail below can be considered as part of the inventive subject matter of this disclosure unless such concepts are mutually inconsistent. In addition, all combinations of claimed subject matter are considered a part of the presently disclosed subject matter.
The foregoing and other aspects, embodiments and features of the present teachings can be more fully understood from the following description taken in conjunction with the accompanying drawings. Additional aspects of the present invention, such as features and/or advantages of exemplary embodiments, will be apparent from the description which follows, or may be learned by practice of specific embodiments in accordance with the teachings of the present invention.
Drawings
The drawings are not intended to be drawn to scale. In the drawings, each identical or nearly identical component that is illustrated in various figures may be represented by a like numeral. For purposes of clarity, not every component may be labeled in every drawing. Embodiments of various aspects of the present invention will now be described, by way of example, with reference to the accompanying drawings, in which:
fig. 1 is a flow chart of a method for multiplexing page transmission value and service logic according to the invention.
FIG. 2 is a flow chart of a method of an example of an inter-page transfer value of the present invention.
Fig. 3 is a flow chart of a method of a first example of service logic multiplexing of the present invention.
Fig. 4 is a flow chart of a method of a second example of service logic multiplexing of the present invention.
Detailed Description
In order to better understand the technical content of the present invention, specific embodiments are described below with reference to the accompanying drawings.
In this disclosure, aspects of the present invention are described with reference to the accompanying drawings, in which a number of illustrative embodiments are shown. Embodiments of the present disclosure are not necessarily intended to include all aspects of the invention. It should be appreciated that the various concepts and embodiments described above, as well as those described in greater detail below, may be implemented in any of numerous ways, as the disclosed concepts and embodiments are not limited to any one implementation. In addition, some aspects of the present disclosure may be used alone, or in any suitable combination with other aspects of the present disclosure.
The invention aims to provide a method and a system for multiplexing page transmission values and service logics, which are used for solving the problems of complex page transmission values, difficult code maintenance and difficult module service logic multiplexing in the prior art.
Detailed description of the preferred embodiment
Taking a registration login module as an example, assume that the registration login module includes the following pages: inputting and inputting a mobile phone number page, a registration page and a login page.
And creating a public object of the registration login module, wherein the public object comprises mobile phone number data, user data returned after successful login, a mobile phone number query API, a registration request API and a login API, and each API is used for calling corresponding service logic, for example, the mobile phone number query API is used for calling the mobile phone number query service logic and is used for querying whether the mobile phone number input by a client is a registered account. All pages contain common object instances.
And on a mobile phone number page, a customer inputs a mobile phone number, clicks and submits the mobile phone number, the public object stores the mobile phone number, calls a mobile phone number inquiry API and judges whether the mobile phone number needs to be registered or can be directly logged in.
1) And if the registration is needed, jumping the registration page, assigning the public object to the registration page public object by the mobile phone number page, filling registration information by the user, clicking the registration, and calling the registration request API.
2) If the user can directly log in, the login page is skipped, the public object is assigned to the login page public object by the mobile phone number page, the user fills in the password, clicks the login, calls the login request API, returns login information and stores the login information in the public object.
Detailed description of the invention
When an APP is developed, if a mobile phone end and a pad end need to be developed simultaneously, a public object written at the mobile phone end can be directly multiplexed at the pad end by the service logic multiplexing method, and secondary development cost is reduced.
In other examples, the method can also be applied between two different APPs, and when one of the APPs needs the service logic of a certain module of the other APP, the service logic is directly multiplexed by the service logic multiplexing method, so that secondary development is avoided, and development cost is saved.
Although the present invention has been described with reference to the preferred embodiments, it is not intended to be limited thereto. Those skilled in the art can make various changes and modifications without departing from the spirit and scope of the invention. Therefore, the protection scope of the present invention should be determined by the appended claims.

Claims (3)

1. A method for multiplexing inter-page value and business logic, adapted to a module having a plurality of pages, the method comprising:
creating a common object class corresponding to the module for storing all page data and service logic of the module, wherein each page has read-write permission to the page data to which the page belongs and read-only permission of other page data, and
the public object class is provided with a plurality of API interfaces, and the API interfaces correspond to the service logics of the modules one by one;
the method further comprises the following steps:
creating a common object class of the module, wherein all pages of the module comprise an instance of the common object class;
responding to any page request in the module to jump other pages, creating a page object of the page after jumping, and assigning a common object of the current page to the common object of the page after jumping;
the method further comprises the following steps:
responding to any page of the module to receive a service request, calling an API (application programming interface) of relevant service logic of a public object class corresponding to the module, receiving a service response by the public object class, updating data after processing, calling back to inform a page processing result, and refreshing a current page by the page according to the returned page processing result;
the method further comprises the following steps:
responding to a first page request of the module to call a service request of a second page, creating a public object and instantiating and providing an API (application programming interface) interface of a related service request of the second page, calling the API interface of the related service request of the public object of the second page by the first page, receiving the service request by the public object, calling back a first page informing processing result after processing, and refreshing the page by the first page according to the processing result.
2. The method of inter-page value and business logic multiplexing according to claim 1, wherein initialization of said instance is null.
3. The method of multiplexing interpage values and business logic according to claim 2, further comprising:
and responding to any page request to read data from the public object class, if the corresponding page object is empty, creating the page object, and then reading the data.
CN201811328023.XA 2018-11-09 2018-11-09 Method and system for multiplexing transmission value and service logic between pages Active CN109460230B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811328023.XA CN109460230B (en) 2018-11-09 2018-11-09 Method and system for multiplexing transmission value and service logic between pages

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811328023.XA CN109460230B (en) 2018-11-09 2018-11-09 Method and system for multiplexing transmission value and service logic between pages

Publications (2)

Publication Number Publication Date
CN109460230A CN109460230A (en) 2019-03-12
CN109460230B true CN109460230B (en) 2021-11-09

Family

ID=65609800

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811328023.XA Active CN109460230B (en) 2018-11-09 2018-11-09 Method and system for multiplexing transmission value and service logic between pages

Country Status (1)

Country Link
CN (1) CN109460230B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109918118B (en) * 2019-03-25 2022-08-09 北京城市网邻信息技术有限公司 Service line registration method and related equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104702674A (en) * 2015-02-12 2015-06-10 腾讯科技(深圳)有限公司 Geographic position interaction method and geographic position interaction device
CN105549978A (en) * 2015-12-17 2016-05-04 浪潮软件集团有限公司 Configuration method for solving pull-down list parameters of web foreground page

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8640212B2 (en) * 2010-05-27 2014-01-28 Red Hat, Inc. Securing passwords with CAPTCHA based hash when used over the web
CN103106249B (en) * 2013-01-08 2016-04-20 华中科技大学 A kind of parallel data processing system based on Cassandra
CN104683454A (en) * 2015-02-12 2015-06-03 腾讯科技(深圳)有限公司 Data interaction method and device
CN108228288A (en) * 2016-12-22 2018-06-29 航天信息股份有限公司 A kind of component system and its call method and device
CN107526594B (en) * 2017-08-28 2021-03-30 深圳市华傲数据技术有限公司 Management method and device of RN (Relay node) page

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104702674A (en) * 2015-02-12 2015-06-10 腾讯科技(深圳)有限公司 Geographic position interaction method and geographic position interaction device
CN105549978A (en) * 2015-12-17 2016-05-04 浪潮软件集团有限公司 Configuration method for solving pull-down list parameters of web foreground page

Also Published As

Publication number Publication date
CN109460230A (en) 2019-03-12

Similar Documents

Publication Publication Date Title
CN109840429B (en) Intelligent contract deployment and calling method and device
CN108470298B (en) Method, device and system for transferring resource numerical value
CN111163129A (en) Resource processing method and device based on cross-link network
CN111240763A (en) Configuration updating method, device, equipment and storage medium
CN111460506A (en) Data access control method and device
CN108718337B (en) Website account login, verification and verification information processing method, device and system
CN105701112A (en) Data processing method, apparatus and system
CN105488125A (en) Page access method and apparatus
CN102135895B (en) System upgrading method and system
US10776179B2 (en) Multi-application-oriented user data management method and system
CN104756080A (en) Augmenting capabilities of a host device
CN111461763A (en) Resource allocation method and device
CN108845800B (en) Method, device, equipment and storage medium for realizing component extension function
CN109951318A (en) The function configuration method and device of application
CN110737425A (en) billing platform system application program establishing method and device
CN110750780B (en) User role permission fusion method, device and equipment based on multi-service system
CN104618388A (en) Quick registration and login method and corresponding reset server and information server
CN109460230B (en) Method and system for multiplexing transmission value and service logic between pages
CN110704130A (en) Data processing method and device
CN108664343B (en) State calling method and device for micro-service
CN109343970B (en) Application program-based operation method and device, electronic equipment and computer medium
CN105224541A (en) The uniqueness control method of data, information storage means and device
US11093309B1 (en) Communication hub for information technology (IT) services
CN108696864B (en) Virtual number request and transmission method, device and storage medium
CN101764791B (en) User identity verification method, equipment and system in business chain

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
CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: No.88, Huaihai Road, Qinhuai District, Nanjing City, Jiangsu Province, 210000

Patentee after: Nanyin Faba Consumer Finance Co.,Ltd.

Address before: No.88, Huaihai Road, Qinhuai District, Nanjing City, Jiangsu Province, 210000

Patentee before: SUNING CONSUMER FINANCE Co.,Ltd.