[go: up one dir, main page]

CN113377870B - Shared data storage method, device and equipment - Google Patents

Shared data storage method, device and equipment Download PDF

Info

Publication number
CN113377870B
CN113377870B CN202110683516.0A CN202110683516A CN113377870B CN 113377870 B CN113377870 B CN 113377870B CN 202110683516 A CN202110683516 A CN 202110683516A CN 113377870 B CN113377870 B CN 113377870B
Authority
CN
China
Prior art keywords
shared data
store
instruction
storage
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110683516.0A
Other languages
Chinese (zh)
Other versions
CN113377870A (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.)
BOE Technology Group Co Ltd
Beijing Zhongxiangying Technology Co Ltd
Original Assignee
BOE Technology Group Co Ltd
Beijing Zhongxiangying Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by BOE Technology Group Co Ltd, Beijing Zhongxiangying Technology Co Ltd filed Critical BOE Technology Group Co Ltd
Priority to CN202110683516.0A priority Critical patent/CN113377870B/en
Publication of CN113377870A publication Critical patent/CN113377870A/en
Application granted granted Critical
Publication of CN113377870B publication Critical patent/CN113377870B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/302Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Mathematical Physics (AREA)
  • Quality & Reliability (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a method, a device and equipment for storing shared data, which are used for packaging logic of access operation of the shared data into a store, and storing the shared data of a page component into the store only according to a corresponding storage mode when the shared data is used, so that complex logic codes are avoided, and the shared data storage method is simpler and more efficient. The method comprises the following steps: monitoring a storage instruction of shared data sent by at least one page component; and storing the shared data indicated by the storage instruction into a store according to a storage mode corresponding to the storage instruction, wherein the store is constructed and packaged based on a compact hook function hooks, and the store is used for representing logic of the shared data for access operation.

Description

Shared data storage method, device and equipment
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, and a device for storing shared data.
Background
React is a Web development framework for building a JavaScript library for a user interface. Redux is a set of frames for data sharing in React, including action, reducer, store, state modules. In the existing practice data sharing scheme, the shared data is generally injected layer by layer, or the central data sharing is realized by using a reduced framework, but the efficiency of injecting the shared data layer by layer is lower, and the state management module is required to wrap all internal components of the program, so that the method of central data sharing is limited in use and low in applicability, and the data sharing can be realized only by creating the module action, reducer, store, state and interaction logic between the corresponding modules when the data sharing is realized each time, so that the operation logic is complex, and the development period is long.
Disclosure of Invention
The invention provides a storage method, a device and equipment for shared data, which construct a store based on a reaction hook function hook, and package logic of the shared data for access operation into the store.
In a first aspect, a method for storing shared data provided by an embodiment of the present invention includes:
monitoring a storage instruction of shared data sent by at least one page component;
And storing the shared data indicated by the storage instruction into a store according to a storage mode corresponding to the storage instruction, wherein the store is constructed and packaged based on a compact hook function hooks, and the store is used for representing logic of the shared data for access operation.
According to the embodiment of the invention, the structure of the reduced is reconstructed through the action hooks, the interactive logic for sharing data between the state and the reducer in the current reduced frame is simplified to be encapsulated into the store through the hook function, the encapsulated store is utilized, the store can be directly invoked by a way of invoking the encapsulation assembly when the page assembly is accessed, and the implementation can be realized without building a plurality of modules and logics, so that the method is simpler and more efficient.
As an alternative embodiment, further comprising:
Monitoring a reading instruction of shared data sent by at least one page component;
and reading shared data corresponding to the reading instruction from the store according to a reading mode corresponding to the reading instruction.
As an optional implementation manner, the storing the shared data indicated by the storage instruction into the store according to the storage manner corresponding to the storage instruction includes:
determining a data type and a storage field corresponding to the storage instruction;
and storing the indicated shared data in the storage field in the store according to the data type.
As an optional implementation manner, the reading shared data corresponding to the read instruction from the store according to a reading mode corresponding to the read instruction includes:
determining a data type and a storage field corresponding to the read instruction;
and reading the shared data of the data type from the storage field in the store.
As an alternative embodiment, further comprising:
and carrying out persistence processing on the shared data stored in the store, so that the shared data stored in the store is reserved when the page component is refreshed.
As an alternative embodiment, further comprising:
monitoring an update instruction of the shared data;
and updating the shared data stored in the store according to the updating mode corresponding to the updating instruction.
As an alternative implementation, the store includes actions, models and a reducer, where the actions are used to create action instructions, models is used to check the shared data type in the store, and the reducer is used to store and/or update the shared data.
In a second aspect, an embodiment of the present invention further provides a storage device for sharing data, where the device includes:
The monitoring unit is used for monitoring a storage instruction of the shared data sent by at least one page component;
and the storage unit is used for storing the shared data indicated by the storage instruction into a store according to a storage mode corresponding to the storage instruction, wherein the store is constructed based on a act hook function hooks and is used for representing logic of access operation of the shared data.
As an alternative embodiment, the method further comprises a reading unit for:
Monitoring a reading instruction of shared data sent by at least one page component;
and reading shared data corresponding to the reading instruction from the store according to a reading mode corresponding to the reading instruction.
As an alternative embodiment, the storage unit is specifically configured to:
determining a data type and a storage field corresponding to the storage instruction;
and storing the indicated shared data in the storage field in the store according to the data type.
As an alternative embodiment, the reading unit is specifically configured to:
determining a data type and a storage field corresponding to the read instruction;
and reading the shared data of the data type from the storage field in the store.
As an alternative embodiment, the method further comprises a persistence unit for:
and carrying out persistence processing on the shared data stored in the store, so that the shared data stored in the store is reserved when the page component is refreshed.
As an alternative embodiment, the method further comprises an updating unit for:
monitoring an update instruction of the shared data;
and updating the shared data stored in the store according to the updating mode corresponding to the updating instruction.
As an alternative implementation, the store includes actions, models and a reducer, where the actions are used to create action instructions, models is used to check the shared data type in the store, and the reducer is used to store and/or update the shared data.
In a third aspect, a storage device for sharing data provided by an embodiment of the present invention includes a processor and a memory, where the memory is configured to store a program executable by the processor, and the processor is configured to read the program in the memory and execute the following steps:
monitoring a storage instruction of shared data sent by at least one page component;
And storing the shared data indicated by the storage instruction into a store according to a storage mode corresponding to the storage instruction, wherein the store is constructed and packaged based on a compact hook function hooks, and the store is used for representing logic of the shared data for access operation.
As an alternative embodiment, the processor is specifically further configured to perform:
Monitoring a reading instruction of shared data sent by at least one page component;
and reading shared data corresponding to the reading instruction from the store according to a reading mode corresponding to the reading instruction.
As an alternative embodiment, the processor is specifically configured to perform:
determining a data type and a storage field corresponding to the storage instruction;
and storing the indicated shared data in the storage field in the store according to the data type.
As an alternative embodiment, the processor is specifically configured to perform:
determining a data type and a storage field corresponding to the read instruction;
and reading the shared data of the data type from the storage field in the store.
As an alternative embodiment, the processor is specifically further configured to perform:
and carrying out persistence processing on the shared data stored in the store, so that the shared data stored in the store is reserved when the page component is refreshed.
As an alternative embodiment, the processor is specifically further configured to perform:
monitoring an update instruction of the shared data;
and updating the shared data stored in the store according to the updating mode corresponding to the updating instruction.
As an alternative implementation, the store includes actions, models and a reducer, where the actions are used to create action instructions, models is used to check the shared data type in the store, and the reducer is used to store and/or update the shared data.
In a fourth aspect, embodiments of the present invention also provide a computer storage medium having stored thereon a computer program for carrying out the steps of the method of the first aspect described above when executed by a processor.
These and other aspects of the application will be more readily apparent from the following description of the embodiments.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the description of the embodiments will be briefly described below, it will be apparent that the drawings in the following description are only some embodiments of the present invention, and that other drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of an implementation of a method for storing shared data according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating an embodiment of a method for accessing shared data;
FIG. 3 is a schematic diagram of a flow framework for storing and reading shared data according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of an internal architecture of a store according to an embodiment of the present invention;
FIG. 5 is a flowchart of an embodiment of storing data in a Store;
FIG. 6 is a flowchart of a Store read operation according to an embodiment of the present invention;
FIG. 7 is a flowchart of a method for implementing sharing of shared data according to an embodiment of the present invention;
FIG. 8 is a schematic diagram of a memory device for sharing data according to an embodiment of the present invention;
fig. 9 is a schematic diagram of a storage device for sharing data according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in further detail below with reference to the accompanying drawings, and it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In the embodiment of the invention, the term "and/or" describes the association relation of the association objects, which means that three relations can exist, for example, a and/or B can be expressed as follows: a exists alone, A and B exist together, and B exists alone. The character "/" generally indicates that the context-dependent object is an "or" relationship.
The application scenario described in the embodiment of the present invention is for more clearly describing the technical solution of the embodiment of the present invention, and does not constitute a limitation on the technical solution provided by the embodiment of the present invention, and as a person of ordinary skill in the art can know that the technical solution provided by the embodiment of the present invention is applicable to similar technical problems as the new application scenario appears. In the description of the present invention, unless otherwise indicated, the meaning of "a plurality" is two or more.
The technical terms related to the embodiment 1 and the invention are as follows:
and the React, web development framework belongs to the front-end framework and is used for constructing a JavaScript library of the user interface.
The hook function Hooks can acquire any life cycle, local state states, routes and the like in the functional component, and is a calling function provided by the act.
A set of framework for data sharing in reduce, act comprises action, reducer, store, state modules.
States, act, an object in the framework that stores the current page variables.
Data is shared, and operations of storing and reading the same data are performed simultaneously by a plurality of pages, and the data is called shared data.
In the existing practice data sharing scheme, the shared data is generally injected layer by layer, or the central data sharing is realized by using a reduced framework, but the efficiency of injecting the shared data layer by layer is lower, and the state management module is required to wrap all internal components of the program, so that the method of central data sharing is limited in use and low in applicability, and the data sharing can be realized only by creating the module action, reducer, store, state and interaction logic between the corresponding modules when the data sharing is realized each time, so that the operation logic is complex, and the development period is long. According to the embodiment of the invention, the Store is constructed based on the React hooks, the logic of the access operation of the shared data is packaged into the Store, the shared data of the page component is stored into the Store only according to the corresponding storage mode when the Store is used, the Store is introduced like the component, and when the data is required to be accessed, the data access can be realized by calling the corresponding access method without other additional logic. So that the use of complex logic codes is avoided, and the method is simpler and more efficient.
As shown in fig. 1, an implementation flow of a method for storing shared data provided by an embodiment of the present invention is as follows:
step 100, monitoring a storage instruction of shared data sent by at least one page component;
in implementation, the store instruction of the page component is snooped using a snoop function encapsulated in the store.
And step 101, storing the shared data indicated by the storage instruction into a store according to a storage mode corresponding to the storage instruction, wherein the store is constructed and packaged based on a act hook function hook, and the store is used for representing logic of access operation of the shared data.
The embodiment of the invention reconstructs the structure of the reduced through the action hooks, simplifies the interactive logic for sharing data between the state and the reducer in the current reduced frame into the logic for carrying out access operation on the shared data through the hook function, and encapsulates the logic into the store, namely the store in the embodiment of the invention inherits the logic for processing the shared data by the reduced. When the packaged store is used for carrying out access operation on the page assembly, the store can be directly called by using a mode of calling the package assembly, the data can be obtained by directly using a get method, the data is assigned by a set method, and the page assembly can be realized without building a plurality of modules and logics, so that the method is simpler and more efficient. Because the multiple page components can be directly used for carrying out the access operation on the same shared data through the store, the method and the device solve the problem that the multiple page components are easy to cause the error of the shared data when the multiple page components are used for carrying out the access operation on the same shared data at the same time due to complex interaction logic between the modules, the store is adopted for carrying out the storage and the reading operation, the logical relationship between the modules is not needed to be established when the store and the read are carried out, and the problem that the multiple page components are used for causing the error of the shared data when the multiple page components are used for carrying out the access operation on the same shared data at the same time can be effectively prevented.
The embodiment can store the shared data aiming at the storage instruction of the shared data sent by one page component; or, for the storage instruction of the shared data sent by the page components, storing the shared data simultaneously; or, reading the shared data aiming at a reading instruction of the shared data sent by one page component; or, for the storage instruction of the shared data sent by the page components, simultaneously reading the shared data; or, for the read instruction sent by at least one page component and the storage instruction sent by at least one page component, performing corresponding read operation and storage operation on the shared data at the same time.
In some examples, this embodiment also provides a method for accessing shared data, as shown in fig. 2, and the specific implementation flow of the method is as follows:
step 200, monitoring a storage instruction of shared data sent by at least one page component and monitoring a reading instruction of the shared data sent by at least one page component;
Step 201, storing the shared data indicated by the storage instruction into a store according to a storage mode corresponding to the storage instruction, and simultaneously reading the shared data corresponding to the read instruction from the store according to a reading mode corresponding to the read instruction.
According to the embodiment of the invention, the access logic of the shared data is packaged into the store, the corresponding shared data can be stored and read directly according to the storage instruction and the reading instruction, the logical relation between 4 modules and the corresponding modules is not required to be established, and the shared data can be accessed only by calling the store in the use process, so that the problem of data errors caused when a plurality of page components access the same data at the same time can be effectively prevented.
In some examples, as shown in fig. 3, the present embodiment provides a schematic flow frame structure for storing and reading shared data, and the store in the present embodiment serves as a center, so that the storage and reading functions of shared data can be provided for all page components in the program, without a large amount of logic code implementation, and the method is simpler and more efficient.
In some examples, as shown in fig. 4, the present embodiment provides a schematic internal architecture of a store, including three modules: actions, models, and reducer, wherein the functions of the various modules are as follows:
module 1, actions: for creating action instructions;
Including globle. Ts and index. Ts, wherein:
the global ts is used for creating actions according to the action method, and updating the state of the core data in reducers through actions.
Index.ts for use in connection with communication with other modules.
Module 2, models: for checking the shared data type in the store;
including index. Ts, patents model. Ts, doctoredel. Ts, wherein:
index.ts for use in connection with communication with other modules;
Taking hospital application program as an example, the Patientmodel. Ts is used for checking the type of the shared data according to the height, age and other shared data of the patient;
Taking a hospital application program as an example, the method is used for checking the type of shared data according to the shared data of doctors, and can effectively prevent dirty data from being input, for example, the age 12 is stored in a position corresponding to the name in the hospital application program.
Module 3, reducer: for storing and/or updating the shared data.
Comprising the following steps: index.ts, global.ts, state.ts, wherein:
index.ts for use in connection with communication with other modules;
Global.ts, which is used to monitor actions and update the monitored shared data to state.
State.ts for storing core data required when creating store, and shared data. With Models, a check of the shared data type can be achieved, i.e. error information (erroneous shared data) or unsatisfactory information (shared data) will not be stored in the store.
The store provided by the embodiment does not need to subscribe and monitor the change of the store when the access operation is performed on the shared data so as to acquire the shared data in the store, and the store provided by the embodiment can directly read the data through the get method and store the data through the set method, so that the method is simpler and more efficient.
In some examples, the present embodiment stores by:
determining a data type and a storage field corresponding to the storage instruction;
and storing the indicated shared data in the storage field in the store according to the data type.
In some examples, the present embodiment reads by:
determining a data type and a storage field corresponding to the read instruction;
and reading the shared data of the data type from the storage field in the store.
In some examples, the present embodiment may also perform persistence processing on the shared data, so that the shared data stored in the store is not cleaned up when the page is refreshed. And performing persistence processing on the shared data stored in the store, so that the shared data stored in the store is reserved when the page component is refreshed. In practical application, taking a hospital application as an example, when a user re-opens the hospital application, the user does not need to reselect the doctor, can use the doctor selected last time, and can also query the reservation information, bill information, medicine-opening information, inspection result and the like of the doctor.
In some examples, the present embodiment may also update the shared data stored in the store to ensure that the shared data stored in the store is up-to-date. In implementation, monitoring an update instruction of shared data; and updating the shared data stored in the store according to the updating mode corresponding to the updating instruction. I.e. if the user modifies the data, the shared data stored in the store is updated to the modified data.
In some examples, the logic for accessing shared data in the store is as follows:
1) states.ts determines to begin storing data, determines a predefined data type by globelModel, generates RootState for storing shared data to states.ts;
2) reducers global.ts uses RootState to bind shared data and actions in handleActions < RootState > states.ts to realize interception of actions, and then updates data in store;
In practice, the action is bound to the data, and if the monitored action is to select a doctor, the shared data corresponding to the action is stored in the states ts of the current doctor, that is, in global ts of reducers in reducers.
3) Global.ts of actions defines global action instructions, and global actions are defined through creatAction ();
the action instruction is used for binding with the data, so that the data is indicated to be stored in a corresponding storage field in global ts of reducers according to the action instruction. For example, if the action instruction is to select a doctor, the data of the selected doctor is stored in a storage field corresponding to the doctor.
Global action instructions in this embodiment include, but are not limited to: selecting a doctor, selecting a first doctor, clearing the doctor, and selecting information corresponding to the doctor WeChat.
4) Binding dispach to a predefined action by bindActionCreators (action, dispach);
Wherein dispach is used to dispatch actions so that globleAction is generated after dispach event is detected.
5) The method for constructing the requirements of the act hooks is used for packaging the store, and comprises the following specific steps:
5a) Generating globleReducer by handleActions < RootState > with globleAction global instruction as a parameter, that is, generating a core memory unit that can be used by both application programs to store shared data;
5b) Using RootState in 1) to control the type of data stored, using globleReducer in 5 a) to generate a reducer by the CombinReducers () method;
5c) Persisting the data in states through persistConfig and generating rootReducer;
5d) Using rootReducer and RootState in 1), a store is generated by createStore (rootReducer, INITALSTATE: rootstate);
5e) Packaging the generated store by a configureStore method;
5f) Store is generated using configureStore methods when the application is turned on.
The store in this embodiment is constructed only once, i.e. the first time the user uses the program. The store in this embodiment inherits the method and logic in the reduce for dynamically processing shared data without the need to re-develop the functionality associated with dynamic data management.
In some examples, as shown in fig. 5, an implementation flow of Store storage data provided in this embodiment is as follows:
step 500, an application program is started for the first time;
step 501, constructing a store by using configureStore () method based on the act hops;
the structured store is used for a container that shares data and global state management.
Step 502, creating a dispatch by usedispatch method;
Step 503, creating globalActions through useglobalAction () method;
Step 504, call globalActions the method with dispatch as parameter, obtain the action created in the store, in order to finish the flow of store storage data.
In some examples, taking a hospital application as an example, if the information of the current patient is updated, the information of the current patient in the store is updated through globeliaction. The code references are as follows:
Const globalActions=useGlobalAction(dispatch)
Global options.select Patent ({ name: "11", age: "10" })// store user selected current visit
In some examples, as shown in fig. 6, an implementation flow of Store read data provided in this embodiment is as follows:
step 600, an application program is started for the first time;
Step 601, constructing a store by using configureStore () method based on the act hops;
In step 602, the page component in the application program specifies the data type through useselector method and RootState, and reads the shared data corresponding to the specified data type from the corresponding storage field in the store.
The reference codes are as follows:
Const store=useSelector((state:Rootstate)=>state.global)
SELECTPATIENT = store.select Patient// read current visit information
In some examples, the present embodiment further provides a method for sharing data, as shown in fig. 7, where an implementation flow of the method is as follows:
step 700, monitoring a storage instruction of shared data sent by at least one page component and a reading instruction of shared data sent by at least one page component;
Step 701, storing the shared data indicated by the storage instruction into a store according to a storage mode corresponding to the storage instruction, and reading the shared data corresponding to the reading instruction from the store according to a reading mode corresponding to the reading instruction;
step 702, performing persistence processing on the shared data stored in the store, so that the shared data stored in the store is reserved when the page component is refreshed;
Step 703, monitoring an update instruction of the shared data, and updating the shared data stored in the store according to an update mode corresponding to the update instruction.
Embodiment 2, based on the same inventive concept, the present invention further provides a device for sharing data, and since the device is the device in the method in the embodiment of the present invention, and the principle of the device for solving the problem is similar to that of the method, the implementation of the device can refer to the implementation of the method, and the repetition is omitted.
As shown in fig. 8, the apparatus includes:
A monitoring unit 800, configured to monitor a storage instruction of shared data sent by at least one page component;
and the storage unit 801 is configured to store the shared data indicated by the storage instruction into a store according to a storage manner corresponding to the storage instruction, where the store is constructed based on a act hook function hook, and the store is used for characterizing logic of access operation of the shared data.
As an alternative embodiment, the method further comprises a reading unit for:
Monitoring a reading instruction of shared data sent by at least one page component;
and reading shared data corresponding to the reading instruction from the store according to a reading mode corresponding to the reading instruction.
As an alternative embodiment, the storage unit is specifically configured to:
determining a data type and a storage field corresponding to the storage instruction;
and storing the indicated shared data in the storage field in the store according to the data type.
As an alternative embodiment, the reading unit is specifically configured to:
determining a data type and a storage field corresponding to the read instruction;
and reading the shared data of the data type from the storage field in the store.
As an alternative embodiment, the method further comprises a persistence unit for:
and carrying out persistence processing on the shared data stored in the store, so that the shared data stored in the store is reserved when the page component is refreshed.
As an alternative embodiment, the method further comprises an updating unit for:
monitoring an update instruction of the shared data;
and updating the shared data stored in the store according to the updating mode corresponding to the updating instruction.
As an alternative implementation, the store includes actions, models and a reducer, where the actions are used to create action instructions, models is used to check the shared data type in the store, and the reducer is used to store and/or update the shared data.
Embodiment 3, based on the same inventive concept, the embodiment of the present invention further provides a storage device for sharing data, and since the device is the device in the method in the embodiment of the present invention, and the principle of the device for solving the problem is similar to that of the method, the implementation of the device may refer to the implementation of the method, and the repetition is omitted.
As shown in fig. 9, the apparatus includes a processor 900 and a memory 901, the memory 901 is used for storing a program executable by the processor 900, and the processor 900 is used for reading the program in the memory 901 and executing the following steps:
monitoring a storage instruction of shared data sent by at least one page component;
And storing the shared data indicated by the storage instruction into a store according to a storage mode corresponding to the storage instruction, wherein the store is constructed and packaged based on a compact hook function hooks, and the store is used for representing logic of the shared data for access operation.
As an alternative embodiment, the processor is specifically further configured to perform:
Monitoring a reading instruction of shared data sent by at least one page component;
and reading shared data corresponding to the reading instruction from the store according to a reading mode corresponding to the reading instruction.
As an alternative embodiment, the processor is specifically configured to perform:
determining a data type and a storage field corresponding to the storage instruction;
and storing the indicated shared data in the storage field in the store according to the data type.
As an alternative embodiment, the processor is specifically configured to perform:
determining a data type and a storage field corresponding to the read instruction;
and reading the shared data of the data type from the storage field in the store.
As an alternative embodiment, the processor is specifically further configured to perform:
and carrying out persistence processing on the shared data stored in the store, so that the shared data stored in the store is reserved when the page component is refreshed.
As an alternative embodiment, the processor is specifically further configured to perform:
monitoring an update instruction of the shared data;
and updating the shared data stored in the store according to the updating mode corresponding to the updating instruction.
As an alternative implementation, the store includes actions, models and a reducer, where the actions are used to create action instructions, models is used to check the shared data type in the store, and the reducer is used to store and/or update the shared data.
Based on the same inventive concept, the embodiments of the present invention also provide a computer storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of:
monitoring a storage instruction of shared data sent by at least one page component;
And storing the shared data indicated by the storage instruction into a store according to a storage mode corresponding to the storage instruction, wherein the store is constructed and packaged based on a compact hook function hooks, and the store is used for representing logic of the shared data for access operation.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, magnetic disk storage, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various modifications and variations can be made to the present invention without departing from the spirit or scope of the invention. Thus, it is intended that the present invention also include such modifications and alterations insofar as they come within the scope of the appended claims or the equivalents thereof.

Claims (10)

1. A method of storing shared data, the method comprising:
monitoring a storage instruction of shared data sent by at least one page component;
And storing the shared data indicated by the storage instruction into a store according to a storage mode corresponding to the storage instruction, wherein the store is constructed and packaged based on a compact hook function hooks, and the store is used for representing logic of the shared data for access operation.
2. The method as recited in claim 1, further comprising:
Monitoring a reading instruction of shared data sent by at least one page component;
and reading shared data corresponding to the reading instruction from the store according to a reading mode corresponding to the reading instruction.
3. The method according to claim 1, wherein storing the shared data indicated by the store instruction into the store according to the storage manner corresponding to the store instruction comprises:
determining a data type and a storage field corresponding to the storage instruction;
and storing the indicated shared data in the storage field in the store according to the data type.
4. The method according to claim 2, wherein the reading shared data corresponding to the read instruction from the store according to a read manner corresponding to the read instruction includes:
determining a data type and a storage field corresponding to the read instruction;
and reading the shared data of the data type from the storage field in the store.
5. The method as recited in claim 1, further comprising:
and carrying out persistence processing on the shared data stored in the store, so that the shared data stored in the store is reserved when the page component is refreshed.
6. The method as recited in claim 1, further comprising:
monitoring an update instruction of the shared data;
and updating the shared data stored in the store according to the updating mode corresponding to the updating instruction.
7. The method of any of claims 1-6, wherein the store comprises actions, models and a reduce, wherein the actions are used to create action instructions, wherein models is used to check shared data types in the store, and wherein the reduce is used to store and/or update shared data.
8. A storage device for sharing data, the device comprising:
The monitoring unit is used for monitoring a storage instruction of the shared data sent by at least one page component;
and the storage unit is used for storing the shared data indicated by the storage instruction into a store according to a storage mode corresponding to the storage instruction, wherein the store is constructed based on a act hook function hooks and is used for representing logic of access operation of the shared data.
9. A storage device for sharing data, the device comprising a processor and a memory, the memory for storing a program executable by the processor, the processor for reading the program in the memory and performing the steps of the method of any of claims 1-8.
10. A computer storage medium having stored thereon a computer program, which when executed by a processor performs the steps of the method according to any of claims 1-8.
CN202110683516.0A 2021-06-21 2021-06-21 Shared data storage method, device and equipment Active CN113377870B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110683516.0A CN113377870B (en) 2021-06-21 2021-06-21 Shared data storage method, device and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110683516.0A CN113377870B (en) 2021-06-21 2021-06-21 Shared data storage method, device and equipment

Publications (2)

Publication Number Publication Date
CN113377870A CN113377870A (en) 2021-09-10
CN113377870B true CN113377870B (en) 2024-07-16

Family

ID=77577912

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110683516.0A Active CN113377870B (en) 2021-06-21 2021-06-21 Shared data storage method, device and equipment

Country Status (1)

Country Link
CN (1) CN113377870B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110889075A (en) * 2019-11-29 2020-03-17 苏州浪潮智能科技有限公司 Data subscription implementation method and device
CN111435344A (en) * 2019-01-15 2020-07-21 中国石油集团川庆钻探工程有限公司长庆钻井总公司 An analysis model for influencing factors of drilling speed-up based on big data

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112667490A (en) * 2020-12-30 2021-04-16 杭州趣链科技有限公司 Performance test method and device based on hook function
CN112698824B (en) * 2021-01-06 2024-10-18 北京有竹居网络技术有限公司 View element state management method, device, electronic equipment and storage medium
CN112783444A (en) * 2021-01-18 2021-05-11 深圳市科思科技股份有限公司 Cluster disk sharing method, system and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111435344A (en) * 2019-01-15 2020-07-21 中国石油集团川庆钻探工程有限公司长庆钻井总公司 An analysis model for influencing factors of drilling speed-up based on big data
CN110889075A (en) * 2019-11-29 2020-03-17 苏州浪潮智能科技有限公司 Data subscription implementation method and device

Also Published As

Publication number Publication date
CN113377870A (en) 2021-09-10

Similar Documents

Publication Publication Date Title
CN109445802B (en) Privatized Paas platform based on container and method for publishing application thereof
CN109189374B (en) Object construction code generation method and system based on object reference chain
CN110427258B (en) Resource scheduling control method and device based on cloud platform
CN113282795B (en) Data structure diagram generation and updating method and device, electronic equipment and storage medium
CN109144511B (en) Method and system for automatically generating numerical simulation graphical user interface
US20100121795A1 (en) Dynamic constraint satisfaction problem solver
Iosif Exploiting heap symmetries in explicit-state model checking of software
CN113377870B (en) Shared data storage method, device and equipment
US20110231865A1 (en) Application Platform And Method For Operating A Data Processing Arrangement Having Such An Application Platform
CN112604273B (en) Data-driven game system function loading method, device and storage medium
CN113051002B (en) Data editing method, device and storage medium
CN113672222B (en) Application program interface management device and construction method thereof
Kundu et al. An approach to convert XMI representation of UML 2. x interaction diagram into control flow graph
Charlton et al. Formal reasoning about runtime code update
CN117539459B (en) API interface configuration method, system and equipment
CN112650512A (en) Hardware driving method and device, terminal and storage medium
Bistarelli et al. Timed concurrent language for argumentation with maximum parallelism
CN110908644A (en) Configuration method and device of state node, computer equipment and storage medium
Serrano et al. Towards precise security patterns
Hölzl et al. Modeling the car crash crisis management system using HiLA
Whittle et al. Scenario-based engineering of multi-agent systems
CN113760408B (en) Hierarchical calling method, hierarchical calling system, hierarchical calling equipment and storage medium
CN114567623B (en) Page display method and device
CN117312222B (en) SPI-based government purchasing method, system, equipment and medium
CN109150993A (en) A kind of method, terminal installation and storage medium obtaining network request section

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