CN115617333A - Data updating method and device, electronic equipment and storage medium - Google Patents

Data updating method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115617333A
CN115617333A CN202110788306.8A CN202110788306A CN115617333A CN 115617333 A CN115617333 A CN 115617333A CN 202110788306 A CN202110788306 A CN 202110788306A CN 115617333 A CN115617333 A CN 115617333A
Authority
CN
China
Prior art keywords
target
update
information
updating
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110788306.8A
Other languages
Chinese (zh)
Inventor
欧阳德才
李剑雄
黄锐
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Communications Group Co Ltd
China Mobile IoT Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile IoT 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 China Mobile Communications Group Co Ltd, China Mobile IoT Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN202110788306.8A priority Critical patent/CN115617333A/en
Publication of CN115617333A publication Critical patent/CN115617333A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a data updating method, a data updating device, electronic equipment and a computer readable storage medium. The method comprises the following steps: acquiring update index information of an object to be updated, wherein the update index information comprises a first object identifier and target update parameter information of the object to be updated; generating a random character string of the first object identifier to obtain a second object identifier of the object to be updated; generating a target updating function corresponding to the second object identifier; generating update trigger information corresponding to the second object identifier based on the second object identifier and the target update parameter information, wherein the update trigger information comprises target variable data determined based on the target update parameter information; and the updating triggering information is used for triggering the target updating function to update the object to be updated in a pre-established storage pool according to the target variable data. The embodiment of the invention can greatly improve the development efficiency.

Description

Data updating method and device, electronic equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a data updating method, a data updating device, electronic equipment and a computer readable storage medium.
Background
In the front-end page development process, reduce can be generally adopted to manage the global data used by the front-end page, and a storage pool for state management can be created, and the parameter data of each global object is stored based on the storage pool.
At present, if the object state in the storage pool needs to be updated, it is usually necessary to create an update trigger information action and an update function reducer, then issue the action, and capture the corresponding reducer, so as to update the object state in the storage pool. Thus, when a project reaches a certain scale, many extremely redundant and similar actions and reducers may come out, and the development efficiency is low.
Disclosure of Invention
Embodiments of the present invention provide a data updating method, an apparatus, an electronic device, and a computer-readable storage medium, so as to solve the problem in the prior art that when an object state in a storage pool is updated, an action and a reducer need to be manually created, which results in low development efficiency.
In a first aspect, an embodiment of the present invention provides a data updating method, where the method includes:
acquiring update index information of an object to be updated, wherein the update index information comprises a first object identifier and target update parameter information of the object to be updated;
generating a random character string of the first object identifier to obtain a second object identifier of the object to be updated;
generating a target updating function corresponding to the second object identifier;
generating update trigger information corresponding to the second object identifier based on the second object identifier and the target update parameter information, wherein the update trigger information comprises target variable data determined based on the target update parameter information;
and the updating triggering information is used for triggering the target updating function to update the object to be updated in a pre-established storage pool according to the target variable data.
In a second aspect, an embodiment of the present invention provides a data updating apparatus, including:
the system comprises a first acquisition module, a second acquisition module and a first updating module, wherein the first acquisition module is used for acquiring updating index information of an object to be updated, and the updating index information comprises a first object identifier and target updating parameter information of the object to be updated;
the first generation module is used for generating a random character string of the first object identifier to obtain a second object identifier of the object to be updated;
the second generating module is used for generating a target updating function corresponding to the second object identifier;
a third generating module, configured to generate, based on the second object identifier and the target update parameter information, update trigger information corresponding to the second object identifier, where the update trigger information includes target variable data determined based on the target update parameter information;
and the updating triggering information is used for triggering the target updating function to update the object to be updated in a pre-established storage pool according to the target variable data.
In a third aspect, an embodiment of the present invention provides an electronic device, which includes a processor, a memory, and a computer program stored on the memory and executable on the processor, where the computer program, when executed by the processor, implements the steps of the data updating method described above.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the computer program implements the steps of the data updating method.
In the embodiment of the invention, by acquiring the update index information of an object to be updated, the update index information comprises a first object identifier and target update parameter information of the object to be updated; generating a random character string of the first object identifier to obtain a second object identifier of the object to be updated; generating a target updating function corresponding to the second object identifier; generating update trigger information corresponding to the second object identifier based on the second object identifier and the target update parameter information, wherein the update trigger information comprises target variable data determined based on the target update parameter information; and the updating triggering information is used for triggering the target updating function to update the object to be updated in a pre-established storage pool according to the target variable data. Therefore, the action and the reducer can be automatically created based on the update index information of the object to be updated, and the corresponding reducer is captured based on the action, so that the object to be updated in the storage pool can be updated according to the target variable data in the action, and further the development efficiency can be greatly improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required to be used in the description of the embodiments of the present invention will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic flowchart of a data updating method according to an embodiment of the present invention;
FIG. 2 is a schematic overall flow chart of a data update method;
FIG. 3 is a schematic structural diagram of a data updating apparatus according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
First, an application scenario provided by an embodiment of the present invention is described below.
In the front-end page development process, reduce is usually adopted to perform object state management in the front-end page, wherein it can perform state management on global objects in the front-end page. And a global object refers to an object that can be used across pages.
The global object may be an object-oriented structure, which may include a plurality of variables and variable parameters, that is, the global object may be a set of variables and variable parameters, for example, the primary key identifies the global object named "dataj" which includes variable a, variable B, variable C and variable D, and the variable parameters are 1, 2, 1 and 3, respectively.
In the related art, a data flow scheme based on reduce and reduce-saga can be used in the front-end page development process, and the method specifically comprises the following steps: the initialStore method can be used to create a storage store for object state management based on reduce, which serves as a container into which initialized object data can be directly stored.
The store includes namespaces, which are used to merge into key identifiers of global objects, and a data set corresponding to each namespace may be referred to as a state. In the data flow scheme for the storage pool, if the data in the store needs to be updated, an action having the same method and attribute as the store instance and reducers corresponding to the action can be manually created based on reduce.
action may refer to update trigger information, which is a context object and may include activation state, security information, and transaction state of the tracked object, such as key identification and variable data (including variables and variable parameters) of the global object.
Reducers is an update function, which can be referred to as action processors, that can process synchronization actions to calculate the latest state and update the data in the store. When action is triggered, reducers corresponding to the action can be captured according to the key identification of the global object, and the reducers are operated to process the action so as to update the data in the store.
When the data update process includes an asynchronous processing flow, that is, the data needs to go to the request interface first, and when the data returns to the object state to be updated, effects can be created manually by using middleware such as reduce-saga, and the effects can also be called as action processors, and can process asynchronous actions.
In the related art, data updating is performed by using a data stream scheme based on reduce and reduce-saga, actions, reducers and effects need to be created manually, on one hand, the manual creation process is complicated and prone to errors, on the other hand, when a project reaches a certain scale, many extremely redundant and similar actions and reducers may be generated, and therefore development efficiency is low.
Based on this, the embodiment of the present invention provides a new data updating scheme to solve the problem of low development efficiency in the front-end page development process.
The following describes a data updating method provided in an embodiment of the present invention.
It should be noted that the data updating method provided by the embodiment of the present invention relates to the field of computer technology, and can be widely applied to a front-end page development system. The method can be executed by the data updating device of the embodiment of the invention. The data updating apparatus may be configured in any electronic device to perform the data updating method, and the electronic device may be a server or a terminal, which is not limited specifically herein.
Referring to fig. 1, a flowchart of a data updating method according to an embodiment of the present invention is shown. As shown in fig. 1, the method may include the steps of:
step 101, obtaining update index information of an object to be updated, where the update index information includes a first object identifier of the object to be updated and target update parameter information.
In this embodiment, the data update may refer to updating data in the store, and the first update is to add an object or a variable that needs to be updated and related parameters if the object or the variable does not appear in the store, and the second update is to modify a parameter of the object or the variable that needs to be updated and appears in the store.
The object to be updated may refer to a global object, and the object may be used not only on the current front-end page but also across pages.
The update index information may refer to information required to update data in the sotre, and includes at least a first object identifier of an object to be updated and target update parameter information, where the first object identifier may be a key identifier, and the target update parameter information may refer to information required to determine variable data that needs to be modified, that is, target variable data.
The target update parameter information is different in different process flows. For example, in the synchronization process flow, the target update parameter information may be target variable data, that is, the target update parameter information includes a variable and a variable parameter that need to be modified.
For another example, in the asynchronous processing flow, the target update parameter information may include an identification of the asynchronous request to be sent and jump information required for the asynchronous processing, such as a process to which the asynchronous processing jumps for processing. Whether the flow of the data update is a synchronous processing flow or an asynchronous processing flow can be determined by judging whether the identification mark is included in the target update parameter information, so as to perform the processing of the corresponding data update flow.
The obtaining manner of the update index information may include multiple manners, for example, the update index information input by the user may be received, the update index information stored in advance may be obtained, and the update index information sent by other electronic devices may also be received.
And 102, generating a random character string of the first object identifier to obtain a second object identifier of the object to be updated.
In this step, the first object identifiers are different, the random character strings of the first object identifiers are different, and the random character strings are unique character strings relative to the first object identifiers, that is, the object identifiers of the global objects and the random character strings are in a one-to-one correspondence relationship.
An Application Programming Interface (API), such as a random string generator in the ES6, may be called to generate a random string of the first object identifier, and specifically, the first object identifier may be transmitted to the random string generator, so that the random string generator outputs a unique string corresponding to the first object identifier, where the unique string is a second object identifier of the object to be updated and is used to create an action and a reducer.
And 103, generating a target updating function corresponding to the second object identifier.
In this step, the target update function is an update function of the object to be updated, that is, a reducer of the object to be updated.
The reducer may be a series of judgments of if and else, and in the judging process, the reducer may judge according to the second object identifier, and correspondingly, when an if judgment statement regarding the second object identifier is triggered, may correspondingly update data of the object to be updated in the store, and when an else judgment statement is triggered, may perform other processing.
And 104, generating updating trigger information corresponding to the second object identifier based on the second object identifier and the target updating parameter information, wherein the updating trigger information comprises target variable data determined based on the target updating parameter information.
In this step, the update trigger information may be an action, which is an action having the same method and attribute as the store instance, and the action may include information about the global object tracked in the store, and may include an activation state, security information, and transaction state of the tracked object.
The action may include a second object identifier corresponding to the key identifier and target variable data determined based on the target update parameter information.
The action may be used to trigger the reducer to capture a handle function associated with the second object identification in the action to update the state of the object to be updated in the store. The target variable data included in the action includes a variable a and a variable parameter 2, and the action may trigger the reducer to capture a processing function related to the second object identifier in the action, so as to modify the variable parameter of the variable a in the object to be updated to 2 in the store, where the object to be updated may identify a corresponding global object of the key identifier for the second object.
In the store, the variable parameter of the variable a in the object to be updated is modified to 2, and one of the two situations is that there is no variable a in the object to be updated, and at this time, the variable a is newly added to the object to be updated in the store, and the variable parameter of the variable a is 2. The other is that the variable a exists in the object to be updated, and the variable parameter of the variable a is 1, at this time, the variable parameter of the variable a is modified from 1 to 2 in the object to be updated of the store.
In addition, when data is updated, multiple variable data in the object to be updated, such as data of variable a, data of variable B, and data of variable C, may be modified simultaneously based on one action, that is, all variable data in the object to be updated that need to be modified once may be included in the action.
In this embodiment, update index information of an object to be updated is obtained, where the update index information includes a first object identifier of the object to be updated and target update parameter information; generating a random character string of the first object identifier to obtain a second object identifier of the object to be updated; generating a target updating function corresponding to the second object identifier; generating update trigger information corresponding to the second object identifier based on the second object identifier and the target update parameter information, wherein the update trigger information comprises target variable data determined based on the target update parameter information; and the updating triggering information is used for triggering the target updating function to update the object to be updated in a pre-established storage pool according to the target variable data. Therefore, the action and the reducer can be automatically created based on the update index information of the object to be updated, the reducer corresponding to the action is captured based on the action, the object to be updated in the storage pool can be updated according to the target variable data in the action, a tedious and error-prone link can be omitted, and the development efficiency is greatly improved.
And the process of manually creating action, reducer and effect is omitted, a separate model is not required to be maintained, and the random character string corresponding to the id is generated to serve as the association of the action and the reducer, so that only one reducer corresponding to the random character string needs to be called when the action is triggered, and the constraint and the specification of any naming do not need to be followed.
Optionally, the step S104 specifically includes:
under the condition that preset information is not included in the target updating parameter information, the target updating parameter information is used as the target variable data to generate the updating trigger information;
the updating triggering information comprises the second object identifier, and the preset information is used for representing that the target variable data is obtained through an asynchronous request.
Optionally, the step S102 specifically includes:
under the condition that the target updating parameter information comprises preset information, establishing and sending asynchronous request information based on asynchronous request parameter information in the target updating parameter information;
acquiring data returned based on the asynchronous request information;
taking the returned data as the target variable data to generate the updating triggering information;
the updating triggering information comprises the second object identifier, and the preset information is used for representing that the target variable data is obtained through an asynchronous request.
Optionally, after the target S103, the method further includes:
and storing the target updating function into a pre-established data pool, wherein the data pool is used for storing the updating function of the global object.
Optionally, after the target update function is stored in a pre-created data pool, the method further includes:
responding to the updating trigger information, and acquiring the target updating function corresponding to the second object identifier from the data pool;
and running the target updating function to update the object to be updated in the storage pool according to the target variable data.
In this embodiment, the data processing flow may include two types, which are a synchronous processing flow and an asynchronous processing flow, respectively, and the synchronous processing flow and the asynchronous processing flow are different in the manner of acquiring the target variable data.
In the synchronization processing flow, the target variable data may be designated variable data, and if the target variable data is designated by the user, the update index information of the object to be updated, which is transmitted by the user, includes the variable data, that is, the parameter information may be updated for the target. In the asynchronous processing flow, the target variable data may be data returned after asynchronous processing, and the asynchronous processing to be performed may be determined based on the asynchronous request parameter information in the target update parameter information.
Specifically, referring to fig. 2, fig. 2 is an overall flowchart of the data updating method, and as shown in fig. 2, when the state management store is created, in addition to directly storing the data to be initialized in the store, a data pool, that is, a reducer pool, needs to be created and defined, where the data pool is used to store processing functions of global objects in the store, so as to perform injection during subsequent dynamic creation of the reducer. And at the same time, redux-saga middleware needs to be registered for use when data is asynchronously requested.
The user can input the update index information of the object to be updated, the user can limit the data processing flow, and different update index information can be input after the data processing flow is limited.
As shown in fig. 2, the update index information may include id, that is, the first object identifier, where the id may be a key identifier of a global object in the store, and the global object is an object to be updated. The update index information may further include target update parameter information, and the data processing flows are different, and the target update parameter information is different.
The target update parameter information may include args, which may be a character string, and which data processing flow may be determined by determining whether the character string includes preset information, where the preset information may be used to characterize that the target variable data needs to be obtained through an asynchronous request.
If the character string is determined to include the preset information, the current data processing flow may be determined to be an asynchronous processing flow, and if the character string is determined to not include the preset information, the current data processing flow may be determined to be a synchronous processing flow.
The preset information may be set according to actual conditions, in an optional embodiment, the preset information may be a "/" character, in a case where args does not include the "/" character, the arg may execute the synchronous processing flow 201 for specified target variable data, and in a case where args includes the "/" character, the arg may execute the asynchronous processing flow 202 for an identifier that needs to perform asynchronous processing.
Specifically, in the synchronization processing flow, a random character string of the id may be generated, a type that is a second object identifier of the object to be updated is obtained, and an action and a reducer corresponding to the second object identifier may be generated based on the type. The action may include an attribute named payload, the target variable data is stored, the args may be stored in the payload of the action, and then the reducer is injected into the reducer pool.
Then, a dispatch trigger action can be issued, a reducer corresponding to the action is captured in a reducer pool based on the uniqueness of the second object identifier, and the reducer is operated, so that the object to be updated corresponding to the id is updated in the store according to the target variable data.
In the synchronous processing flow, a random character string of the id is generated through the id transmitted by a user, and corresponding action and reducer are generated by combining the uniqueness of the random character string, so that the uniqueness of the name of the reducer can be ensured, and the corresponding reducer can be correctly triggered when a certain action is triggered, so as to update data in the store.
In the asynchronous processing flow, the target update parameter information may further include asynchronous request parameter information, that is, option, and may generate a random character string of the id to obtain a second object identifier, that is, type, of the object to be updated. A reducer corresponding to the second object identifier may be generated based on the type and injected into a reducer pool, and an httpsiaga for sending the asynchronous request is created based on the parameter information of the asynchronous request, and a yield syntax in a programming language Python may be used inside the httpsiaga, and data returned based on the information of the asynchronous request is obtained, where the returned data is target variable data. The returned data can then be deposited into the payload of the action to create an action containing type.
Then, a dispatch trigger action can be issued, a reducer corresponding to the action is captured in a reducer pool based on the uniqueness of the second object identifier, and the reducer is operated, so that the object to be updated corresponding to the id is updated in the store according to the target variable data.
In the asynchronous processing flow, a random character string of the id is generated through the id transmitted by a user, and a reducer is registered in advance for an action to be triggered in a saga function before data is requested by combining the uniqueness of the random character string, so that the action can be triggered after the data request is successful, and the corresponding reducer can be found smoothly.
And the second object identifier, namely the type, of the object to be updated is obtained by generating the random character string of the id, so that the process which needs numerous repeated definitions and is easy to make mistakes is greatly simplified, the repeated definitions and writings are omitted, a public method is extracted, actions and reducers are associated through the type, different links are automatically transited, a developer does not need to care how the actions are generated and triggered when using the method, the reducers and the effects do not need to be manually created, and a complete data stream can be completed only by calling the data updating scheme. Moreover, the asynchronous processing flow does not need an additional processing scheme, and can be packaged together with the synchronous processing flow.
In addition, if the data in the store is to be acquired in the component, an objecthigh-order function is called, the key identification of the global object needing to acquire the data is transmitted in the first-order transmission, multi-parameter multi-data simultaneous acquisition is supported, and the component needing to acquire the data is transmitted in the second-order transmission and can comprise a series of variable data. Therefore, the method for repeatedly writing mapsitetopops in the component can be avoided, a developer calls a high-order function named objected, the first-order parameter is transmitted into a name list of global variables needing to acquire data and is separated by commas, data acquisition of a plurality of variables can be simultaneously realized, the second-order parameter is transmitted into a react component needing to acquire data, and the data can be acquired in the component through the props.
The method can be compatible with the original operations of the redux, the redux-saga and the like while simplifying a series of the redux operations, and can be used according to the official APIs of the redux and the redux-saga if other functions are required to be used.
The following describes a data update apparatus provided in an embodiment of the present invention.
Referring to fig. 3, a schematic structural diagram of a data updating apparatus according to an embodiment of the present invention is shown. As shown in fig. 3, the data update apparatus 300 includes:
a first obtaining module 301, configured to obtain update index information of an object to be updated, where the update index information includes a first object identifier of the object to be updated and target update parameter information;
a first generating module 302, configured to generate a random character string of the first object identifier, to obtain a second object identifier of the object to be updated;
a second generating module 303, configured to generate a target update function corresponding to the second object identifier;
a third generating module 304, configured to generate, based on the second object identifier and the target update parameter information, update trigger information corresponding to the second object identifier, where the update trigger information includes target variable data determined based on the target update parameter information;
and the updating triggering information is used for triggering the target updating function to update the object to be updated in a pre-established storage pool according to the target variable data.
Optionally, the third generating module 304 includes:
a first generating unit, configured to, when the target update parameter information does not include preset information, use the target update parameter information as the target variable data to generate the update trigger information;
the updating triggering information comprises the second object identifier, and the preset information is used for representing that the target variable data is obtained through an asynchronous request.
Optionally, the third generating module 304 includes:
the creating unit is used for creating and sending asynchronous request information based on the asynchronous request parameter information in the target updating parameter information under the condition that the target updating parameter information comprises preset information;
the acquisition unit is used for acquiring data returned based on the asynchronous request information;
a second generating unit, configured to use the returned data as the target variable data to generate the update trigger information;
the updating triggering information comprises the second object identifier, and the preset information is used for representing that the target variable data is obtained through an asynchronous request.
Optionally, the apparatus further comprises:
and the storage module is used for storing the target updating function into a pre-established data pool, and the data pool is used for storing the updating function of the global object.
Optionally, the apparatus further comprises:
a second obtaining module, configured to obtain, in response to the update trigger information, the target update function corresponding to the second object identifier from the data pool;
and the running module is used for running the target updating function so as to update the object to be updated in the storage pool according to the target variable data.
The data updating apparatus 300 can implement each process implemented in the above method embodiments, and is not described herein again to avoid repetition.
The following describes an electronic device provided in an embodiment of the present invention.
Referring to fig. 4, a schematic structural diagram of an electronic device provided by an embodiment of the present invention is shown. As shown in fig. 4, the electronic device 400 includes: a processor 401, a memory 402, a user interface 403 and a bus interface 404.
A processor 401 for reading the program in the memory 402, and executing the following processes:
acquiring update index information of an object to be updated, wherein the update index information comprises a first object identifier and target update parameter information of the object to be updated;
generating a random character string of the first object identifier to obtain a second object identifier of the object to be updated;
generating a target updating function corresponding to the second object identifier;
generating update triggering information corresponding to the second object identifier based on the second object identifier and the target update parameter information, wherein the update triggering information comprises target variable data determined based on the target update parameter information;
and the updating triggering information is used for triggering the target updating function to update the object to be updated in a pre-established storage pool according to the target variable data.
In FIG. 4, the bus architecture may include any number of interconnected buses and bridges, with one or more processors, represented by processor 401, and various circuits, represented by memory 402, being linked together. The bus architecture may also link together various other circuits such as peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further herein. Bus interface 404 provides an interface. The user interface 403 may also be an interface capable of interfacing externally to a desired device for different user devices, including but not limited to a keypad, display, speaker, microphone, joystick, etc.
The processor 401 is responsible for managing the bus architecture and general processing, and the memory 402 may store data used by the processor 401 in performing operations.
Optionally, the processor 401 is further configured to:
taking the target update parameter information as the target variable data to generate the update trigger information under the condition that the target update parameter information does not include preset information;
the updating trigger information comprises the second object identifier, and the preset information is used for representing that the target variable data is obtained through an asynchronous request.
Optionally, the processor 401 is further configured to:
under the condition that the target updating parameter information comprises preset information, establishing and sending asynchronous request information based on asynchronous request parameter information in the target updating parameter information;
acquiring data returned based on the asynchronous request information;
taking the returned data as the target variable data to generate the updating trigger information;
the updating triggering information comprises the second object identifier, and the preset information is used for representing that the target variable data is obtained through an asynchronous request.
Optionally, the processor 401 is further configured to:
and storing the target updating function into a pre-established data pool, wherein the data pool is used for storing the updating function of the global object.
Optionally, the processor 401 is further configured to:
responding to the updating trigger information, and acquiring the target updating function corresponding to the second object identifier from the data pool;
and running the target updating function to update the object to be updated in the storage pool according to the target variable data.
Preferably, an embodiment of the present invention further provides an electronic device, which includes a processor 401, a memory 402, and a computer program stored in the memory 402 and capable of running on the processor 401, where the computer program is executed by the processor 401 to implement each process of the data updating method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not described here again.
The embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements each process of the data updating method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the embodiments provided in the present application, it should be understood that the disclosed system and method may be implemented in other ways. For example, the above-described system embodiments are merely illustrative, and for example, the division of the units is only one type of logical functional division, and other divisions may be realized in practice, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment of the present invention.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions may be stored in a computer-readable storage medium if they are implemented in the form of software functional units and sold or used as separate products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a U disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (12)

1. A method for updating data, the method comprising:
acquiring update index information of an object to be updated, wherein the update index information comprises a first object identifier and target update parameter information of the object to be updated;
generating a random character string of the first object identifier to obtain a second object identifier of the object to be updated;
generating a target updating function corresponding to the second object identifier;
generating update trigger information corresponding to the second object identifier based on the second object identifier and the target update parameter information, wherein the update trigger information comprises target variable data determined based on the target update parameter information;
and the updating triggering information is used for triggering the target updating function to update the object to be updated in a pre-established storage pool according to the target variable data.
2. The method of claim 1, wherein the generating of the update trigger information corresponding to the second object identifier based on the second object identifier and the target update parameter information comprises:
taking the target update parameter information as the target variable data to generate the update trigger information under the condition that the target update parameter information does not include preset information;
the updating triggering information comprises the second object identifier, and the preset information is used for representing that the target variable data is obtained through an asynchronous request.
3. The method according to claim 1 or 2, wherein the generating of the update trigger information corresponding to the second object identifier based on the second object identifier and the target update parameter information includes:
under the condition that the target updating parameter information comprises preset information, establishing and sending asynchronous request information based on asynchronous request parameter information in the target updating parameter information;
acquiring data returned based on the asynchronous request information;
taking the returned data as the target variable data to generate the updating triggering information;
the updating triggering information comprises the second object identifier, and the preset information is used for representing that the target variable data is obtained through an asynchronous request.
4. The method of claim 1, wherein after generating the target update function corresponding to the second object identifier, the method further comprises:
and storing the target updating function into a pre-established data pool, wherein the data pool is used for storing the updating function of the global object.
5. The method of claim 4, wherein after storing the target update function in a pre-created data pool, the method further comprises:
responding to the updating trigger information, and acquiring the target updating function corresponding to the second object identifier from the data pool;
and running the target updating function to update the object to be updated in the storage pool according to the target variable data.
6. An apparatus for updating data, the apparatus comprising:
the system comprises a first acquisition module, a second acquisition module and a first updating module, wherein the first acquisition module is used for acquiring updating index information of an object to be updated, and the updating index information comprises a first object identifier and target updating parameter information of the object to be updated;
the first generation module is used for generating a random character string of the first object identifier to obtain a second object identifier of the object to be updated;
the second generating module is used for generating a target updating function corresponding to the second object identifier;
a third generating module, configured to generate, based on the second object identifier and the target update parameter information, update trigger information corresponding to the second object identifier, where the update trigger information includes target variable data determined based on the target update parameter information;
and the updating triggering information is used for triggering the target updating function to update the object to be updated in a pre-established storage pool according to the target variable data.
7. The apparatus of claim 6, wherein the third generating module comprises:
a first generating unit, configured to, when the target update parameter information does not include preset information, use the target update parameter information as the target variable data to generate the update trigger information;
the updating trigger information comprises the second object identifier, and the preset information is used for representing that the target variable data is obtained through an asynchronous request.
8. The apparatus of claim 6 or 7, wherein the third generating module comprises:
the creating unit is used for creating and sending asynchronous request information based on the asynchronous request parameter information in the target updating parameter information under the condition that the target updating parameter information comprises preset information;
the acquisition unit is used for acquiring data returned based on the asynchronous request information;
a second generating unit, configured to use the returned data as the target variable data to generate the update trigger information;
the updating trigger information comprises the second object identifier, and the preset information is used for representing that the target variable data is obtained through an asynchronous request.
9. The apparatus of claim 6, further comprising:
and the storage module is used for storing the target updating function into a pre-established data pool, and the data pool is used for storing the updating function of the global object.
10. The apparatus of claim 9, further comprising:
a second obtaining module, configured to obtain, in response to the update trigger information, the target update function corresponding to the second object identifier from the data pool;
and the running module is used for running the target updating function so as to update the object to be updated in the storage pool according to the target variable data.
11. An electronic device, characterized in that the electronic device comprises: comprising a processor, a memory, a computer program stored on said memory and executable on said processor, said computer program realizing the steps of the data updating method according to any of claims 1 to 5 when executed by said processor.
12. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, carries out the steps of the data updating method according to any one of claims 1 to 5.
CN202110788306.8A 2021-07-13 2021-07-13 Data updating method and device, electronic equipment and storage medium Pending CN115617333A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110788306.8A CN115617333A (en) 2021-07-13 2021-07-13 Data updating method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110788306.8A CN115617333A (en) 2021-07-13 2021-07-13 Data updating method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115617333A true CN115617333A (en) 2023-01-17

Family

ID=84856066

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110788306.8A Pending CN115617333A (en) 2021-07-13 2021-07-13 Data updating method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115617333A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117312349A (en) * 2023-11-21 2023-12-29 江苏中天互联科技有限公司 Data updating method based on industrial identification and related equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117312349A (en) * 2023-11-21 2023-12-29 江苏中天互联科技有限公司 Data updating method based on industrial identification and related equipment
CN117312349B (en) * 2023-11-21 2024-02-06 江苏中天互联科技有限公司 Data updating method based on industrial identification and related equipment

Similar Documents

Publication Publication Date Title
US9021440B1 (en) System and method for automated test script generation
CN105739983B (en) Shell script editing device and its implementation
CN110147225A (en) A kind of code generating method, device and computer equipment, storage medium
Maróti et al. Online collaborative environment for designing complex computational systems
CN110471694A (en) Annotation information processing method, device, computer equipment and storage medium
CN104217270A (en) Business process application file generating and execution methods, client, device and system
CN110764839A (en) Business processing flow configuration method, business request processing method and device
CN109191078A (en) A kind of traffic flow modeling method, device and equipment
CN115617333A (en) Data updating method and device, electronic equipment and storage medium
CN103699746B (en) CADDS5 piping three-dimensional design method based on data base and system
CN111258551A (en) Code generation method and device
JP4629183B2 (en) Requirement specification description support apparatus and method, and recording medium
CN113469284B (en) Data analysis method, device and storage medium
Schuler et al. Rule-based generation of mobile user interfaces
Rivero et al. Improving user involvement through a model-driven requirements approach
CN111124386B (en) Animation event processing method, device, equipment and storage medium based on Unity
US9052906B2 (en) Modularized customization of a model in a model driven development environment
JP2012048329A (en) Object oriented program generating device, method therefor and program
US8694293B2 (en) Simulation support method, computer-readable storage medium storing simulation support program, and simulation support apparatus
CN110647314A (en) Skill generation method and device and electronic equipment
Gijsbers et al. From OpenMI 1.4 to 2.0
CN117609102B (en) Building industry Internet counting platform system testing method
JP2012150740A (en) Program generating device and method
US20230128661A1 (en) Information retrieval framework
WO2020220889A1 (en) Method and device for generating script program, and script program processing system

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