Nothing Special   »   [go: up one dir, main page]

WO2018201871A1 - Data notification method, device and readable storage medium - Google Patents

Data notification method, device and readable storage medium Download PDF

Info

Publication number
WO2018201871A1
WO2018201871A1 PCT/CN2018/082919 CN2018082919W WO2018201871A1 WO 2018201871 A1 WO2018201871 A1 WO 2018201871A1 CN 2018082919 W CN2018082919 W CN 2018082919W WO 2018201871 A1 WO2018201871 A1 WO 2018201871A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
layer
view
target data
change message
Prior art date
Application number
PCT/CN2018/082919
Other languages
French (fr)
Chinese (zh)
Inventor
张磊
张文明
陈少杰
Original Assignee
武汉斗鱼网络科技有限公司
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 武汉斗鱼网络科技有限公司 filed Critical 武汉斗鱼网络科技有限公司
Publication of WO2018201871A1 publication Critical patent/WO2018201871A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code

Definitions

  • the present disclosure relates to the technical field of software data model design, and in particular, to a data notification method, apparatus, and readable storage medium.
  • the MVC Model-View-Controller, Model-View-controller
  • the model layer is responsible for the data.
  • the data work the view layer is responsible for the display of the view
  • the control (Controller) layer is responsible for transferring the data of the model layer to the view layer and controlling the view layer to display accordingly.
  • the model layer and the view layer need to be coupled through the control layer, which causes the control layer to increase the coupling relationship between the layers, so that the business logic of the model layer and the view layer is very complicated and controlled.
  • the layer is also coupled with the implementation of some business logic, which affects the scalability of the software and is inconvenient for the maintenance of the software code.
  • an object of the present disclosure includes providing a data notification method, which is applied to a software model, the software model including a data layer and a view layer, the data layer configured to perform data Processing and converting, the view layer being configured to perform display of a software view according to data in the data layer; the method comprising:
  • the data layer detects data changes of the target data point to generate a data change message
  • the data layer sends the data change message to a view layer that registers to listen for changes in the target data point;
  • the view layer performs corresponding view switching or presentation according to the received data change message.
  • the software model includes a set of listeners, and the plurality of view layers monitor changes of the target data points through the set of listeners; the data layer will The step of sending a data change message to the view layer that registers the change of the target data point includes:
  • the data layer traverses the set of listeners, and sends the data change message to a view layer that registers to listen for changes in the target data point.
  • each of the listeners is configured with a corresponding priority level
  • the data layer traverses the set of the listeners, and sends the data change message to a view that registers to listen to changes of the target data point.
  • Layer including:
  • the data layer traverses from the highest priority listener to the lowest priority listener in the set of listeners according to the priority level of the respective listeners, and sends the data change information to the registration monitor.
  • the listener is an interface protocol between the data layer and the view layer, and the interface protocol includes an interface function; the sending the data change message to The steps to register the view layer that listens for changes to the target data point, including:
  • the data layer sends a data change message to the view layer via the interface function.
  • the step of the view layer performing corresponding view switching or displaying according to the received data change message includes:
  • the view layer receives the data change message, invokes the interface function, and performs corresponding view switching or presentation logic in the interface function.
  • the data layer detects a data change of the target data point, and generates a data change message, including:
  • the data layer periodically detects and records the data value of the target data point, and generates data change information when the current data value of the target data point is currently detected to be inconsistent with the last recorded data value;
  • the data change information is generated.
  • the method further includes:
  • the view layer registers the target data points to be listened to by the register function.
  • Another object of the present disclosure is to provide a data notification apparatus, which is applied to a software model, the software model includes a data layer and a view layer, the data layer is configured to perform data processing and conversion, and the view layer is configured to be configured according to The data in the data layer is displayed in a software view; the device includes:
  • the detecting unit is configured to detect a data change of the target data point in the data layer, and generate a data change message
  • a notification unit configured to send the data change message to a view layer that registers to listen for changes in the target data point
  • the display unit is configured to perform corresponding view switching or display according to the received data change message in the view layer.
  • the software model includes a set of listeners, and the plurality of view layers monitor changes of the target data points through the set of the listeners; the notification unit How data change messages are sent to the view layer, including:
  • the notification unit traverses the set of listeners, and sends the data change message to a view layer that registers to listen for changes in the target data point.
  • each of the listeners is configured with a corresponding priority level
  • the notification unit traverses the set of the listeners, and sends the data change message to a view that registers to listen to changes of the target data point.
  • Layers including:
  • the notification unit traverses from the highest priority listener to the lowest priority listener in the set of listeners according to the priority level of the respective listeners in the data layer, and changes the data
  • the information is sent to the view layer that is registered to listen for changes in the target data point.
  • the listener is an interface protocol between the data layer and the view layer, and the interface protocol includes an interface function;
  • the notification unit sends the data change message The way to send to the view layer, including:
  • the notification unit sends a data change message to the view layer through the interface function.
  • the manner in which the display unit performs corresponding view switching or display includes:
  • the display unit receives the data change message, invokes the interface function, and performs corresponding view switching or presentation logic in the interface function.
  • the detecting unit detects a data change of the target data point in the data layer, and generates a data change message, including:
  • the detecting unit generates data change information when receiving a data change event for the target data point in the data layer;
  • the detecting unit periodically detects and records the data value of the target data point in the data layer, and generates data change information when the current data value of the target data point is currently detected to be inconsistent with the last recorded data value; or
  • the detecting unit generates data change information when the data value of the target data point is detected in the data layer to be changed from the first preset value to the second preset value.
  • the device further includes:
  • the registration unit is configured to register, by the register function, the target data point to be monitored for the view layer.
  • Another object of the present disclosure is to provide a readable storage medium including a computer program that, when executed, controls an electronic device in which the readable storage medium is located to execute the data notification method.
  • the data notification method, apparatus and readable storage medium provided by the present disclosure omits a control layer in a software MVC model, and reduces the MVC model into a data layer and a view layer, the data layer being configured to perform data processing and conversion,
  • the view layer is configured to display the software view based on the data in the data layer. Obtaining a change of the target data point through the data layer, and notifying the registration to listen to the view layer of the target data point change, so that the view layer performs corresponding view display or switching according to the change of the target data point. In this way, the coupling relationship between software levels is reduced, and the scalability and maintainability of the software are improved.
  • FIG. 1 is a schematic diagram of an electronic device according to an embodiment of the present disclosure
  • FIG. 2 is a schematic flowchart of steps of a data notification method according to an embodiment of the present disclosure
  • FIG. 3 is a schematic diagram of a data notification apparatus according to an embodiment of the present disclosure.
  • FIG. 4 is a second schematic diagram of a data notification apparatus according to an embodiment of the present disclosure.
  • Icons 100-electronic device; 110-data notification device; 111-detection unit; 112-notification unit; 113-display unit; 114-registration unit; 120-memory; 130-processor.
  • FIG. 1 is a block diagram of an electronic device 100 according to an embodiment of the present disclosure.
  • the electronic device 100 includes a data notification device 110, a memory 120, and a processor 130.
  • the memory 120 and the processor 130 are electrically connected directly or indirectly to each other to implement data transmission or interaction.
  • the components can be electrically connected to one another via one or more communication buses or signal lines.
  • the data notification device 110 includes at least one software function module that can be stored in the memory 120 or in an operating system (OS) of the electronic device 100 in the form of software or firmware.
  • the processor 130 is configured to execute executable modules stored in the memory 120, such as software function modules, computer programs, and the like included in the data notification device 110.
  • the memory 120 may be, but not limited to, a random access memory (RAM), a read only memory (ROM), and a programmable read-only memory (PROM). Erasable Programmable Read-Only Memory (EPROM), Electric Erasable Programmable Read-Only Memory (EEPROM), and the like.
  • RAM random access memory
  • ROM read only memory
  • PROM programmable read-only memory
  • EPROM Erasable Programmable Read-Only Memory
  • EEPROM Electric Erasable Programmable Read-Only Memory
  • the memory 120 is configured to store a program, and the processor 130 executes the program after receiving an execution instruction.
  • the processor 130 may be an integrated circuit chip with signal processing capabilities.
  • the above processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; or may be a digital signal processor (DSP), an application specific integrated circuit (ASIC) ), Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components.
  • DSP digital signal processor
  • ASIC application specific integrated circuit
  • FPGA Field Programmable Gate Array
  • the general purpose processor may be a microprocessor or the processor or any conventional processor or the like.
  • the electronic device 100 includes a software model, where the software model includes a data layer and a view layer, wherein the data layer is configured to perform data processing and conversion, and the view layer is configured to be configured according to The data in the data layer is displayed in a software view.
  • FIG. 2 is a flowchart of a data notification method applied to the software model. The method includes the following steps.
  • step S110 the data layer detects data change of the target data point, and generates a data change message.
  • the software model is a new software model formed by removing the control layer from the MVC model. Since the control layer in the MVC hierarchy is removed from the software model, the original control layer is The data processing business logic is transferred to the data layer for processing, that is, the data layer is mainly responsible for the work of two parts, one is the data change acquisition of the target data point, and the second is to convert the data into the view layer.
  • the required data format that is, the data change information sent by the data layer to the view layer is the information after the format conversion.
  • the data change message of the data is subsequently sent to the view layer through step S120.
  • the target data point can be understood as a variable that needs to be monitored, and the data layer monitors the target data point in real time to detect the target data point, and the data of the target data point is detected to be changed.
  • a data change message is generated and sent to the view layer.
  • the data change of the target data point may be detected by: when the data layer receives the data change event for the target data point, generating data change information. For example, when the data of the target data point is changed, a data change event indicating data change is sent to the data layer, and the data change event may be a change command or data change prompt information, etc., and the data layer receives the data. After a data change event, if the data of the target data point has been changed, a data change information is generated and sent to the view layer.
  • the data change of the target data point may be detected by: the data layer periodically detecting and recording the data value of the target data point, and currently detecting the current data value of the target data point and the last recorded When the data values do not match, data change information is generated.
  • the data layer periodically detects the data value of the target data point, for example, the period is 1 s, and the data layer interval detects the target data point by 1 s, if the target data point is detected and recorded in the last second.
  • the data value is 1, and the data value of the target data point detected in this second is 2, indicating that the current data value of the target data point is inconsistent with the last recorded data value, that is, the data of the target data point is changed.
  • the data change of the target data point may be detected by: when the data layer detects that the data value of the target data point is changed from the first preset value to the second preset value, the data change information is generated.
  • the first preset value is 0, and the second preset value is 1.
  • the first preset value and the second preset value may be defined according to requirements, when the data layer detects that the data of the target data point changes from 0 to 0. When it is 1, it means that the data of the target data point has changed, and a data change information is generated and sent to the view layer.
  • Step S120 the data layer sends the data change message to a view layer that registers to monitor the change of the target data point.
  • the software model includes a set of listeners, and the plurality of view layers monitor changes of the target data points through the set of the listeners.
  • a listener in order to reduce the hierarchical relationship and remove the control layer, a listener is designed in the software model.
  • the listener In order to solve a plurality of application scenarios in which the view layer monitors changes of the same target data point, the listener is designed in the form of a set, such that the plurality of view layers monitor the target data through the set of the listeners. With the change of the point, it is possible to save the listening requests of multiple view layers in the set of the listeners.
  • the data layer traverses the set of the listeners, and sends the data change message to a view layer that registers to listen to the change of the target data point. That is to say, one view layer monitors the target data point through multiple listeners, and the view layer is associated with a plurality of corresponding listeners of the intercept target data point in advance, thereby generating data change information after the data layer is generated.
  • the set of listeners is traversed to find a suitable listener to send data change information to the view layer.
  • each of the listeners is configured with a corresponding priority level
  • the data layer may further select a priority from the highest priority listener in the set of listeners according to the priority level of the respective listeners.
  • the lowest listener traverses and sends the data change information to a view layer that registers to listen for changes in the target data point. For example, when the data is changed, the data change information may be sequentially transmitted according to the priority of the listener, that is, the listener with a high priority is called first, and is used to send the data change information.
  • the listener is an interface protocol between the data layer and the view layer, and the interface protocol includes an interface function, for example, in the embodiment of the present disclosure.
  • an interface function of onXXXDataChange is designed (where XXX represents the name of the software model).
  • XXX represents the name of the software model.
  • a form of an interface is designed inside each software model to expose a data change message inside the data layer, thereby effectively reducing the coupling relationship between the data layer and the view layer, and improving the software. Scalability and maintainability.
  • Step S130 the view layer performs corresponding view switching or display according to the received data change message.
  • the logic of the switching view performed by the control layer is transplanted to the view layer, and the trigger condition of the switching view is changed to the data change message of the data layer to perform corresponding triggering.
  • Each view in the view layer is configured to carry a part of data.
  • the view interface needs to be exposed in the view layer, and then the target data point to be monitored is registered in the view layer by calling the register function.
  • the software model is thus able to obtain the reference relationship of the view layer.
  • the view layer receives the data change information of the data layer by rewriting the interface function.
  • the view layer needs to listen to multiple target data points, it is necessary to implement a corresponding interface for each target data point, and establish a relationship between the view layer and the data layer, so that the view layer passes The interface acquires data change information sent by the data layer.
  • the view layer receives the data change message, invokes the interface function, and performs corresponding view switching or presentation logic in the interface function.
  • the data layer has established an association with the view layer through an interface. Since the view layer has previously registered the intercept target data point, when receiving the data change message, the view layer actively triggers the onXXXDataChange function to execute the corresponding view switch or display logic in the onXXXDataChange function.
  • an embodiment of the present disclosure further provides a data notification apparatus 110, which is applied to the electronic device 100 shown in FIG. 1.
  • the electronic device 100 includes a software model, and the software model includes a data layer and a view.
  • a layer the data layer configured to perform data processing and conversion, the view layer being configured to perform a presentation of the software view based on data in the data layer.
  • the device includes a display unit 113, a notification unit 112, and a display unit 113.
  • the detecting unit 111 is configured to detect a data change of the target data point in the data layer to generate a data change message.
  • the detecting unit 111 may be configured to perform step S110 shown in FIG. 2, and the description of the step S110 may be referred to with a specific description of the detecting unit 111.
  • the notification unit 112 is configured to send the data change message to a view layer that registers to listen for changes in the target data point.
  • the notification unit 112 may be configured to perform step S120 shown in FIG. 2, and the description of the step S120 may be referred to with a specific description of the notification unit 112.
  • the software model includes a set of listeners, and the plurality of view layers monitor changes of the target data points through the set of the listeners.
  • the manner in which the notification unit 112 sends the data change message to the view layer includes:
  • the notification unit 112 traverses the set of listeners, and sends the data change message to a view layer that registers to listen for changes in the target data point.
  • each of the listeners is configured with a corresponding priority level
  • the notification unit 112 traverses the set of the listeners, and sends the data change message to register to listen to the target data point.
  • Changing view layers including:
  • the notification unit 112 traverses from the highest priority listener to the lowest priority listener in the set of listeners according to the priority level of the respective listeners in the data layer, and the data is traversed.
  • the change information is sent to the view layer that is registered to listen for changes in the target data point.
  • the listener is an interface protocol between the data layer and the view layer, and the interface protocol includes an interface function;
  • the notification unit 112 The way data change messages are sent to the view layer includes:
  • the notification unit 112 sends a data change message to the view layer through the interface function.
  • the display unit 113 is configured to perform corresponding view switching or display according to the received data change message in the view layer.
  • the display unit 113 may be configured to perform step S130 shown in FIG. 2, and the description of the step S130 may be referred to with a specific description of the display unit 113.
  • the manner in which the display unit 113 performs corresponding view switching or display includes:
  • the view layer receives the data change message, invokes the interface function, and performs corresponding view switching or presentation logic in the interface function.
  • the detecting unit 111 detects a data change of the target data point in the data layer, and generates a data change message, including:
  • the detecting unit 111 generates data change information when receiving a data change event for the target data point in the data layer; or
  • the detecting unit 111 periodically detects and records the data value of the target data point in the data layer, and generates data change information when the current data value of the target data point is detected to be inconsistent with the last recorded data value; or
  • the detecting unit 111 generates data change information when detecting that the data value of the target data point is changed from the first preset value to the second preset value in the data layer.
  • the apparatus further includes a registration unit 114.
  • the registration unit 114 is configured to register, by the register function, the target data point that needs to be monitored for the view layer.
  • an embodiment of the present disclosure further provides a readable storage medium, the readable storage medium comprising a computer program, the computer program controlling the electronic device where the readable storage medium is located to execute the data notification method.
  • the data notification method, apparatus, and readable storage medium omit the control layer in the software MVC model, and simplify the MVC model into a data layer and a view layer, and the data layer is configured to perform data processing. And converting, the view layer is configured to perform a presentation of the software view based on data in the data layer. Obtaining a change of the target data point through the data layer, and notifying the registration to listen to the view layer of the target data point change, so that the view layer performs corresponding view display or switching according to the change of the target data point. In this way, the coupling relationship between software levels is reduced, and the scalability and maintainability of the software are improved.
  • each block of the flowchart or block diagram can represent a module, a program segment, or a portion of code that comprises one or more of the Executable instructions. It should also be noted that, in some alternative implementations, the functions noted in the blocks may also occur in a different order than those illustrated in the drawings.
  • each block of the block diagrams and/or flowcharts, and combinations of blocks in the block diagrams and/or flowcharts can be implemented in a dedicated hardware-based system that performs the specified function or function. Or it can be implemented by a combination of dedicated hardware and computer instructions.
  • each functional module in various embodiments of the present disclosure may be integrated to form a separate part, or each module may exist separately, or two or more modules may be integrated to form a separate part.
  • the functions, if implemented in the form of software functional modules and sold or used as separate products, may be stored in a computer readable storage medium.
  • a computer readable storage medium including: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like.
  • the data notification method, apparatus and readable storage medium omits the control layer in the software MVC model, and the MVC model is simplified into a data layer and a view layer, and the data layer is configured to perform data processing and conversion.
  • the view layer is configured to perform a presentation of a software view based on data in the data layer. Obtaining a change of the target data point through the data layer, and notifying the registration to listen to the view layer of the target data point change, so that the view layer performs corresponding view display or switching according to the change of the target data point. In this way, the coupling relationship between software levels is reduced, and the scalability and maintainability of the software are improved.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

An embodiment of the disclosure provides a data notification method, device and a readable storage medium applicable to a software model; the software model comprises a data layer and a view layer, wherein the data layer is configured to perform data processing and conversion, and the view layer is configured to display a software view according to data in the data layer. The method comprises: the data layer detecting a data change of a target data point and generating a data change message; the data layer sending the data change message to a view layer registered to monitor for a change of the target data point; and the view layer performing corresponding view switching or displaying according to the data change message received thereby. By acquiring a change of the target data point by means of the data layer and notifying the view layer registered to monitor for a change of the target data point, the view layer is able to perform corresponding view displaying or switching according to the change of the target data point. As a result, coupling relationships between software layers are reduced, increasing the expandability and maintainability of software.

Description

数据通知方法、装置及可读存储介质Data notification method, device and readable storage medium
相关申请的交叉引用Cross-reference to related applications
本申请要求于2017年05月02日提交中国专利局的申请号为201710301939.5名称为“数据通知方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。The present application claims priority to Chinese Patent Application No. JP-A No. No. No. No. No. No. No. No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No
技术领域Technical field
本公开涉及软件数据模型设计技术领域,具体而言,涉及一种数据通知方法、装置及可读存储介质。The present disclosure relates to the technical field of software data model design, and in particular, to a data notification method, apparatus, and readable storage medium.
背景技术Background technique
现有技术的软件开发设计中,通常采用MVC(Model-View-Controller,模型(Model)-视图(view)-控制(controller))框架进行软件模型的设计,其中,模型(Model)层负责数据的数据工作,视图(View)层负责视图的展示工作,控制(Controller)层负责将模型层的数据传输到视图层并控制视图层进行相应的展示。但是,在现有技术的软件模型中,模型层和视图层需要通过控制层相耦合,从而导致控制层增加了层级之间的耦合关系,使模型层和视图层的业务逻辑非常复杂,并且控制层还耦合了一些业务逻辑的实现,影响了软件的扩展性,不方便软件代码的维护。In the software development design of the prior art, the MVC (Model-View-Controller, Model-View-controller) framework is usually used to design the software model, wherein the Model layer is responsible for the data. The data work, the view layer is responsible for the display of the view, the control (Controller) layer is responsible for transferring the data of the model layer to the view layer and controlling the view layer to display accordingly. However, in the prior art software model, the model layer and the view layer need to be coupled through the control layer, which causes the control layer to increase the coupling relationship between the layers, so that the business logic of the model layer and the view layer is very complicated and controlled. The layer is also coupled with the implementation of some business logic, which affects the scalability of the software and is inconvenient for the maintenance of the software code.
发明内容Summary of the invention
为了克服现有技术中的上述至少一种不足,本公开的目的包括,提供一种数据通知方法,应用于软件模型,所述软件模型包括数据层及视图层,所述数据层配置成进行数据处理和转化,所述视图层配置成根据所述数据层中的数据进行软件视图的展示;所述方法包括:In order to overcome at least one of the above-mentioned deficiencies in the prior art, an object of the present disclosure includes providing a data notification method, which is applied to a software model, the software model including a data layer and a view layer, the data layer configured to perform data Processing and converting, the view layer being configured to perform display of a software view according to data in the data layer; the method comprising:
所述数据层检测目标数据点的数据变更,生成数据变更消息;The data layer detects data changes of the target data point to generate a data change message;
所述数据层将所述数据变更消息发送到注册监听该目标数据点变化的视图层;The data layer sends the data change message to a view layer that registers to listen for changes in the target data point;
所述视图层根据接收到的数据变更消息进行相应的视图切换或展示。The view layer performs corresponding view switching or presentation according to the received data change message.
可选地,在上述方法中,所述软件模型中包括一监听器的集合,多个所述视图层通过所述监听器的集合监听所述目标数据点的变化;所述数据层将所述数据变更消息发送到注册监听该目标数据点变化的视图层的步骤,包括:Optionally, in the above method, the software model includes a set of listeners, and the plurality of view layers monitor changes of the target data points through the set of listeners; the data layer will The step of sending a data change message to the view layer that registers the change of the target data point includes:
所述数据层遍历所述监听器的集合,将所述数据变更消息发送到注册监听该目标数据点变化的视图层。The data layer traverses the set of listeners, and sends the data change message to a view layer that registers to listen for changes in the target data point.
可选地,在上述方法中,各个所述监听器配置有相应的优先等级,所述数据层遍历所述监听器的集合,将所述数据变更消息发送到注册监听该目标数据点变化的视图层, 包括:Optionally, in the foregoing method, each of the listeners is configured with a corresponding priority level, and the data layer traverses the set of the listeners, and sends the data change message to a view that registers to listen to changes of the target data point. Layer, including:
所述数据层根据所述各个监听器的优先等级,在所述监听器的集合中从优先等级最高的监听器向优先等级最低的监听器进行遍历,将所述数据变更信息发送到注册监听该目标数据点变化的视图层。The data layer traverses from the highest priority listener to the lowest priority listener in the set of listeners according to the priority level of the respective listeners, and sends the data change information to the registration monitor. The view layer of the target data point change.
可选地,在上述方法中,所述监听器为一所述数据层与所述视图层之间的接口协议,所述接口协议中包括一接口函数;所述将所述数据变更消息发送到注册监听了该目标数据点变化的视图层的步骤,包括:Optionally, in the above method, the listener is an interface protocol between the data layer and the view layer, and the interface protocol includes an interface function; the sending the data change message to The steps to register the view layer that listens for changes to the target data point, including:
所述数据层通过所述接口函数将数据变更消息发送给所述视图层。The data layer sends a data change message to the view layer via the interface function.
可选地,在上述方法中,所述视图层根据接收到的数据变更消息进行相应的视图切换或展示的步骤,包括:Optionally, in the foregoing method, the step of the view layer performing corresponding view switching or displaying according to the received data change message includes:
所述视图层接收所述数据变更消息,调用所述接口函数,执行所述接口函数中相应的视图切换或展示逻辑。The view layer receives the data change message, invokes the interface function, and performs corresponding view switching or presentation logic in the interface function.
可选地,在上述方法中,所述数据层检测目标数据点的数据变更,生成数据变更消息,包括:Optionally, in the foregoing method, the data layer detects a data change of the target data point, and generates a data change message, including:
所述数据层接收到针对目标数据点的数据变更事件时,生成数据变更信息;或Generating data change information when the data layer receives a data change event for the target data point; or
所述数据层周期性检测并记录目标数据点的数据值,当前检测到所述目标数据点的当前数据值与上次记录的数据值不一致时,生成数据变更信息;或者The data layer periodically detects and records the data value of the target data point, and generates data change information when the current data value of the target data point is currently detected to be inconsistent with the last recorded data value; or
所述数据层检测到目标数据点的数据值从第一预设值变更为第二预设值时,生成数据变更信息。When the data layer detects that the data value of the target data point is changed from the first preset value to the second preset value, the data change information is generated.
可选地,在上述方法中,所述方法还包括:Optionally, in the above method, the method further includes:
所述视图层通过register函数注册需要监听的目标数据点。The view layer registers the target data points to be listened to by the register function.
本公开的另一目的在于提供一种数据通知装置,应用于软件模型,所述软件模型包括数据层及视图层,所述数据层配置成进行数据处理和转化,所述视图层配置成根据所述数据层中的数据进行软件视图的展示;所述装置包括:Another object of the present disclosure is to provide a data notification apparatus, which is applied to a software model, the software model includes a data layer and a view layer, the data layer is configured to perform data processing and conversion, and the view layer is configured to be configured according to The data in the data layer is displayed in a software view; the device includes:
检测单元,配置成在数据层中检测目标数据点的数据变更,生成数据变更消息;The detecting unit is configured to detect a data change of the target data point in the data layer, and generate a data change message;
通知单元,配置成将所述数据变更消息发送到注册监听该目标数据点变化的视图层;a notification unit configured to send the data change message to a view layer that registers to listen for changes in the target data point;
显示单元,配置成在视图层中根据接收到的数据变更消息进行相应的视图切换或展示。The display unit is configured to perform corresponding view switching or display according to the received data change message in the view layer.
可选地,在上述装置中,所述软件模型中包括一监听器的集合,多个所述视图层通过所述监听器的集合监听所述目标数据点的变化;所述通知单元将所述数据变更消息发送到视图层的方式,包括:Optionally, in the above apparatus, the software model includes a set of listeners, and the plurality of view layers monitor changes of the target data points through the set of the listeners; the notification unit How data change messages are sent to the view layer, including:
所述通知单元遍历所述监听器的集合,将所述数据变更消息发送到注册监听该目标数据点变化的视图层。The notification unit traverses the set of listeners, and sends the data change message to a view layer that registers to listen for changes in the target data point.
可选地,在上述装置中,各个所述监听器配置有相应的优先等级,所述通知单元遍历所述监听器的集合,将所述数据变更消息发送到注册监听该目标数据点变化的视图层,包括:Optionally, in the foregoing apparatus, each of the listeners is configured with a corresponding priority level, and the notification unit traverses the set of the listeners, and sends the data change message to a view that registers to listen to changes of the target data point. Layers, including:
所述通知单元在所述数据层中根据所述各个监听器的优先等级,在所述监听器的集合中从优先等级最高的监听器向优先等级最低的监听器进行遍历,将所述数据变更信息发送到注册监听该目标数据点变化的视图层。The notification unit traverses from the highest priority listener to the lowest priority listener in the set of listeners according to the priority level of the respective listeners in the data layer, and changes the data The information is sent to the view layer that is registered to listen for changes in the target data point.
可选地,在上述装置中,所述监听器为一所述数据层与所述视图层之间的接口协议,所述接口协议中包括一接口函数;所述通知单元将所述数据变更消息发送到视图层的方式,包括:Optionally, in the foregoing apparatus, the listener is an interface protocol between the data layer and the view layer, and the interface protocol includes an interface function; the notification unit sends the data change message The way to send to the view layer, including:
所述通知单元通过所述接口函数将数据变更消息发送给所述视图层。The notification unit sends a data change message to the view layer through the interface function.
可选地,在上述装置中,所述显示单元进行相应的视图切换或展示的方式,包括:Optionally, in the foregoing apparatus, the manner in which the display unit performs corresponding view switching or display includes:
所述显示单元接收所述数据变更消息,调用所述接口函数,执行所述接口函数中相应的视图切换或展示逻辑。The display unit receives the data change message, invokes the interface function, and performs corresponding view switching or presentation logic in the interface function.
可选地,在上述装置中,所述检测单元在数据层中检测目标数据点的数据变更,生成数据变更消息,包括:Optionally, in the foregoing apparatus, the detecting unit detects a data change of the target data point in the data layer, and generates a data change message, including:
所述检测单元在所述数据层中接收到针对目标数据点的数据变更事件时,生成数据变更信息;或The detecting unit generates data change information when receiving a data change event for the target data point in the data layer; or
所述检测单元在所述数据层中周期性检测并记录目标数据点的数据值,当前检测到所述目标数据点的当前数据值与上次记录的数据值不一致时,生成数据变更信息;或者The detecting unit periodically detects and records the data value of the target data point in the data layer, and generates data change information when the current data value of the target data point is currently detected to be inconsistent with the last recorded data value; or
所述检测单元在所述数据层中检测到目标数据点的数据值从第一预设值变更为第二预设值时,生成数据变更信息。The detecting unit generates data change information when the data value of the target data point is detected in the data layer to be changed from the first preset value to the second preset value.
可选地,在上述装置中,所述装置还包括:Optionally, in the above device, the device further includes:
注册单元,配置成通过register函数为所述视图层注册需要监听的目标数据点。The registration unit is configured to register, by the register function, the target data point to be monitored for the view layer.
本公开的另一目的在于提供一种可读存储介质,所述可读存储介质包括计算机程序,所述计算机程序运行时控制所述可读存储介质所在电子设备执行所述数据通知方法。Another object of the present disclosure is to provide a readable storage medium including a computer program that, when executed, controls an electronic device in which the readable storage medium is located to execute the data notification method.
相对于现有技术而言,本公开包括以下有益效果:The present disclosure includes the following beneficial effects with respect to the prior art:
本公开提供的数据通知方法、装置及可读存储介质,在软件MVC模型中省略了控制层,将MVC模型简化为数据层和视图层,所述数据层配置成进行数据处理和转化,所述视图层配置成根据所述数据层中的数据进行软件视图的展示。通过数据层获取目标数据点的变化,并通知注册监听该目标数据点变化的视图层,使视图层根据所述目标数据点的变化进行相应的视图展示或切换。如此,减少了软件层级之间的耦合关系,提高了软件的扩展性 和可维护性。The data notification method, apparatus and readable storage medium provided by the present disclosure omits a control layer in a software MVC model, and reduces the MVC model into a data layer and a view layer, the data layer being configured to perform data processing and conversion, The view layer is configured to display the software view based on the data in the data layer. Obtaining a change of the target data point through the data layer, and notifying the registration to listen to the view layer of the target data point change, so that the view layer performs corresponding view display or switching according to the change of the target data point. In this way, the coupling relationship between software levels is reduced, and the scalability and maintainability of the software are improved.
附图说明DRAWINGS
为了更清楚地说明本公开实施例的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,应当理解,以下附图仅示出了本公开的某些实施例,因此不应被看作是对范围的限定,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他相关的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings to be used in the embodiments will be briefly described below. It should be understood that the following drawings show only certain embodiments of the present disclosure, and thus It should be seen as a limitation on the scope, and those skilled in the art can obtain other related drawings according to these drawings without any creative work.
图1为本公开实施例提供的电子设备的示意图;FIG. 1 is a schematic diagram of an electronic device according to an embodiment of the present disclosure;
图2为本公开实施例提供的数据通知方法的步骤流程示意图;2 is a schematic flowchart of steps of a data notification method according to an embodiment of the present disclosure;
图3为本公开实施例提供的数据通知装置的示意图之一;FIG. 3 is a schematic diagram of a data notification apparatus according to an embodiment of the present disclosure;
图4为本公开实施例提供的数据通知装置的示意图之二。FIG. 4 is a second schematic diagram of a data notification apparatus according to an embodiment of the present disclosure.
图标:100-电子设备;110-数据通知装置;111-检测单元;112-通知单元;113-显示单元;114-注册单元;120-存储器;130-处理器。Icons: 100-electronic device; 110-data notification device; 111-detection unit; 112-notification unit; 113-display unit; 114-registration unit; 120-memory; 130-processor.
具体实施方式detailed description
为使本公开实施例的目的、技术方案和优点更加清楚,下面将结合本公开实施例中的附图,对本公开实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本公开一部分实施例,而不是全部的实施例。通常在此处附图中描述和示出的本公开实施例的组件可以以各种不同的配置来布置和设计。The technical solutions in the embodiments of the present disclosure will be clearly and completely described in conjunction with the drawings in the embodiments of the present disclosure. It is a partial embodiment of the present disclosure, and not all of the embodiments. The components of the disclosed embodiments, which are generally described and illustrated in the figures herein, can be arranged and designed in various different configurations.
因此,以下对在附图中提供的本公开的实施例的详细描述并非旨在限制要求保护的本公开的范围,而是仅仅表示本公开的选定实施例。基于本公开中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本公开保护的范围。The detailed description of the embodiments of the present disclosure, which is set forth in the claims All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present disclosure without departing from the inventive scope are the scope of the disclosure.
应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步定义和解释。It should be noted that similar reference numerals and letters indicate similar items in the following figures, and therefore, once an item is defined in a drawing, it is not necessary to further define and explain it in the subsequent drawings.
在本公开的描述中,需要说明的是,术语“第一”、“第二”、“第三”等仅用于区分描述,而不能理解为指示或暗示相对重要性。In the description of the present disclosure, it is to be noted that the terms "first", "second", "third", and the like are used merely to distinguish a description, and are not to be construed as indicating or implying a relative importance.
在本公开的描述中,还需要说明的是,除非另有明确的规定和限定,术语“设置”、“安装”、“相连”、“连接”应做广义理解,例如,可以是固定连接,也可以是可拆卸连接,或一体地连接;可以是机械连接,也可以是电连接;可以是直接相连,也可以通过中间媒介间接相连,可以是两个元件内部的连通。对于本领域的普通技术人员而言,可以具体情况理解上述术语在本公开中的具体含义。In the description of the present disclosure, it should be further noted that the terms "set", "install", "connected", and "connected" are to be understood broadly, and may be fixed connections, for example, unless otherwise specifically defined and defined. It can also be a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be directly connected or indirectly connected through an intermediate medium, and can be internal communication between the two elements. The specific meanings of the above terms in the present disclosure can be understood in the specific circumstances by those skilled in the art.
请参照图1,图1为本公开实施例提供的电子设备100的方框示意图。所述电子设备100包括数据通知装置110、存储器120及处理器130。Please refer to FIG. 1 , which is a block diagram of an electronic device 100 according to an embodiment of the present disclosure. The electronic device 100 includes a data notification device 110, a memory 120, and a processor 130.
所述存储器120以及处理器130相互之间直接或间接地电性连接,以实现数据的传输 或交互。例如,这些元件相互之间可通过一条或多条通讯总线或信号线实现电性连接。所述数据通知装置110包括至少一个可以软件或固件(firmware)的形式存储于所述存储器120中或固化在所述电子设备100的操作系统(operating system,OS)中的软件功能模块。所述处理器130配置成执行所述存储器120中存储的可执行模块,例如所述数据通知装置110所包括的软件功能模块及计算机程序等。The memory 120 and the processor 130 are electrically connected directly or indirectly to each other to implement data transmission or interaction. For example, the components can be electrically connected to one another via one or more communication buses or signal lines. The data notification device 110 includes at least one software function module that can be stored in the memory 120 or in an operating system (OS) of the electronic device 100 in the form of software or firmware. The processor 130 is configured to execute executable modules stored in the memory 120, such as software function modules, computer programs, and the like included in the data notification device 110.
其中,所述存储器120可以是,但不限于,随机存取存储器(Random Access Memory,RAM),只读存储器(Read Only Memory,ROM),可编程只读存储器(Programmable Read-Only Memory,PROM),可擦除只读存储器(Erasable Programmable Read-Only Memory,EPROM),电可擦除只读存储器(Electric Erasable Programmable Read-Only Memory,EEPROM)等。其中,存储器120配置成存储程序,所述处理器130在接收到执行指令后,执行所述程序。The memory 120 may be, but not limited to, a random access memory (RAM), a read only memory (ROM), and a programmable read-only memory (PROM). Erasable Programmable Read-Only Memory (EPROM), Electric Erasable Programmable Read-Only Memory (EEPROM), and the like. The memory 120 is configured to store a program, and the processor 130 executes the program after receiving an execution instruction.
所述处理器130可能是一种集成电路芯片,具有信号的处理能力。上述的处理器可以是通用处理器,包括中央处理器(Central Processing Unit,CPU)、网络处理器(Network Processor,NP)等;还可以是数字信号处理器(DSP))、专用集成电路(ASIC)、现场可编程门阵列(FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本公开实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The processor 130 may be an integrated circuit chip with signal processing capabilities. The above processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; or may be a digital signal processor (DSP), an application specific integrated circuit (ASIC) ), Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components. The methods, steps, and logical block diagrams disclosed in the embodiments of the present disclosure may be implemented or carried out. The general purpose processor may be a microprocessor or the processor or any conventional processor or the like.
在本公开实施例中,所述电子设备100中包括一软件模型,所述软件模型包括数据层及视图层,其中,所述数据层配置成进行数据处理和转化,所述视图层配置成根据所述数据层中的数据进行软件视图的展示。In the embodiment of the present disclosure, the electronic device 100 includes a software model, where the software model includes a data layer and a view layer, wherein the data layer is configured to perform data processing and conversion, and the view layer is configured to be configured according to The data in the data layer is displayed in a software view.
请参照图2,图2为应用于所述软件模型的一种数据通知方法的流程图,以下将对所述方法包括各个步骤进行详细阐述。Please refer to FIG. 2. FIG. 2 is a flowchart of a data notification method applied to the software model. The method includes the following steps.
步骤S110,所述数据层检测目标数据点的数据变更,生成数据变更消息。In step S110, the data layer detects data change of the target data point, and generates a data change message.
在本公开实施例中,所述软件模型为上述MVC模型中去掉了控制层而形成的新的软件模型,由于从所述软件模型中去掉了MVC层级中的控制层,所以原来在控制层对数据的处理业务逻辑转移到了数据层来进行处理了,即,所述数据层主要负责两个部分的工作,其一是对目标数据点的数据变更获取,其次是将数据转换成所述视图层需要的数据格式,也就是数据层发送给视图层的数据变更信息为进行格式转换后的信息。In the embodiment of the present disclosure, the software model is a new software model formed by removing the control layer from the MVC model. Since the control layer in the MVC hierarchy is removed from the software model, the original control layer is The data processing business logic is transferred to the data layer for processing, that is, the data layer is mainly responsible for the work of two parts, one is the data change acquisition of the target data point, and the second is to convert the data into the view layer. The required data format, that is, the data change information sent by the data layer to the view layer is the information after the format conversion.
当数据层完成原始数据的获取并转换后,接下来通过步骤S120将数据的数据变更消息发送到视图层中。After the data layer completes the acquisition and conversion of the original data, the data change message of the data is subsequently sent to the view layer through step S120.
其中,所述目标数据点可以理解为是类似需要监控的一个变量,所述数据层对目标数据点进行实时监控,以对所述目标数据点进行检测,在检测到目标数据点的数据发生变更 时,生成一数据变更消息发送至视图层。The target data point can be understood as a variable that needs to be monitored, and the data layer monitors the target data point in real time to detect the target data point, and the data of the target data point is detected to be changed. A data change message is generated and sent to the view layer.
另外,可选地,对目标数据点的数据变更进行检测的方式可以为:所述数据层接收到针对目标数据点的数据变更事件时,生成数据变更信息。例如,在目标数据点的数据发生变更时,向数据层发送一表示数据变更的数据变更事件,数据变更事件可以为一变更指令,或者为数据变更提示信息等,则所述数据层接收到这一数据变更事件后,知晓该目标数据点的数据已发生变更,则生成一数据变更信息发送至视图层。In addition, optionally, the data change of the target data point may be detected by: when the data layer receives the data change event for the target data point, generating data change information. For example, when the data of the target data point is changed, a data change event indicating data change is sent to the data layer, and the data change event may be a change command or data change prompt information, etc., and the data layer receives the data. After a data change event, if the data of the target data point has been changed, a data change information is generated and sent to the view layer.
或者,对目标数据点的数据变更进行检测的方式还可以为:所述数据层周期性检测并记录目标数据点的数据值,当前检测到所述目标数据点的当前数据值与上次记录的数据值不一致时,生成数据变更信息。例如,所述数据层对目标数据点的数据值进行周期性的检测,如周期为1s,所述数据层间隔1s对目标数据点进行检测,若在上一秒检测并记录到目标数据点的数据值为1,这一秒检测到目标数据点的数据值为2,则表示所述目标数据点的当前数据值与上次记录的数据值不一致,即目标数据点的数据发生了变更,则生成一数据变更信息发送至视图层。Alternatively, the data change of the target data point may be detected by: the data layer periodically detecting and recording the data value of the target data point, and currently detecting the current data value of the target data point and the last recorded When the data values do not match, data change information is generated. For example, the data layer periodically detects the data value of the target data point, for example, the period is 1 s, and the data layer interval detects the target data point by 1 s, if the target data point is detected and recorded in the last second. The data value is 1, and the data value of the target data point detected in this second is 2, indicating that the current data value of the target data point is inconsistent with the last recorded data value, that is, the data of the target data point is changed. Generate a data change message to send to the view layer.
或者,对目标数据点的数据变更进行检测的方式还可以为:所述数据层检测到目标数据点的数据值从第一预设值变更为第二预设值时,生成数据变更信息。例如,第一预设值为0,第二预设值为1,当然,第一预设值与第二预设值可以根据需要自行定义,当数据层检测到目标数据点的数据从0变为1时,即表示目标数据点的数据发生了变更,则生成一数据变更信息发送至视图层。Alternatively, the data change of the target data point may be detected by: when the data layer detects that the data value of the target data point is changed from the first preset value to the second preset value, the data change information is generated. For example, the first preset value is 0, and the second preset value is 1. Of course, the first preset value and the second preset value may be defined according to requirements, when the data layer detects that the data of the target data point changes from 0 to 0. When it is 1, it means that the data of the target data point has changed, and a data change information is generated and sent to the view layer.
步骤S120,所述数据层将所述数据变更消息发送到注册监听该目标数据点变化的视图层。Step S120, the data layer sends the data change message to a view layer that registers to monitor the change of the target data point.
在本公开实施例中,所述软件模型中包括一监听器的集合,多个所述视图层通过所述监听器的集合监听所述目标数据点的变化。In an embodiment of the present disclosure, the software model includes a set of listeners, and the plurality of view layers monitor changes of the target data points through the set of the listeners.
在本公开实施例中,为了减少层级关系从而去掉控制层,所以在所述软件模型中设计了一监听器。为了解决多个所述视图层监听同一个目标数据点的变化的应用场景,将该监听器设计为一个集合的形式,如此多个所述视图层通过所述监听器的集合监听所述目标数据点的变化,就可以在所述监听器的集合中保存多个视图层的监听请求。In the embodiment of the present disclosure, in order to reduce the hierarchical relationship and remove the control layer, a listener is designed in the software model. In order to solve a plurality of application scenarios in which the view layer monitors changes of the same target data point, the listener is designed in the form of a set, such that the plurality of view layers monitor the target data through the set of the listeners. With the change of the point, it is possible to save the listening requests of multiple view layers in the set of the listeners.
当所述数据层通过步骤S110生成数据变更消息后,所述数据层遍历所述监听器的集合,将所述数据变更消息发送到注册监听该目标数据点变化的视图层。也就是说,一个视图层通过多个监听器对目标数据点进行监听,该视图层预先与监听目标数据点的对应的多个监听器进行关联,由此,在数据层生成数据变更信息后,对所述监听器的集合进行遍历,以查找到合适的监听器,从而将数据变更信息发送至该视图层。After the data layer generates the data change message through step S110, the data layer traverses the set of the listeners, and sends the data change message to a view layer that registers to listen to the change of the target data point. That is to say, one view layer monitors the target data point through multiple listeners, and the view layer is associated with a plurality of corresponding listeners of the intercept target data point in advance, thereby generating data change information after the data layer is generated. The set of listeners is traversed to find a suitable listener to send data change information to the view layer.
可选地,各个所述监听器配置有相应的优先等级,所述数据层还可以根据所述各个监 听器的优先等级,在所述监听器的集合中从优先等级最高的监听器向优先等级最低的监听器进行遍历,将所述数据变更信息发送到注册监听该目标数据点变化的视图层。例如,当数据发生变更时,可以根据监听器的优先级依次发送数据变更信息,即,优先级高的监听器先被调用,用于发送数据变更信息。Optionally, each of the listeners is configured with a corresponding priority level, and the data layer may further select a priority from the highest priority listener in the set of listeners according to the priority level of the respective listeners. The lowest listener traverses and sends the data change information to a view layer that registers to listen for changes in the target data point. For example, when the data is changed, the data change information may be sequentially transmitted according to the priority of the listener, that is, the listener with a high priority is called first, and is used to send the data change information.
可选地,在本公开实施例中,所述监听器为一所述数据层与所述视图层之间的接口协议,所述接口协议中包括一接口函数,例如,在本公开实施例中,在监听器的接口协议中设计了一个onXXXDataChange的接口函数(其中,XXX表示的是软件模型的名称),当所述数据层有数据发生变化时,将数据变更信息通过接口函数onXXXDataChange暴露给视图层,以供所述视图层回调onXXXDataChange接口函数,从而获取到数据层发送的数据变更信息。Optionally, in the embodiment of the present disclosure, the listener is an interface protocol between the data layer and the view layer, and the interface protocol includes an interface function, for example, in the embodiment of the present disclosure. In the interface protocol of the listener, an interface function of onXXXDataChange is designed (where XXX represents the name of the software model). When the data layer has data changes, the data change information is exposed to the view through the interface function onXXXDataChange. a layer for the view layer to call back the onXXXDataChange interface function to obtain data change information sent by the data layer.
基于上述设计,在每一个软件模型内部设计接口的形式来暴露所述数据层内部的数据变更消息,从而有效的降低了所述数据层和所述视图层之间的耦合关系,提高了软件的扩展性和可维护性。Based on the above design, a form of an interface is designed inside each software model to expose a data change message inside the data layer, thereby effectively reducing the coupling relationship between the data layer and the view layer, and improving the software. Scalability and maintainability.
步骤S130,所述视图层根据接收到的数据变更消息进行相应的视图切换或展示。Step S130, the view layer performs corresponding view switching or display according to the received data change message.
在本公开实施例中,由于减少了控制层,故将控制层进行的切换视图的逻辑移植到视图层来实现,并且切换视图的触发条件变更为数据层的数据变更消息来进行相应的触发。In the embodiment of the present disclosure, since the control layer is reduced, the logic of the switching view performed by the control layer is transplanted to the view layer, and the trigger condition of the switching view is changed to the data change message of the data layer to perform corresponding triggering.
所述视图层中每一个视图都是配置成承载一部分数据,在本公开实施例中,所述视图层中需要暴露视图接口,然后再通过调用register函数在视图层注册需要监听的目标数据点,如此所述软件模型就能够获取到所述视图层的引用关系。Each view in the view layer is configured to carry a part of data. In the embodiment of the present disclosure, the view interface needs to be exposed in the view layer, and then the target data point to be monitored is registered in the view layer by calling the register function. The software model is thus able to obtain the reference relationship of the view layer.
由于所述数据层已经定义好数据变更消息的通知接口,故在本公开实施例中,所述视图层通过复写所述接口函数来接收数据层的数据变更信息。但是,如果所述视图层需要监听多个目标数据点,就需要对每一个目标数据点都实现对应的接口,并建立所述视图层与所述数据层之间的关系,以此视图层通过所述接口获取数据层发送的数据变更信息。Since the data layer has defined the notification interface of the data change message, in the embodiment of the present disclosure, the view layer receives the data change information of the data layer by rewriting the interface function. However, if the view layer needs to listen to multiple target data points, it is necessary to implement a corresponding interface for each target data point, and establish a relationship between the view layer and the data layer, so that the view layer passes The interface acquires data change information sent by the data layer.
所述视图层接收所述数据变更消息,调用所述接口函数,执行所述接口函数中相应的视图切换或展示逻辑。The view layer receives the data change message, invokes the interface function, and performs corresponding view switching or presentation logic in the interface function.
例如,通过上述步骤,所述数据层已经和所述视图层通过接口的方式建立起了关联性。所述视图层由于之前已经注册了监听目标数据点,所以在接收到数据变更消息时,所述视图层就会主动回调触发onXXXDataChange函数,执行onXXXDataChange函数中相应的视图切换或展示逻辑。For example, through the above steps, the data layer has established an association with the view layer through an interface. Since the view layer has previously registered the intercept target data point, when receiving the data change message, the view layer actively triggers the onXXXDataChange function to execute the corresponding view switch or display logic in the onXXXDataChange function.
请参照图3,本公开实施例还提供一种数据通知装置110,应用于图1中所示的电子设备100,所述电子设备100中包括一软件模型,所述软件模型包括数据层及视图层,所述数据层配置成进行数据处理和转化,所述视图层配置成根据所述数据层中的数据进行软件 视图的展示。所述装置包括显示单元113、通知单元112及显示单元113。Referring to FIG. 3, an embodiment of the present disclosure further provides a data notification apparatus 110, which is applied to the electronic device 100 shown in FIG. 1. The electronic device 100 includes a software model, and the software model includes a data layer and a view. A layer, the data layer configured to perform data processing and conversion, the view layer being configured to perform a presentation of the software view based on data in the data layer. The device includes a display unit 113, a notification unit 112, and a display unit 113.
所述检测单元111,配置成在数据层中检测目标数据点的数据变更,生成数据变更消息。The detecting unit 111 is configured to detect a data change of the target data point in the data layer to generate a data change message.
在本公开实施例中,所述检测单元111可配置成执行图2所示的步骤S110,关于所述检测单元111的具体描述可参对所述步骤S110的描述。In the embodiment of the present disclosure, the detecting unit 111 may be configured to perform step S110 shown in FIG. 2, and the description of the step S110 may be referred to with a specific description of the detecting unit 111.
所述通知单元112,配置成将所述数据变更消息发送到注册监听该目标数据点变化的视图层。The notification unit 112 is configured to send the data change message to a view layer that registers to listen for changes in the target data point.
在本公开实施例中,所述通知单元112可配置成执行图2所示的步骤S120,关于所述通知单元112的具体描述可参对所述步骤S120的描述。In the embodiment of the present disclosure, the notification unit 112 may be configured to perform step S120 shown in FIG. 2, and the description of the step S120 may be referred to with a specific description of the notification unit 112.
可选地,在本公开实施例中,所述软件模型中包括一监听器的集合,多个所述视图层通过所述监听器的集合监听所述目标数据点的变化。所述通知单元112将所述数据变更消息发送到视图层的方式包括:Optionally, in the embodiment of the present disclosure, the software model includes a set of listeners, and the plurality of view layers monitor changes of the target data points through the set of the listeners. The manner in which the notification unit 112 sends the data change message to the view layer includes:
所述通知单元112遍历所述监听器的集合,将所述数据变更消息发送到注册监听该目标数据点变化的视图层。The notification unit 112 traverses the set of listeners, and sends the data change message to a view layer that registers to listen for changes in the target data point.
可选地,在本公开实施例中,各个所述监听器配置有相应的优先等级,所述通知单元112遍历所述监听器的集合,将所述数据变更消息发送到注册监听该目标数据点变化的视图层,包括:Optionally, in the embodiment of the present disclosure, each of the listeners is configured with a corresponding priority level, and the notification unit 112 traverses the set of the listeners, and sends the data change message to register to listen to the target data point. Changing view layers, including:
所述通知单元112在所述数据层中根据所述各个监听器的优先等级,在所述监听器的集合中从优先等级最高的监听器向优先等级最低的监听器进行遍历,将所述数据变更信息发送到注册监听该目标数据点变化的视图层。The notification unit 112 traverses from the highest priority listener to the lowest priority listener in the set of listeners according to the priority level of the respective listeners in the data layer, and the data is traversed. The change information is sent to the view layer that is registered to listen for changes in the target data point.
可选地,在本公开实施例中,所述监听器为一所述数据层与所述视图层之间的接口协议,所述接口协议中包括一接口函数;所述通知单元112将所述数据变更消息发送到视图层的方式包括:Optionally, in the embodiment of the present disclosure, the listener is an interface protocol between the data layer and the view layer, and the interface protocol includes an interface function; the notification unit 112 The way data change messages are sent to the view layer includes:
所述通知单元112通过所述接口函数将数据变更消息发送给所述视图层。The notification unit 112 sends a data change message to the view layer through the interface function.
所述显示单元113,配置成在视图层中根据接收到的数据变更消息进行相应的视图切换或展示。The display unit 113 is configured to perform corresponding view switching or display according to the received data change message in the view layer.
在本公开实施例中,所述显示单元113可配置成执行图2所示的步骤S130,关于所述显示单元113的具体描述可参对所述步骤S130的描述。In the embodiment of the present disclosure, the display unit 113 may be configured to perform step S130 shown in FIG. 2, and the description of the step S130 may be referred to with a specific description of the display unit 113.
可选地,在本公开实施例中,所述显示单元113进行相应的视图切换或展示的方式包括:Optionally, in the embodiment of the present disclosure, the manner in which the display unit 113 performs corresponding view switching or display includes:
所述视图层接收所述数据变更消息,调用所述接口函数,执行所述接口函数中相应的视图切换或展示逻辑。The view layer receives the data change message, invokes the interface function, and performs corresponding view switching or presentation logic in the interface function.
可选地,在本公开实施例中,所述检测单元111在数据层中检测目标数据点的数据 变更,生成数据变更消息,包括:Optionally, in the embodiment of the present disclosure, the detecting unit 111 detects a data change of the target data point in the data layer, and generates a data change message, including:
所述检测单元111在所述数据层中接收到针对目标数据点的数据变更事件时,生成数据变更信息;或The detecting unit 111 generates data change information when receiving a data change event for the target data point in the data layer; or
所述检测单元111在所述数据层中周期性检测并记录目标数据点的数据值,当前检测到所述目标数据点的当前数据值与上次记录的数据值不一致时,生成数据变更信息;或者The detecting unit 111 periodically detects and records the data value of the target data point in the data layer, and generates data change information when the current data value of the target data point is detected to be inconsistent with the last recorded data value; or
所述检测单元111在所述数据层中检测到目标数据点的数据值从第一预设值变更为第二预设值时,生成数据变更信息。The detecting unit 111 generates data change information when detecting that the data value of the target data point is changed from the first preset value to the second preset value in the data layer.
可选地,请参照图4,在本公开实施例中,所述装置还包括注册单元114。Optionally, referring to FIG. 4, in the embodiment of the present disclosure, the apparatus further includes a registration unit 114.
所述注册单元114,配置成通过register函数为所述视图层注册需要监听的目标数据点。The registration unit 114 is configured to register, by the register function, the target data point that needs to be monitored for the view layer.
另外,本公开实施例还提供一种可读存储介质,所述可读存储介质包括计算机程序,所述计算机程序运行时控制所述可读存储介质所在电子设备执行所述数据通知方法。In addition, an embodiment of the present disclosure further provides a readable storage medium, the readable storage medium comprising a computer program, the computer program controlling the electronic device where the readable storage medium is located to execute the data notification method.
综上所述,本公开提供的数据通知方法、装置及可读存储介质,在软件MVC模型中省略了控制层,将MVC模型简化为数据层和视图层,所述数据层配置成进行数据处理和转化,所述视图层配置成根据所述数据层中的数据进行软件视图的展示。通过数据层获取目标数据点的变化,并通知注册监听该目标数据点变化的视图层,使视图层根据所述目标数据点的变化进行相应的视图展示或切换。如此,减少了软件层级之间的耦合关系,提高了软件的扩展性和可维护性。In summary, the data notification method, apparatus, and readable storage medium provided by the present disclosure omit the control layer in the software MVC model, and simplify the MVC model into a data layer and a view layer, and the data layer is configured to perform data processing. And converting, the view layer is configured to perform a presentation of the software view based on data in the data layer. Obtaining a change of the target data point through the data layer, and notifying the registration to listen to the view layer of the target data point change, so that the view layer performs corresponding view display or switching according to the change of the target data point. In this way, the coupling relationship between software levels is reduced, and the scalability and maintainability of the software are improved.
在本申请所提供的实施例中,应该理解到,所揭露的装置和方法,也可以通过其它的方式实现。以上所描述的装置实施例仅仅是示意性的,例如,附图中的流程图和框图显示了根据本公开的多个实施例的装置、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或代码的一部分,所述模块、程序段或代码的一部分包含一个或多个配置成实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现方式中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。In the embodiments provided by the present application, it should be understood that the disclosed apparatus and method may also be implemented in other manners. The apparatus embodiments described above are merely illustrative, for example, the flowcharts and block diagrams in the figures illustrate the architecture, functionality, and functionality of possible implementations of apparatus, methods, and computer program products according to various embodiments of the present disclosure. operating. In this regard, each block of the flowchart or block diagram can represent a module, a program segment, or a portion of code that comprises one or more of the Executable instructions. It should also be noted that, in some alternative implementations, the functions noted in the blocks may also occur in a different order than those illustrated in the drawings. For example, two consecutive blocks may be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending upon the functionality involved. It is also noted that each block of the block diagrams and/or flowcharts, and combinations of blocks in the block diagrams and/or flowcharts, can be implemented in a dedicated hardware-based system that performs the specified function or function. Or it can be implemented by a combination of dedicated hardware and computer instructions.
另外,在本公开各个实施例中的各功能模块可以集成在一起形成一个独立的部分,也可以是各个模块单独存在,也可以两个或两个以上模块集成形成一个独立的部分。In addition, each functional module in various embodiments of the present disclosure may be integrated to form a separate part, or each module may exist separately, or two or more modules may be integrated to form a separate part.
所述功能如果以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本公开的技术方案本质上或者说对现 有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本公开各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。The functions, if implemented in the form of software functional modules and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, the portion of the technical solution of the present disclosure that contributes in essence or to the prior art or the portion of the technical solution may be embodied in the form of a software product stored in a storage medium, including The instructions are used to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present disclosure. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like. .
需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should be noted that, in this context, relational terms such as first and second are used merely to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply such entities or operations. There is any such actual relationship or order between them. Furthermore, the term "comprises" or "comprises" or "comprises" or any other variations thereof is intended to encompass a non-exclusive inclusion, such that a process, method, article, or device that comprises a plurality of elements includes not only those elements but also Other elements, or elements that are inherent to such a process, method, item, or device. An element that is defined by the phrase "comprising a ..." does not exclude the presence of additional equivalent elements in the process, method, item, or device that comprises the element.
以上所述,仅为本公开的具体实施方式,但本公开的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本公开揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本公开的保护范围之内。因此,本公开的保护范围应所述以权利要求的保护范围为准。The above is only the specific embodiment of the present disclosure, but the scope of the present disclosure is not limited thereto, and any person skilled in the art can easily think of changes or substitutions within the technical scope of the disclosure. It should be covered within the scope of protection of the present disclosure. Therefore, the scope of protection of the present disclosure should be determined by the scope of the claims.
工业实用性Industrial applicability
本公开实施例提供的数据通知方法、装置及可读存储介质,在软件MVC模型中省略了控制层,将MVC模型简化为数据层和视图层,所述数据层配置成进行数据处理和转化,所述视图层配置成根据所述数据层中的数据进行软件视图的展示。通过数据层获取目标数据点的变化,并通知注册监听该目标数据点变化的视图层,使视图层根据所述目标数据点的变化进行相应的视图展示或切换。如此,减少了软件层级之间的耦合关系,提高了软件的扩展性和可维护性。The data notification method, apparatus and readable storage medium provided by the embodiments of the present disclosure omits the control layer in the software MVC model, and the MVC model is simplified into a data layer and a view layer, and the data layer is configured to perform data processing and conversion. The view layer is configured to perform a presentation of a software view based on data in the data layer. Obtaining a change of the target data point through the data layer, and notifying the registration to listen to the view layer of the target data point change, so that the view layer performs corresponding view display or switching according to the change of the target data point. In this way, the coupling relationship between software levels is reduced, and the scalability and maintainability of the software are improved.

Claims (15)

  1. 一种数据通知方法,应用于软件模型,其特征在于,所述软件模型包括数据层及视图层,所述数据层配置成进行数据处理和转化,所述视图层配置成根据所述数据层中的数据进行软件视图的展示;所述方法包括:A data notification method is applied to a software model, wherein the software model includes a data layer and a view layer, the data layer is configured to perform data processing and conversion, and the view layer is configured to be according to the data layer The data is displayed in a software view; the method includes:
    所述数据层检测目标数据点的数据变更,生成数据变更消息;The data layer detects data changes of the target data point to generate a data change message;
    所述数据层将所述数据变更消息发送到注册监听该目标数据点变化的视图层;The data layer sends the data change message to a view layer that registers to listen for changes in the target data point;
    所述视图层根据接收到的数据变更消息进行相应的视图切换或展示。The view layer performs corresponding view switching or presentation according to the received data change message.
  2. 根据权利要求1所述的方法,其特征在于,所述软件模型中包括一监听器的集合,多个所述视图层通过所述监听器的集合监听所述目标数据点的变化;所述数据层将所述数据变更消息发送到注册监听该目标数据点变化的视图层的步骤,包括:The method according to claim 1, wherein said software model includes a set of listeners, and said plurality of view layers monitor changes of said target data points by said set of listeners; said data The layer sends the data change message to the step of registering to view the view layer of the target data point change, including:
    所述数据层遍历所述监听器的集合,将所述数据变更消息发送到注册监听该目标数据点变化的视图层。The data layer traverses the set of listeners, and sends the data change message to a view layer that registers to listen for changes in the target data point.
  3. 根据权利要求2所述的方法,其特征在于,各个所述监听器配置有相应的优先等级,所述数据层遍历所述监听器的集合,将所述数据变更消息发送到注册监听该目标数据点变化的视图层,包括:The method according to claim 2, wherein each of said listeners is configured with a corresponding priority level, said data layer traversing said set of listeners, and transmitting said data change message to registering to listen to said target data Point-changing view layers, including:
    所述数据层根据所述各个监听器的优先等级,在所述监听器的集合中从优先等级最高的监听器向优先等级最低的监听器进行遍历,将所述数据变更信息发送到注册监听该目标数据点变化的视图层。The data layer traverses from the highest priority listener to the lowest priority listener in the set of listeners according to the priority level of the respective listeners, and sends the data change information to the registration monitor. The view layer of the target data point change.
  4. 根据权利要求2所述的方法,其特征在于,所述监听器为一所述数据层与所述视图层之间的接口协议,所述接口协议中包括一接口函数;所述将所述数据变更消息发送到注册监听了该目标数据点变化的视图层的步骤,包括:The method according to claim 2, wherein the listener is an interface protocol between the data layer and the view layer, and the interface protocol includes an interface function; The change message is sent to the step of registering the view layer that listens for the change of the target data point, including:
    所述数据层通过所述接口函数将数据变更消息发送给所述视图层。The data layer sends a data change message to the view layer via the interface function.
  5. 根据权利要求4所述的方法,其特征在于,所述视图层根据接收到的数据变更消息进行相应的视图切换或展示的步骤,包括:The method according to claim 4, wherein the step of the view layer performing a corresponding view switching or displaying according to the received data change message comprises:
    所述视图层接收所述数据变更消息,调用所述接口函数,执行所述接口函数中相应的视图切换或展示逻辑。The view layer receives the data change message, invokes the interface function, and performs corresponding view switching or presentation logic in the interface function.
  6. 根据权利要求1所述的方法,其特征在于,所述数据层检测目标数据点的数据变更,生成数据变更消息,包括:The method according to claim 1, wherein the data layer detects a data change of the target data point, and generates a data change message, including:
    所述数据层接收到针对目标数据点的数据变更事件时,生成数据变更信息;或Generating data change information when the data layer receives a data change event for the target data point; or
    所述数据层周期性检测并记录目标数据点的数据值,当前检测到所述目标数据点的当前数据值与上次记录的数据值不一致时,生成数据变更信息;或者The data layer periodically detects and records the data value of the target data point, and generates data change information when the current data value of the target data point is currently detected to be inconsistent with the last recorded data value; or
    所述数据层检测到目标数据点的数据值从第一预设值变更为第二预设值时,生成数据变更信息。When the data layer detects that the data value of the target data point is changed from the first preset value to the second preset value, the data change information is generated.
  7. 根据权利要求1-6任一所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 6, wherein the method further comprises:
    所述视图层通过register函数注册需要监听的目标数据点。The view layer registers the target data points to be listened to by the register function.
  8. 一种数据通知装置,应用于软件模型,其特征在于,所述软件模型包括数据层及视图层,所述数据层配置成进行数据处理和转化,所述视图层配置成根据所述数据层中的数据进行软件视图的展示;所述装置包括:A data notification device is applied to a software model, wherein the software model includes a data layer and a view layer, the data layer is configured to perform data processing and conversion, and the view layer is configured to be according to the data layer The data is displayed in a software view; the device comprises:
    检测单元,配置成在数据层中检测目标数据点的数据变更,生成数据变更消息;The detecting unit is configured to detect a data change of the target data point in the data layer, and generate a data change message;
    通知单元,配置成将所述数据变更消息发送到注册监听该目标数据点变化的视图层;a notification unit configured to send the data change message to a view layer that registers to listen for changes in the target data point;
    显示单元,配置成在视图层中根据接收到的数据变更消息进行相应的视图切换或展示。The display unit is configured to perform corresponding view switching or display according to the received data change message in the view layer.
  9. 根据权利要求8所述的装置,其特征在于,所述软件模型中包括一监听器的集合,多个所述视图层通过所述监听器的集合监听所述目标数据点的变化;所述通知单元将所述数据变更消息发送到视图层的方式,包括:The apparatus according to claim 8, wherein said software model includes a set of listeners, and said plurality of view layers monitor changes of said target data points by said set of listeners; said notification The manner in which the unit sends the data change message to the view layer, including:
    所述通知单元遍历所述监听器的集合,将所述数据变更消息发送到注册监听该目标数据点变化的视图层。The notification unit traverses the set of listeners, and sends the data change message to a view layer that registers to listen for changes in the target data point.
  10. 根据权利要求9所述的装置,其特征在于,各个所述监听器配置有相应的优先等级,所述通知单元遍历所述监听器的集合,将所述数据变更消息发送到注册监听该目标数据点变化的视图层,包括:The apparatus according to claim 9, wherein each of said listeners is configured with a corresponding priority level, said notification unit traversing said set of listeners, and transmitting said data change message to registering to listen to said target data Point-changing view layers, including:
    所述通知单元在所述数据层中根据所述各个监听器的优先等级,在所述监听器的集合中从优先等级最高的监听器向优先等级最低的监听器进行遍历,将所述数据变更信息发送到注册监听该目标数据点变化的视图层。The notification unit traverses from the highest priority listener to the lowest priority listener in the set of listeners according to the priority level of the respective listeners in the data layer, and changes the data The information is sent to the view layer that is registered to listen for changes in the target data point.
  11. 根据权利要求9所述的装置,其特征在于,所述监听器为一所述数据层与所述视图层之间的接口协议,所述接口协议中包括一接口函数;所述通知单元将所述数据变更消息发送到视图层的方式,包括:The device according to claim 9, wherein the listener is an interface protocol between the data layer and the view layer, and the interface protocol includes an interface function; The manner in which the data change message is sent to the view layer includes:
    所述通知单元通过所述接口函数将数据变更消息发送给所述视图层。The notification unit sends a data change message to the view layer through the interface function.
  12. 根据权利要求11所述的装置,其特征在于,所述显示单元进行相应的视图切换或展示的方式,包括:The device according to claim 11, wherein the manner in which the display unit performs corresponding view switching or display comprises:
    所述显示单元接收所述数据变更消息,调用所述接口函数,执行所述接口函数中相应的视图切换或展示逻辑。The display unit receives the data change message, invokes the interface function, and performs corresponding view switching or presentation logic in the interface function.
  13. 根据权利要求8所述的装置,其特征在于,所述检测单元在数据层中检测目标 数据点的数据变更,生成数据变更消息,包括:The apparatus according to claim 8, wherein the detecting unit detects a data change of the target data point in the data layer, and generates a data change message, including:
    所述检测单元在所述数据层中接收到针对目标数据点的数据变更事件时,生成数据变更信息;或The detecting unit generates data change information when receiving a data change event for the target data point in the data layer; or
    所述检测单元在所述数据层中周期性检测并记录目标数据点的数据值,当前检测到所述目标数据点的当前数据值与上次记录的数据值不一致时,生成数据变更信息;或者The detecting unit periodically detects and records the data value of the target data point in the data layer, and generates data change information when the current data value of the target data point is currently detected to be inconsistent with the last recorded data value; or
    所述检测单元在所述数据层中检测到目标数据点的数据值从第一预设值变更为第二预设值时,生成数据变更信息。The detecting unit generates data change information when the data value of the target data point is detected in the data layer to be changed from the first preset value to the second preset value.
  14. 根据权利要求8-14任一所述的装置,其特征在于,所述装置还包括:The device according to any one of claims 8-14, wherein the device further comprises:
    注册单元,配置成通过register函数为所述视图层注册需要监听的目标数据点。The registration unit is configured to register, by the register function, the target data point to be monitored for the view layer.
  15. 一种可读存储介质,所述可读存储介质包括计算机程序,所述计算机程序运行时控制所述可读存储介质所在电子设备执行权利要求1~7任一项所述的数据通知方法。A readable storage medium, the readable storage medium comprising a computer program, the computer program controlling the electronic device in which the readable storage medium is located to perform the data notification method according to any one of claims 1 to 7.
PCT/CN2018/082919 2017-05-02 2018-04-13 Data notification method, device and readable storage medium WO2018201871A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710301939.5 2017-05-02
CN201710301939.5A CN107133041B (en) 2017-05-02 2017-05-02 Data notification method and device

Publications (1)

Publication Number Publication Date
WO2018201871A1 true WO2018201871A1 (en) 2018-11-08

Family

ID=59716726

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/082919 WO2018201871A1 (en) 2017-05-02 2018-04-13 Data notification method, device and readable storage medium

Country Status (2)

Country Link
CN (1) CN107133041B (en)
WO (1) WO2018201871A1 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107133041B (en) * 2017-05-02 2019-09-06 武汉斗鱼网络科技有限公司 Data notification method and device
CN107577540B (en) * 2017-08-31 2020-03-17 武汉斗鱼网络科技有限公司 Method, storage medium, equipment and system for realizing reporting function in video friend making
CN108549570B (en) * 2018-04-28 2021-10-26 北京小米移动软件有限公司 User interface updating method and device
CN108563487B (en) * 2018-04-28 2021-10-01 北京小米移动软件有限公司 User interface updating method and device
CN109144750B (en) * 2018-08-21 2021-06-15 武汉斗鱼网络科技有限公司 Message processing method and device, electronic equipment and storage medium
CN111309405A (en) * 2020-01-17 2020-06-19 深圳市共进电子股份有限公司 Software module interaction method and device, computer equipment and readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102325159A (en) * 2011-07-14 2012-01-18 华中科技大学 Virtual experimental platform offline application interaction system
CN102650952A (en) * 2011-02-28 2012-08-29 北京航空航天大学 Modeling tool order calling method and system based on MVC framework
US8489704B1 (en) * 2009-10-05 2013-07-16 Glance Networks, Inc. Method and apparatus for providing information on a remote viewing session
CN107133041A (en) * 2017-05-02 2017-09-05 武汉斗鱼网络科技有限公司 Data notification method and device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101694618B (en) * 2009-09-01 2013-03-06 卡斯柯信号有限公司 Automatic mapping method of model layer and view layer data suitable for AJAX frame
CA2796052A1 (en) * 2010-04-12 2011-10-20 Google Inc. Rich content in a browser-based word processor
CN102722372B (en) * 2012-05-25 2015-04-22 上海学智科技有限公司 Method and system for automatically generating codes through classification and configuration
CN106126249B (en) * 2016-06-29 2019-06-04 武汉斗鱼网络科技有限公司 It is a kind of to realize behavior, data, the method and system of view linkage in front end

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8489704B1 (en) * 2009-10-05 2013-07-16 Glance Networks, Inc. Method and apparatus for providing information on a remote viewing session
CN102650952A (en) * 2011-02-28 2012-08-29 北京航空航天大学 Modeling tool order calling method and system based on MVC framework
CN102325159A (en) * 2011-07-14 2012-01-18 华中科技大学 Virtual experimental platform offline application interaction system
CN107133041A (en) * 2017-05-02 2017-09-05 武汉斗鱼网络科技有限公司 Data notification method and device

Also Published As

Publication number Publication date
CN107133041A (en) 2017-09-05
CN107133041B (en) 2019-09-06

Similar Documents

Publication Publication Date Title
WO2018201871A1 (en) Data notification method, device and readable storage medium
EP3952423B1 (en) Method and device for determining terminal behavior analysis
US10098090B2 (en) Dynamic muting of communication notifications
WO2017092347A1 (en) Method, device and system for updating client configuration in memcached system
CN111694674B (en) Message distribution processing method, device, equipment and storage medium
WO2017181709A1 (en) Method and device for acquiring message to be pushed, and method and device for pushing message
WO2016184266A1 (en) Early warning method and device, and processing server
US10455542B2 (en) Method of synchronizing notification messages for electronic devices and electronic devices
US20160105389A1 (en) Method, server and electronic devices of synchronizing notification messages for electronic devices
CN110166562B (en) Data synchronization method and device, storage medium and electronic equipment
US10516702B2 (en) Managing mid-dialog session initiation protocol (SIP) messages
WO2015149471A1 (en) Information pushing method, system and device and computer storage medium
US10798536B2 (en) Method, system, and device for processing system call in voice call
WO2019041930A1 (en) Inspection method, device and system, computer apparatus, and storage medium
WO2013189263A1 (en) Method and device for monitoring api function scheduling in mobile terminal
US12058285B2 (en) Suppressing indications of events in user interfaces
US9750067B2 (en) Communication method, information processing apparatus, and non-transitory computer-readable recording medium
TW201821965A (en) Group message notification method, client, electronic device and server
CN107995351A (en) Call method and device
CN112671897A (en) Access method, device, storage medium, equipment and product of distributed system
CA3122092A1 (en) Cloud integration to desktop-based emergency service applications
KR20220091441A (en) Data synchronization method and device, electronic device, storage media, and computer program
WO2017197944A1 (en) Notification message prompting method among terminals, and terminal
CN113346973A (en) Event prompting method and device, electronic equipment and computer readable storage medium
WO2017084315A1 (en) Video call connection method, system and device, and video service end

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18793990

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18793990

Country of ref document: EP

Kind code of ref document: A1