Data updating method, device, electronic device and storage medium

By generating a random string as an object identifier and automatically creating update functions and trigger information, this solves the inefficiency problem caused by manually creating actions and reducers in front-end page development and achieves efficient storage pool object status updates.

CN115617333BActive Publication Date: 2025-09-05CHINA MOBILE M2M +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110788306.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-13
Publication Date
2025-09-05
Estimated Expiration
2041-07-13

AI Technical Summary

Technical Problem

In front-end page development, when using Redux to update the state of storage pool objects, it is necessary to manually create actions and reducers, resulting in low development efficiency.

Method used

By obtaining the update index information of the object to be updated, generating a random string as the second object identifier, and automatically creating the target update function and trigger information based on the identifier, the update is performed directly in the storage pool, eliminating the steps of manually creating actions and reducers.

Benefits of technology

It improves development efficiency, simplifies repetitive and error-prone processes, ensures the uniqueness and accuracy of the update process, and is applicable to both synchronous and asynchronous processing flows.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115617333B_ABST
    Figure CN115617333B_ABST
Patent Text Reader

Abstract

The present invention provides a data update method, apparatus, electronic device, and computer-readable storage medium. The method comprises: obtaining update index information of an object to be updated, the update index information including a first object identifier and target update parameter information of the object to be updated; generating a random string of characters for the first object identifier to obtain a second object identifier of the object to be updated; generating a target update function corresponding to the second object identifier; and generating update trigger information corresponding to the second object identifier based on the second object identifier and the target update parameter information, the update trigger information including target variable data determined based on the target update parameter information; wherein the update trigger information is used to trigger the target update function to update the object to be updated in a pre-created storage pool based on the target variable data. Embodiments of the present invention can significantly improve development efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of computer technology, and in particular, to a data updating method, device, electronic device, and computer-readable storage medium. Background Art

[0002] During the front-end page development process, redux can usually be used to manage the global data used by the front-end page. It can create a storage pool for state management and store the parameter data of each global object based on the storage pool.

[0003] Currently, updating the state of objects in a storage pool typically requires creating an update trigger action and an update function reducer. This action is then dispatched and captured by the corresponding reducer before the object state in the storage pool can be updated. This can lead to numerous redundant and similar actions and reducers when a project reaches a certain scale, resulting in low development efficiency. Summary of the Invention

[0004] Embodiments of the present invention provide a data update method, device, electronic device, and computer-readable storage medium to solve the problem of low development efficiency caused by manually creating actions and reducers when updating the status of objects in a storage pool in the prior art.

[0005] In a first aspect, an embodiment of the present invention provides a data updating method, the method comprising:

[0006] Acquire update index information of the object to be updated, where the update index information includes a first object identifier and target update parameter information of the object to be updated;

[0007] Generate a random character string of the first object identifier to obtain a second object identifier of the object to be updated;

[0008] generating a target update function corresponding to the second object identifier;

[0009] generating, based on the second object identifier and the target update parameter information, update trigger information corresponding to the second object identifier, the update trigger information including target variable data determined based on the target update parameter information;

[0010] The update trigger information is used to trigger the target update function to update the object to be updated according to the target variable data in a pre-created storage pool.

[0011] In a second aspect, an embodiment of the present invention provides a data updating device, the device comprising:

[0012] A first acquisition module is configured to acquire update index information of the object to be updated, wherein the update index information includes a first object identifier and target update parameter information of the object to be updated;

[0013] A first generating module, configured to generate a random character string for the first object identifier, and obtain a second object identifier for the object to be updated;

[0014] A second generating module, configured to generate a target update function corresponding to the second object identifier;

[0015] a third generating module, configured to generate 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 includes target variable data determined based on the target update parameter information;

[0016] The update trigger information is used to trigger the target update function to update the object to be updated according to the target variable data in a pre-created storage pool.

[0017] In a third aspect, an embodiment of the present invention provides an electronic device comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps of the above-mentioned data updating method when executed by the processor.

[0018] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned data updating method are implemented.

[0019] In an embodiment of the present invention, by obtaining the update index information of the object to be updated, the update index information includes the first object identifier and target update parameter information of the object to be updated; generating a random string of the first object identifier to obtain the second object identifier of the object to be updated; generating a target update function corresponding to the second object identifier; based on the second object identifier and the target update parameter information, generating update trigger information corresponding to the second object identifier, the update trigger information includes target variable data determined based on the target update parameter information; wherein the update trigger information is used to trigger the target update function to update the object to be updated in a pre-created storage pool according to the target variable data. In this way, actions and reducers can be automatically created based on the update index information of the object to be updated, and the corresponding reducer can be 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, thereby greatly improving development efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in describing the embodiments of the present invention. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0021] Figure 1 1 is a flow chart of a data updating method provided by an embodiment of the present invention;

[0022] Figure 2 It is a schematic diagram of the overall process of the data update method;

[0023] Figure 3 1 is a schematic structural diagram of a data updating device provided by an embodiment of the present invention;

[0024] Figure 4 It is a structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0025] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. All other embodiments derived by ordinary technicians in this field based on the embodiments of the present invention without creative work are within the scope of protection of the present invention.

[0026] The following first describes the application scenarios provided by the embodiments of the present invention.

[0027] In the process of front-end page development, Redux is usually used to manage the state of objects in the front-end page. Among them, it can manage the state of global objects in the front-end page. Global objects refer to objects that can be used across pages.

[0028] The global object can be an object-oriented structure, which can include many variables and variable parameters. That is to say, the global object can be a collection of variables and variable parameters. For example, the global object named "dataj" with the primary key key includes variables A, B, C and D, and their variable parameters are 1, 2, 1 and 3 respectively.

[0029] In related technologies, a data flow solution based on redux and redux-saga can be used in the front-end page development process. Specifically, the initialStore method can be used based on redux to create a repository store for object state management. The store acts as a container and can store initialized object data directly into the store.

[0030] The store includes a namespace, which is used to merge into the key identifier of the global object. The data set corresponding to each namespace is called the state. In the data flow solution of the storage pool, if you need to update the data in the store, you can manually create an action based on Redux with the same methods and properties as the store instance and the corresponding reducers.

[0031] Action may refer to update trigger information, which is a context object that may include the activation state, security information, and transaction processing state of the tracked object, such as the key identifier and variable data (including variables and variable parameters) of the global object.

[0032] Reducers are update functions, also known as action processors, that handle synchronous actions, calculate the latest state, and update the store data. When an action is triggered, the reducers corresponding to the action are captured based on the key identifier of the global object and run to process the action, updating the store data.

[0033] When the data update process includes asynchronous processing, that is, you need to request the interface first, wait for the data to be returned, and then update the object state, you can use middleware such as redux-saga to manually create effects. Effects can also be called action processors, which can handle asynchronous actions.

[0034] In related technologies, using data flow solutions based on Redux and Redux-saga for data updates requires manual creation of actions, reducers, and effects. On the one hand, the manual creation process is tedious and error-prone. On the other hand, when the project reaches a certain scale, many extremely redundant and similar actions and reducers may appear, resulting in low development efficiency.

[0035] Based on this, an embodiment of the present invention provides a new data update solution to solve the problem of low development efficiency during the front-end page development process.

[0036] The data updating method provided by the embodiment of the present invention is described below.

[0037] It should be noted that the data update method provided in the embodiments of the present invention relates to the field of computer technology and can be widely applied to front-end page development systems. The method can be executed by the data update device in the embodiments of the present invention. The data update device can be configured in any electronic device to execute the data update method. The electronic device can be a server or a terminal, and the specific limitations are not set forth herein.

[0038] See also Figure 1 , the figure shows a flow chart of the data updating method provided by an embodiment of the present invention. Figure 1 As shown, the method may include the following steps:

[0039] Step 101: Acquire update index information of an object to be updated, where the update index information includes a first object identifier and target update parameter information of the object to be updated.

[0040] In this embodiment, data update may refer to updating the data in the store. There are two types of updates. The first is addition, that is, if the object or variable to be updated does not appear in the store, the object or variable and related parameters are added. The second is modification, that is, if the object or variable to be updated appears in the store, the parameters of the object or variable are modified.

[0041] The object to be updated may refer to a global object, which can be used not only in the current front-end page but also across pages.

[0042] Update index information may refer to the information needed to update the data in sotre, which includes at least the first object identifier of the object to be updated and target update parameter information. The first object identifier may be a key identifier, and the target update parameter information may refer to the information needed to determine the variable data that needs to be modified, that is, the target variable data.

[0043] The target update parameter information is different in different processing flows. For example, in a synchronous processing flow, the target update parameter information may be target variable data, including the variables and variable parameters to be modified.

[0044] For another example, in an asynchronous processing flow, the target update parameter information may include an identifier for sending an asynchronous request and the jump information required for asynchronous processing, such as which process to jump to. By determining whether the target update parameter information includes the identifier, it can be determined whether the data update flow is a synchronous processing flow or an asynchronous processing flow, and the corresponding data update flow can be processed.

[0045] There are many ways to obtain the update index information, such as receiving the update index information input by the user, obtaining pre-stored update index information, or receiving the update index information sent by other electronic devices.

[0046] Step 102: Generate a random character string of the first object identifier to obtain a second object identifier of the object to be updated.

[0047] In this step, the first object identifier is different, the random string of the first object identifier is different, and the random string is unique relative to the first object identifier, that is, the object identifier of the global object and the random string are in a one-to-one correspondence.

[0048] An application programming interface (API), such as the random string generator in ES6, can be called to generate a random string for the first object identifier. Specifically, the first object identifier can be passed into the random string generator so that the random string generator outputs a unique string corresponding to the first object identifier. The unique string is the second object identifier of the object to be updated, which is used to create an action and a reducer.

[0049] Step 103: Generate a target update function corresponding to the second object identifier.

[0050] In this step, the target update function is the update function of the object to be updated, that is, the reducer of the object to be updated.

[0051] The reducer can be a series of if and else judgments, and during the judgment process, the reducer can make judgments based on the second object identifier. Accordingly, when the if judgment statement about the second object identifier is triggered, the data of the object to be updated can be updated in the store accordingly, and when the else judgment statement is triggered, other processing can be performed.

[0052] Step 104: Generate 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 includes target variable data determined based on the target update parameter information.

[0053] In this step, the update trigger information can be an action, which is an action with the same methods and properties as the store instance. The action may include relevant information of the global object being tracked in the store, including the activation status, security information and transaction processing status of the tracked object.

[0054] The action may include a second object identifier and target variable data determined based on the target update parameter information, and the second object identifier and the key identifier are in a corresponding relationship.

[0055] This action can be used to trigger the reducer to capture the processing function associated with the second object identifier in the action to update the state of the object to be updated in the store. If the target variable data included in the action includes variable A and variable parameter 2, the action can trigger the reducer to capture the processing function associated with the second object identifier in the action to modify the variable parameter of variable A in the object to be updated to 2 in the store, where the object to be updated can be the global object identified by the key corresponding to the second object identifier.

[0056] There are two situations in which the variable parameter of variable A in the object to be updated in the store is changed to 2. One is that variable A does not exist in the object to be updated. In this case, variable A is added to the object to be updated in the store, and its variable parameter is 2. The other is that variable A exists in the object to be updated and its variable parameter is 1. In this case, the variable parameter of variable A is changed from 1 to 2 in the object to be updated in the store.

[0057] In addition, when updating data, multiple variable data in the object to be updated can be modified simultaneously based on one action, such as the data of variable A, variable B, and variable C. That is, the action can include all variable data in the object to be updated that need to be modified at one time.

[0058] In this embodiment, by obtaining the update index information of the object to be updated, the update index information includes the first object identifier and target update parameter information of the object to be updated; generating a random string of the first object identifier to obtain the second object identifier of the object to be updated; generating a target update function corresponding to the second object identifier; based on the second object identifier and the target update parameter information, generating the update trigger information corresponding to the second object identifier, the update trigger information includes target variable data determined based on the target update parameter information; wherein the update trigger information is used to trigger the target update function to update the object to be updated in a pre-created storage pool according to the target variable data. In this way, the action and reducer can be automatically created based on the update index information of the object to be updated, and the corresponding reducer can be captured based on the action, so that the update of the object to be updated in the storage pool can be realized based on the target variable data in the action, thereby eliminating tedious and error-prone links and greatly improving development efficiency.

[0059] In addition, the process of manually creating actions, reducers, and effects is eliminated, and there is no need to maintain a separate model. By generating a random string corresponding to the id as the association between the action and the reducer, when the action is triggered, only the reducer corresponding to the random string needs to be called, without following any naming constraints and specifications.

[0060] Optionally, step S104 specifically includes:

[0061] In a case where the target update parameter information does not include preset information, using the target update parameter information as the target variable data to generate the update trigger information;

[0062] The update trigger information includes the second object identifier, and the preset information is used to indicate that the target variable data is obtained through an asynchronous request.

[0063] Optionally, step S102 specifically includes:

[0064] In a case where the target update parameter information includes preset information, creating and sending asynchronous request information based on the asynchronous request parameter information in the target update parameter information;

[0065] Obtaining data returned based on the asynchronous request information;

[0066] Using the returned data as the target variable data to generate the update trigger information;

[0067] The update trigger information includes the second object identifier, and the preset information is used to indicate that the target variable data is obtained through an asynchronous request.

[0068] Optionally, after the target S103, the method further includes:

[0069] The target update function is stored in a pre-created data pool, where the data pool is used to store update functions of global objects.

[0070] Optionally, after storing the target update function in a pre-created data pool, the method further includes:

[0071] In response to the update trigger information, obtaining the target update function corresponding to the second object identifier from the data pool;

[0072] The target update function is run to update the object to be updated in the storage pool according to the target variable data.

[0073] In this embodiment, there are two types of data processing flows, namely a synchronous processing flow and an asynchronous processing flow. The difference between the synchronous processing flow and the asynchronous processing flow lies in the different methods of obtaining target variable data.

[0074] In synchronous processing, the target variable data can be specified variable data. For example, if the target variable data is user-specified, the update index information of the object to be updated that the user passes in includes the variable data, which can be the target update parameter information. In asynchronous processing, the target variable data can be the data returned after asynchronous processing. The required asynchronous processing can be determined based on the asynchronous request parameter information in the target update parameter information.

[0075] For details, see Figure 2 , Figure 2 This is the overall flow chart of the data update method, such as Figure 2 As shown, when creating a state management store, in addition to directly storing the data to be initialized in the store, you also need to create and define a data pool, also known as a reducer pool. This data pool is used to store the processing functions of global objects in the store so that they can be injected when dynamically creating reducers. You also need to register the redux-saga middleware for use when asynchronously requesting data.

[0076] The user can pass in the update index information of the object to be updated. The user can limit the data processing flow, and after limiting the data processing flow, different update index information can be passed in.

[0077] like Figure 2 As shown, the update index information may include an ID, i.e., a first object identifier. This ID may be a key identifier for a global object in the store, which is the object to be updated. The update index information may also include target update parameter information, and the target update parameter information may vary depending on the data processing flow.

[0078] The target update parameter information may include args, which may be a string. The data processing flow may be determined by judging whether the string includes preset information. The preset information may be used to indicate that the target variable data needs to be obtained through an asynchronous request.

[0079] If it is determined that the character string includes preset information, the current data processing flow may be determined to be an asynchronous processing flow. If it is determined that the character string does not include preset information, the current data processing flow may be determined to be a synchronous processing flow.

[0080] The preset information can be set according to actual conditions. In an optional implementation, the preset information can be a " / " character. When args does not include a " / " character, the arg can be the specified target variable data, and the synchronous processing flow 201 is executed. When args includes a " / " character, the arg can be an identifier that requires asynchronous processing, and the asynchronous processing flow 202 is executed.

[0081] Specifically, during the synchronization process, a random string of the id can be generated to obtain the second object identifier (type) of the object to be updated. Based on the type, an action and reducer corresponding to the second object identifier can be generated. The action can include a property named payload, which stores the target variable data. args can be stored in the action's payload, and the reducer can then be injected into the reducer pool.

[0082] Afterwards, you can use dispatch to trigger an action. Based on the uniqueness of the second object identifier, capture the reducer corresponding to the action in the reducer pool and run the reducer to update the object to be updated corresponding to the id in the store according to the target variable data.

[0083] In the synchronous processing flow, a random string is generated based on the ID passed in by the user. Combined with the uniqueness of the random string, the corresponding action and reducer are generated. This not only ensures the uniqueness of the reducer name, but also ensures that when an action is triggered, the corresponding reducer can be correctly triggered to update the data in the store.

[0084] In the asynchronous processing flow, the target update parameter information can also include asynchronous request parameter information, namely option. A random string of this id can be generated to obtain the second object identifier, namely type, of the object to be updated. Based on this type, a reducer corresponding to the second object identifier can be generated and injected into the reducer pool. Simultaneously, an httpSaga for sending the asynchronous request is created based on the asynchronous request parameter information. This saga can use the yield syntax in the Python programming language and retrieve the data returned based on the asynchronous request information. This returned data is the target variable data. This returned data can then be stored in the action payload to create an action containing type.

[0085] Afterwards, you can use dispatch to trigger an action. Based on the uniqueness of the second object identifier, capture the reducer corresponding to the action in the reducer pool and run the reducer to update the object to be updated corresponding to the id in the store according to the target variable data.

[0086] In the asynchronous processing flow, a random string is generated based on the ID passed in by the user. Combined with the uniqueness of the random string, a reducer is pre-registered for the action to be triggered in the saga function before requesting data. This ensures that the action is triggered after the data request is successful, and its corresponding reducer can be found smoothly.

[0087] Furthermore, by generating a random string for the id, the second object identifier, or type, of the object to be updated is obtained. This greatly simplifies the error-prone process that requires numerous repeated definitions, eliminating the need for repetitive writing and extracting it into a public method. By associating actions and reducers through the type, the transition between different links is automatic. Developers don't need to worry about how actions are generated and triggered, nor do they need to manually create reducers and effects. They only need to call the data update solution to complete a complete data flow. Furthermore, the asynchronous processing flow does not require additional processing solutions and can be encapsulated together with the synchronous processing flow.

[0088] In addition, if you want to obtain data from the store in a component, call the inject higher-order function. The first parameter is the key identifier of the global object for which you want to obtain data. It supports simultaneous retrieval of multiple parameters and multiple data. The second parameter is the component for which you want to obtain data. This component can include a series of variable data. This way, you can avoid repeatedly writing the mapStateToProps method in the component. By encapsulating this method, developers can call a higher-order function named inject. The first parameter is the list of global variable names for which data is to be obtained, separated by commas. This allows you to obtain data from multiple variables at the same time. The second parameter is the react component for which you want to obtain data. The data can be obtained in the component through props.

[0089] While simplifying a series of redux operations, it is also compatible with native operations such as redux and redux-saga. If you need to use other functions, you can use them according to the official redux and redux-saga APIs.

[0090] The data updating device provided by the embodiment of the present invention is described below.

[0091] See also Figure 3 , the figure shows a schematic diagram of the structure of the data updating device provided by the embodiment of the present invention. Figure 3 As shown, the data updating device 300 includes:

[0092] A first acquisition module 301 is configured to acquire update index information of an object to be updated, wherein the update index information includes a first object identifier and target update parameter information of the object to be updated;

[0093] A first generating module 302 is configured to generate a random string of the first object identifier to obtain a second object identifier of the object to be updated;

[0094] A second generating module 303 is configured to generate a target update function corresponding to the second object identifier;

[0095] A third generating module 304 is configured to generate 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 includes target variable data determined based on the target update parameter information;

[0096] The update trigger information is used to trigger the target update function to update the object to be updated according to the target variable data in a pre-created storage pool.

[0097] Optionally, the third generating module 304 includes:

[0098] a first generating unit, configured to use the target update parameter information as the target variable data to generate the update trigger information when the target update parameter information does not include preset information;

[0099] The update trigger information includes the second object identifier, and the preset information is used to indicate that the target variable data is obtained through an asynchronous request.

[0100] Optionally, the third generating module 304 includes:

[0101] a creating unit, configured to create and send asynchronous request information based on the asynchronous request parameter information in the target update parameter information when the target update parameter information includes preset information;

[0102] An acquiring unit, configured to acquire data returned based on the asynchronous request information;

[0103] a second generating unit, configured to use the returned data as the target variable data to generate the update trigger information;

[0104] The update trigger information includes the second object identifier, and the preset information is used to indicate that the target variable data is obtained through an asynchronous request.

[0105] Optionally, the device further includes:

[0106] The storage module is used to store the target update function in a pre-created data pool, and the data pool is used to store the update function of the global object.

[0107] Optionally, the device further includes:

[0108] A second acquisition module, configured to respond to the update trigger information and acquire the target update function corresponding to the second object identifier from the data pool;

[0109] An operating module is used to operate the target update function to update the object to be updated in the storage pool according to the target variable data.

[0110] The data updating device 300 can implement each process implemented in the above method embodiment, and will not be described again here to avoid repetition.

[0111] The electronic device provided by the embodiment of the present invention is described below.

[0112] See also Figure 4 , the figure shows a schematic diagram of the structure of the electronic device provided by the embodiment of the present invention. Figure 4 As shown, the electronic device 400 includes a processor 401 , a memory 402 , a user interface 403 and a bus interface 404 .

[0113] The processor 401 is configured to read the program in the memory 402 and execute the following process:

[0114] Acquire update index information of the object to be updated, where the update index information includes a first object identifier and target update parameter information of the object to be updated;

[0115] Generate a random character string of the first object identifier to obtain a second object identifier of the object to be updated;

[0116] generating a target update function corresponding to the second object identifier;

[0117] generating, based on the second object identifier and the target update parameter information, update trigger information corresponding to the second object identifier, the update trigger information including target variable data determined based on the target update parameter information;

[0118] The update trigger information is used to trigger the target update function to update the object to be updated according to the target variable data in a pre-created storage pool.

[0119] exist Figure 4 In the embodiment, the bus architecture may include any number of interconnected buses and bridges, specifically linking together various circuits of one or more processors represented by processor 401 and memory represented by memory 402. The bus architecture may also link together various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are all well known in the art and, therefore, will not be further described herein. Bus interface 404 provides an interface. For different user devices, user interface 403 may also be an interface capable of connecting external or internal devices as required, including but not limited to keypads, displays, speakers, microphones, joysticks, etc.

[0120] The processor 401 is responsible for managing the bus architecture and general processing, and the memory 402 can store data used by the processor 401 when performing operations.

[0121] Optionally, the processor 401 is further configured to:

[0122] In a case where the target update parameter information does not include preset information, using the target update parameter information as the target variable data to generate the update trigger information;

[0123] The update trigger information includes the second object identifier, and the preset information is used to indicate that the target variable data is obtained through an asynchronous request.

[0124] Optionally, the processor 401 is further configured to:

[0125] In a case where the target update parameter information includes preset information, creating and sending asynchronous request information based on the asynchronous request parameter information in the target update parameter information;

[0126] Obtaining data returned based on the asynchronous request information;

[0127] Using the returned data as the target variable data to generate the update trigger information;

[0128] The update trigger information includes the second object identifier, and the preset information is used to indicate that the target variable data is obtained through an asynchronous request.

[0129] Optionally, the processor 401 is further configured to:

[0130] The target update function is stored in a pre-created data pool, where the data pool is used to store update functions of global objects.

[0131] Optionally, the processor 401 is further configured to:

[0132] In response to the update trigger information, obtaining the target update function corresponding to the second object identifier from the data pool;

[0133] The target update function is run to update the object to be updated in the storage pool according to the target variable data.

[0134] Preferably, an embodiment of the present invention also provides an electronic device, including a processor 401, a memory 402, and a computer program stored in the memory 402 and executable on the processor 401. When the computer program is executed by the processor 401, each process of the above-mentioned data update method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.

[0135] An embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon. When executed by a processor, the computer program implements the various processes of the above-described data update method embodiment and achieves the same technical effects. To avoid repetition, the details are not described here. The computer-readable storage medium may be, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0136] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.

[0137] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0138] In the embodiments provided in this application, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0139] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected according to actual needs to achieve the objectives of the embodiments of the present invention.

[0140] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0141] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes various media that can store program code, such as a USB flash drive, a mobile hard drive, ROM, RAM, a magnetic disk, or an optical disk.

[0142] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.

Claims

1. A data updating method, characterized in that: The method comprises: Obtain update index information of the object to be updated, the update index information including the first object identifier of the object to be updated and target update parameter information; in a synchronous processing flow, the target update parameter information is target variable data; in an asynchronous processing flow, the target update parameter information includes an identification identifier for sending an asynchronous request and jump information for the asynchronous processing; Generate a random character string of the first object identifier to obtain a second object identifier of the object to be updated; generating a target update function corresponding to the second object identifier; generating, based on the second object identifier and the target update parameter information, update trigger information corresponding to the second object identifier, the update trigger information including target variable data determined based on the target update parameter information; The update trigger information is used to trigger the target update function to update the object to be updated according to the target variable data in a pre-created storage pool.

2. The method according to claim 1, characterized in that The generating, based on the second object identifier and the target update parameter information, update trigger information corresponding to the second object identifier includes: In a case where the target update parameter information does not include preset information, using the target update parameter information as the target variable data to generate the update trigger information; The update trigger information includes the second object identifier, and the preset information is used to indicate that the target variable data is obtained through an asynchronous request.

3. The method according to claim 1 or 2, characterized in that The generating, based on the second object identifier and the target update parameter information, update trigger information corresponding to the second object identifier includes: In a case where the target update parameter information includes preset information, creating and sending asynchronous request information based on the asynchronous request parameter information in the target update parameter information; Obtaining data returned based on the asynchronous request information; Using the returned data as the target variable data to generate the update trigger information; The update trigger information includes the second object identifier, and the preset information is used to indicate that the target variable data is obtained through an asynchronous request.

4. The method according to claim 1, wherein After generating the target update function corresponding to the second object identifier, the method further includes: The target update function is stored in a pre-created data pool, where the data pool is used to store update functions of global objects.

5. The method according to claim 4, characterized in that After storing the target update function in a pre-created data pool, the method further includes: In response to the update trigger information, obtaining the target update function corresponding to the second object identifier from the data pool; The target update function is run to update the object to be updated in the storage pool according to the target variable data.

6. A data updating device, characterized in that: The device comprises: a first acquisition module, configured to acquire update index information of an object to be updated, the update index information including a first object identifier of the object to be updated and target update parameter information; in a synchronous processing flow, the target update parameter information is target variable data; in an asynchronous processing flow, the target update parameter information includes an identification identifier for sending an asynchronous request and jump information for the asynchronous processing; A first generating module, configured to generate a random character string for the first object identifier, and obtain a second object identifier for the object to be updated; A second generating module, configured to generate a target update function corresponding to the second object identifier; a third generating module, configured to generate 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 includes target variable data determined based on the target update parameter information; The update trigger information is used to trigger the target update function to update the object to be updated according to the target variable data in a pre-created storage pool.

7. The device according to claim 6, characterized in that The third generation module includes: a first generating unit, configured to use the target update parameter information as the target variable data to generate the update trigger information when the target update parameter information does not include preset information; The update trigger information includes the second object identifier, and the preset information is used to indicate that the target variable data is obtained through an asynchronous request.

8. The device according to claim 6 or 7, characterized in that The third generation module includes: a creating unit, configured to create and send asynchronous request information based on the asynchronous request parameter information in the target update parameter information when the target update parameter information includes preset information; An acquiring unit, configured to acquire 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 update trigger information includes the second object identifier, and the preset information is used to indicate that the target variable data is obtained through an asynchronous request.

9. The device according to claim 6, characterized in that The device further comprises: The storage module is used to store the target update function in a pre-created data pool, and the data pool is used to store the update function of the global object.

10. The device according to claim 9, characterized in that The device further comprises: A second acquisition module, configured to respond to the update trigger information and acquire the target update function corresponding to the second object identifier from the data pool; An operating module is used to operate the target update function 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: a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps of the data updating method according to any one of claims 1 to 5 when executed by the processor.

12. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the data updating method according to any one of claims 1 to 5.