Event chain generation method and electronic device
By constructing an event chain diagram and adjusting the initial transfer probability, combining user feedback and similarity of historical events, the problem of lack of historical memory and targeted event chains in the existing technology is solved, and a more reasonable event chain generation is achieved.
Patent Information
- Application Number
- CN202411839974.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-04-08
AI Technical Summary
The event chains in existing game scenarios are generated based on Markov chains, lacking historical memory capabilities, resulting in the generated event chains being targeted and rational.
By constructing an event chain diagram, the initial transfer probability of the current event being transferred to the next event is obtained, and the first probability of occurrence of historical events is calculated based on user feedback, event similarity, time interval and time decay coefficient in the historical event set, and the initial transfer probability is adjusted to generate a more targeted and reasonable event chain.
By considering the impact of historical events on the current event transfer probability, the generated event chain is more targeted and reasonable, improving the controllability and flexibility of the event chain.
Smart Images

Figure CN119770956A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of event chain generation, and in particular to an event chain generation method and electronic device. Background Art
[0002] At present, the event chain in the game scene is generally generated based on the Markov chain, that is, the next event is predicted and generated based on the result of the previous event and the current state. It has a certain degree of randomness but no historical memory ability, and cannot be linked with historical events, resulting in the generated event chain being non-targeted and lacking a certain degree of rationality. Summary of the invention
[0003] The main purpose of the embodiments of the present application is to propose an event chain generation method and electronic device, which aims to consider the impact of historical events on the initial transition probability of the current event to the next event, adjust the initial transition probability, and make the generated event chain more targeted and reasonable.
[0004] To achieve the above object, a first aspect of an embodiment of the present application proposes an event chain generation method, the method comprising:
[0005] Constructing an event chain graph, wherein each node in the event chain graph represents an event, the edges between the nodes represent the transition relationship between the events, and the weight of the edge represents the transition probability;
[0006] According to the event chain diagram, obtaining an initial transition probability from a current event to a next event in the event chain diagram;
[0007] Acquire a historical event set, and calculate a first occurrence probability of the historical event set under the condition that the current event occurs according to user feedback corresponding to the historical events in the historical event set, the similarity between the historical events and the current event, the time interval between the historical events and the current event, and the time decay coefficient;
[0008] The initial transfer probability is adjusted according to the first occurrence probability, or according to at least one of the second occurrence probability of the user's current state under the condition that the current event occurs and the third occurrence probability of the current environmental conditions under the condition that the current event occurs, and the first occurrence probability, to obtain an event chain diagram after the transfer probability is adjusted.
[0009] In one embodiment of the present application, according to user feedback corresponding to historical events in the historical event set, the similarity between the historical events and the current event, the time interval between the historical events and the current event, and the time decay coefficient, calculating the first occurrence probability of the historical event set under the condition that the current event occurs includes:
[0010] Obtaining user feedback corresponding to historical events in the historical event set according to the user's historical behavior records, and characterizing the user feedback corresponding to historical events in the historical event set with importance weights;
[0011] Calculate the similarity between the historical event and the current event according to the transition path from the historical event to the current event, the transition path length, and the initial transition probability;
[0012] According to the occurrence time of the historical event and the occurrence time of the current event, obtaining the time interval between the historical event and the current event;
[0013] The first occurrence probability of the historical event set under the condition that the current event occurs is calculated based on the importance weight, the similarity between the historical event and the current event, the time interval between the historical event and the current event, and the time decay coefficient.
[0014] In one embodiment of the present application, the similarity between the historical event and the current event is calculated based on the transition path from the historical event to the current event, the transition path length, and the initial transition probability by the following formula:
[0015]
[0016] In the formula, E k represents the kth historical event, E i Indicates the current event, sim(E k ,E i ) indicates historical event E k With current events i The similarity between them, n represents the kth historical event E k Transfer to current event E i The number of transfer paths, λ represents the regularization parameter, which is a constant value, L i represents the length of the i-th transfer path, p i represents the weight of the i-th transfer path, where historical event E k Transfer to current event E i The initial transition probability is used as the weight.
[0017] In one embodiment of the present application, the calculation of the first occurrence probability of the historical event set under the condition that the current event occurs is performed by the following formula based on the importance weight, the similarity between the historical event and the current event, the time interval between the historical event and the current event, and the time decay coefficient:
[0018]
[0019] In the formula, P(H|Ei) represents the i The first occurrence probability of the historical event set H under the condition of occurrence, ω k Represents the kth historical event E k The corresponding importance weight, sim(E k ,E i ) indicates historical event E k With current events i The similarity between them, N represents the number of historical events in the historical event set H, λ represents the regularization parameter, which is a constant value, t k Represents the kth historical event E k With current events i time interval.
[0020] In one embodiment of the present application, adjusting the initial transition probability according to the first occurrence probability includes:
[0021] Obtaining an initial probability of occurrence of the current event and a first marginal probability corresponding to the set of historical events;
[0022] Multiplying the first occurrence probability by the initial probability of the current event and then dividing the result by the first marginal probability to obtain a first adjustment coefficient;
[0023] The initial transfer probability is adjusted according to the first adjustment coefficient.
[0024] In one embodiment of the present application, adjusting the initial transition probability according to the second occurrence probability of the user's current state under the condition that the current event occurs and the first occurrence probability includes:
[0025] Obtaining an initial probability of the current event occurring, a first marginal probability corresponding to the historical event set, and a second marginal probability corresponding to the current state of the user;
[0026] Multiplying the first occurrence probability, the second occurrence probability and the initial probability of the current event and then dividing by the first marginal probability and the second marginal probability to obtain a second adjustment coefficient;
[0027] The initial transition probability is adjusted according to the second adjustment coefficient.
[0028] In one embodiment of the present application, adjusting the initial transition probability according to the third occurrence probability of the current environmental condition under the condition that the current event occurs and the first occurrence probability includes:
[0029] Obtaining an initial probability of occurrence of the current event, a first marginal probability corresponding to the historical event set, and a third marginal probability corresponding to the current environmental condition;
[0030] The first occurrence probability, the third occurrence probability and the initial probability of the current event occurring are multiplied, and then divided by the first marginal probability and the third marginal probability to obtain a third adjustment coefficient;
[0031] The initial transfer probability is adjusted according to the third adjustment coefficient.
[0032] In one embodiment of the present application, adjusting the initial transition probability according to a second occurrence probability of the user's current state under the condition that the current event occurs, a third occurrence probability of the current environmental condition under the condition that the current event occurs, and the first occurrence probability includes:
[0033] Obtaining an initial probability of the current event occurring, a first marginal probability corresponding to the historical event set, a second marginal probability corresponding to the user's current state, and a third marginal probability corresponding to the current environmental condition;
[0034] The first occurrence probability, the second occurrence probability, the third occurrence probability and the initial probability of the current event are multiplied and then divided by the first marginal probability, the second marginal probability and the third marginal probability to obtain a fourth adjustment coefficient;
[0035] The initial transfer probability is adjusted according to the fourth adjustment coefficient.
[0036] In one embodiment of the present application, the initial transition probability is adjusted according to the second occurrence probability of the user's current state under the condition that the current event occurs, the third occurrence probability of the current environmental condition under the condition that the current event occurs, and the first occurrence probability by the following formula:
[0037]
[0038] In the formula, P(E j |E i ,H,S,C) represents the initial transition probability adjusted based on the historical event set, the user's current state and the current environmental conditions, P(E j |E i ) indicates that from the current event E i Move to next event E j The initial transition probability, P(H|Ei) represents the initial transition probability of the current event E i The first probability of occurrence of the historical event set H under the condition that the current event E iThe second probability of the user's current state S under the condition that the current event E occurs, P(C|Ei) represents the probability of the user's current state S under the condition that the current event E occurs. i The third probability of occurrence of the current environmental condition C under the condition of occurrence, P(E i ) indicates the current event E i The initial probability of occurrence, P(H) represents the first marginal probability corresponding to the historical event set H, P(S) represents the second marginal probability corresponding to the user's current state S, and P(C) represents the third marginal probability corresponding to the current environmental condition C.
[0039] To achieve the above-mentioned purpose, the second aspect of an embodiment of the present application proposes an electronic device, which includes a memory and a processor, the memory stores a computer program, and the processor implements the method described in any embodiment of the present application when executing the computer program.
[0040] In the technical solution provided in an embodiment of the present application, by obtaining a historical event set, and according to the user feedback corresponding to the historical events in the historical event set, the similarity between the historical events and the current event, the time interval between the historical events and the current event, and the time decay coefficient, the first occurrence probability of the historical event set under the condition that the current event occurs can be calculated. Thus, the initial transition probability of the current event to the next event in the event chain diagram can be further adjusted according to the first occurrence probability, fully considering the impact of historical events on the transition probability, and making the event chain diagram after the transition probability adjustment more targeted and reasonable. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 is a flowchart of the event chain generation method provided in Example 1 of the present application;
[0042] Figure 2 is a schematic diagram of an event chain diagram provided by an embodiment of the present application;
[0043] Figure 3 A flowchart of the steps of calculating the first occurrence probability of a historical event set under the condition that a current event occurs, according to user feedback corresponding to historical events in the historical event set, the similarity between the historical event and the current event, the time interval between the historical event and the current event, and the time decay coefficient, provided by an embodiment of the present application;
[0044] Figure 4 is a flowchart of the steps of adjusting the initial transition probability according to the first occurrence probability provided by an embodiment of the present application;
[0045] Figure 5 is a flow chart of the event chain generation method provided in Example 2 of the present application;
[0046] Figure 6It is a flowchart of the steps of adjusting the initial transition probability according to the second occurrence probability and the first occurrence probability of the user's current state under the condition that the current event occurs, provided by an embodiment of the present application;
[0047] Figure 7 is a flowchart of the event chain generation method provided in Example 3 of the present application;
[0048] Figure 8 It is a flowchart of the steps of adjusting the initial transition probability according to the third occurrence probability and the first occurrence probability of the current environmental condition under the condition that the current event occurs, provided by an embodiment of the present application;
[0049] Fig. 9 is a flowchart of the event chain generation method provided in Example 4 of the present application;
[0050] Fig.10 It is a flowchart of the steps of adjusting the initial transition probability according to the second occurrence probability of the user's current state under the condition that the current event occurs, the third occurrence probability of the current environmental condition under the condition that the current event occurs, and the first occurrence probability provided by an embodiment of the present application;
[0051] Fig.11 It is a schematic diagram of the hardware structure of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0053] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0054] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0055] In the metaverse and complex virtual worlds, dynamically generated event chains are very important. They can ensure that events in the game are more causal and improve the controllability and flexibility of the game.
[0056] However, the event chains in current game scenarios are generally generated based on Markov chains, that is, the next event is predicted and generated based on the result of the previous event and the current state. It has a certain degree of randomness but no historical memory ability, and cannot be linked with historical events, resulting in the generated event chain being non-targeted and lacking certain rationality.
[0057] Based on this, an embodiment of the present application proposes an event chain generation method, which aims to consider the impact of historical events on the initial transition probability of the current event to the next event, and adjust the initial transition probability to make the generated event chain more targeted and reasonable.
[0058] Embodiment 1
[0059] Reference Figure 1 , Figure 1 It is a flowchart of the event chain generation method provided in Example 1 of the present application, including but not limited to steps S110 to S140.
[0060] Step S110, constructing an event chain diagram, wherein each node in the event chain diagram represents an event, the edges between the nodes represent the transition relationship between the events, and the weight of the edge represents the transition probability.
[0061] In the embodiment of the present application, the event chain diagram refers to a structure that graphically represents the dependency relationship and transition probability between events. In the event chain diagram, each node represents an event, the edge between the nodes represents the transition relationship between the events, and the weight of the edge represents the transition probability. The transition probability represents the probability of transitioning from one event to another event.
[0062] For example, a game level is designed in which the player plays the role of a brave explorer whose task is to explore an unknown island and search for the legendary treasure, which includes the following events:
[0063] E1: start node;
[0064] E2: Discover the natives [explorer conditions improved];
[0065] E3: Make friends with the natives [speech skills improved];
[0066] E4: Enmity with the natives;
[0067] E5: Discover the mysterious cave;
[0068] E6: Trapped in a swamp trap;
[0069] E7: Found ancient map fragments in the cave;
[0070] E8: Successfully decipher the ancient map in the cave [Fragment N>10 condition improvement];
[0071] E9: Find the treasure.
[0072] By defining the relationship between each event, we can construct Figure 2 The event chain diagram shown in Figure 2 As shown, the initial transition probability P(E2|E1) from event E1 to event E2 is 0.5, the initial transition probability P(E5|E1) from event E1 to event E5 is 0.01, the initial transition probability P(E3|E2) from event E2 to event E3 is 0.7, the initial transition probability P(E4|E2) from event E2 to event E4 is 0.3, the initial transition probability P(E5|E3) from event E3 to event E5 is 0.9, and the initial transition probability P(E3|E4) from event E4 to event E3 is 0.0 1, the initial transition probability P(E5|E4) from event E4 to event E5 is 0.01, the initial transition probability P(E6|E5) from event E5 to event E6 is 0.1, the initial transition probability P(E7|E6) from event E6 to event E7 is 0.1, the initial transition probability P(E7|E5) from event E5 to event E7 is 0.6, the initial transition probability P(E8|E7) from event E7 to event E8 is 0.5, and the initial transition probability P(E8|E7) from event E7 to event E8 is 0.3.
[0073] It should be noted that there is a certain probability for the transfer between events in the event chain diagram. If the probability is 0, the connection between the nodes can actually be ignored, and the transfer probability between events can be adjusted at any time.
[0074] Step S120, according to the event chain diagram, obtaining the initial transition probability of the current event in the event chain diagram to the next event.
[0075] In an embodiment of the present application, after constructing the event chain graph, the transition probability between each event can be determined directly based on the weight of each edge in the event chain graph, and the initial transition probability of the current event in the event chain graph to the next event can be obtained.
[0076] Step S130, obtain a historical event set, and calculate the first occurrence probability of the historical event set under the condition that the current event occurs based on user feedback corresponding to the historical events in the historical event set, the similarity between the historical events and the current event, the time interval between the historical events and the current event, and the time decay coefficient.
[0077] In the embodiment of the present application, it is considered that the event chain in the current game scene is generally generated based on the Markov chain, that is, the prediction and generation of the next event are performed based on the result of the previous event and the current state. It has a certain randomness but no historical memory ability, and it is impossible to link with historical events, thereby causing the generated event chain to be non-targeted and lacking certain rationality. Based on this, the embodiment of the present application takes into account the impact of historical events on the initial transfer probability of the current event transferring to the next event, by obtaining a historical event set, and according to the user feedback corresponding to the historical event in the historical event set, the similarity between the historical event and the current event, the time interval between the historical event and the current event, and the time decay coefficient, the first occurrence probability of the historical event set under the condition that the current event occurs can be calculated, so that the initial transfer probability of the current event transferring to the next event can be adjusted based on the first occurrence probability, and then the event chain diagram after the transfer probability adjustment can be made more targeted and reasonable.
[0078] Reference Figure 3 , Figure 3 It is a flowchart of steps provided by an embodiment of the present application for calculating the first occurrence probability of a historical event set under the condition that the current event occurs based on user feedback corresponding to historical events in the historical event set, the similarity between the historical events and the current event, the time interval between the historical events and the current event, and the time decay coefficient, including but not limited to steps S310 to S340.
[0079] Step S310, obtaining user feedback corresponding to historical events in the historical event set according to the user's historical behavior record, and characterizing the user feedback corresponding to the historical events in the historical event set with importance weights.
[0080] In the embodiment of the present application, user feedback corresponding to historical events in the historical event set can be obtained according to the user's historical behavior record. For example, the historical events that have occurred in the game scene include pushing a treasure map fragment or a cave entrance to the user. If the user picks up the treasure map or enters the cave, it is considered to be a positive feedback. On the contrary, if the user does not pick up the treasure map or does not enter the cave, it is considered to be a negative feedback. In the embodiment of the present application, the user feedback corresponding to the historical events in the historical event set can be characterized by importance weights. If the user gives positive feedback to the historical event, the importance weight increases, and if the user gives negative feedback to the historical event, the importance weight decreases. Exemplarily, when the user responds positively to the historical event, the importance weight corresponding to the historical event can be set to 1.0, and when the user responds negatively to the historical event, the importance weight corresponding to the historical event is 0. Alternatively, when the user responds positively to the historical event, the importance weight corresponding to the historical event can be set to 0.8, and when the user responds negatively to the historical event, the importance weight corresponding to the historical event is 0.2. In this way, the impact of historical events on entering the current event can be adjusted according to the user's wishes to better meet the individual differences of users.
[0081] Step S320, calculating the similarity between the historical event and the current event according to the transition path from the historical event to the current event, the transition path length, and the initial transition probability.
[0082] In the embodiment of the present application, the similarity between the historical event and the current event can be calculated based on the transition path, the length of the transition path, and the initial transition probability from the historical event to the current event, wherein the higher the similarity between the events, the higher the possibility of transition between the events; and the lower the similarity between the events, the lower the possibility of transition between the events. Specifically, based on the transition path, the length of the transition path, and the initial transition probability from the historical event to the current event, the similarity between the historical event and the current event can be calculated by the following formula 1:
[0083]
[0084] In formula 1, E k represents the kth historical event, E i Indicates the current event, sim(E k ,E i ) indicates historical event E k With current events i The similarity between them, n represents the kth historical event E k Transfer to current event E i The number of transfer paths, λ represents the regularization parameter, which is a constant value, L irepresents the length of the i-th transfer path, p i represents the weight of the i-th transfer path, where historical event E k Transfer to current event E i The initial transition probability is used as the weight.
[0085] For example, Figure 2 Taking the event chain diagram shown as an example, the historical event set includes historical events E1, E2, and E3, and the current event is E5. It is necessary to calculate the similarity sim(E1, E5) between historical event E1 and current event E5, the similarity sim(E2, E5) between historical event E2 and current event E5, and the similarity sim(E3, E5) between historical event E3 and current event E5. Among them, the transfer path from historical event E1 to current event E5 includes 4 paths, namely transfer path 1: E1-E2-E3-E5; transfer path 2: E1-E5; transfer path 3: E1-E2-E4-E5; transfer path 4: E1-E2-E4-E3-E5. The regularization parameter λ is defined as 0.5, the length L1 of transfer path 1 is 3, the weight P1 = P(E2|E1)*P(E3|E2)*P(E5|E3) = 0.5*0.7*0.9 = 0.315; the length L2 of transfer path 2 is 1, the weight P2 = P(E5|E1) = 0.01; the length L3 of transfer path 3 is 3, the weight P3 = P(E2|E1)*P(E4|E2)*P(E5|E4) = 0.5*0.3*0.01 = 0.0015; the length L4 of transfer path 4 is 4, the weight P4 = P(E2|E1)*P(E4|E2)*P(E3|E4)*P(E5|E3) = 0.5*0.3*0.01*0.9 = 0.00135; thus, it can be calculated In this way, the similarity sim(E2, E5) between the historical event E2 and the current event E5 and the similarity sim(E3, E5) between the historical event E3 and the current event E5 can be calculated respectively.
[0086] Step S330, obtaining the time interval between the historical event and the current event according to the occurrence time of the historical event and the occurrence time of the current event.
[0087] In the embodiment of the present application, the impact of the time when the historical event occurred on the transfer to the current event is further considered. Therefore, it is necessary to obtain the time interval between the historical event and the current event based on the time when the historical event occurred and the time when the current event occurred, and introduce a time attenuation coefficient to reflect the effect that the impact of the historical event on the transfer to the current event gradually weakens as the time interval increases.
[0088] Step S340, calculating the first occurrence probability of the historical event set under the condition that the current event occurs according to the importance weight, the similarity between the historical event and the current event, the time interval between the historical event and the current event, and the time decay coefficient.
[0089] In the embodiment of the present application, after characterizing the user feedback corresponding to the historical events in the historical event set with importance weights, calculating the similarity between the historical events and the current event, the time interval between the historical events and the current event, and determining the time decay coefficient, the first occurrence probability of the historical event set under the condition that the current event occurs can be calculated based on the importance weights, the similarity between the historical events and the current event, the time interval between the historical events and the current event, and the time decay coefficient, and the influence of the historical events on the transfer to the current event can be calculated. Specifically, the first occurrence probability of the historical event set under the condition that the current event occurs can be calculated by Formula 2, which is as follows:
[0090]
[0091] In formula 2, P(H|Ei) represents the i The first occurrence probability of the historical event set H under the condition of occurrence, ω k Represents the kth historical event E k The corresponding importance weight, sim(E k ,E i ) indicates historical event E k With current events i The similarity between them, N represents the number of historical events in the historical event set H, γ represents the time decay coefficient, t k Represents the kth historical event E k With current events i time interval.
[0092] For example, Figure 2 Taking the event chain diagram shown in the figure as an example, the historical event set includes historical events E1, E2, and E3, and the current event is E5. The similarity sim(E1, E5) between historical event E1 and current event E5, the similarity sim(E2, E5) between historical event E2 and current event E5, and the similarity sim(E3, E5) between historical event E3 and current event E5 can be calculated respectively. Then, a simplified threshold feedback function is used, which is equivalent to the user's feedback on historical event E1. k The corresponding importance weight ω for positive feedback k The value is 1.0, and the user has a k The importance weight ω corresponding to negative feedback kThe value is 0. Assume that the user gives positive feedback to historical events E1 and E2, but gives negative feedback to historical event E3. Then it can be determined that ω1=1, ω2=1; and ω3=0. Then calculate the time interval t1=60 seconds between historical event E1 and current event E5, the time interval t2=50 seconds between historical event E2 and current event E5, and the time interval t3=40 seconds between historical event E3 and current event E5. Define the time decay coefficient γ as 0.01. The time decay coefficient is used to control the influence of historical events to gradually weaken over time. The larger the time decay coefficient, the faster the time decays, and the influence of earlier events on the current event will weaken rapidly; and the smaller the time decay coefficient, the slower the time decay, and the influence of earlier events on the current event will last longer. The embodiment of the present application sets the time decay coefficient to a smaller value, which means that earlier events will still affect the occurrence of the current event. Finally, calculate the current event E i The first occurrence probability of the historical event set H under the condition of occurrence is as follows:
[0093]
[0094] In an embodiment of the present application, based on user feedback corresponding to historical events in the historical event set, the similarity between the historical events and the current event, the time interval between the historical events and the current event, and the time decay coefficient, the influence of each historical event in the historical event set on the transfer to the current event can be calculated, so that the influence of the historical events can be fully considered in the transition probability of the current event to the next event, and the final adjusted transition probability can be more targeted and reasonable.
[0095] Step S140, adjusting the initial transition probability according to the first occurrence probability to obtain an event chain diagram after the transition probability is adjusted.
[0096] In the embodiment of the present application, the current event E is calculated. i After the first occurrence probability of the historical event set H under the condition of occurrence is obtained, the initial transition probability can be adjusted according to the first occurrence probability to obtain an event chain diagram after the transition probability is adjusted. Figure 4 , Figure 4 It is a flowchart of the steps of adjusting the initial transition probability according to the first occurrence probability provided by an embodiment of the present application, including but not limited to steps S410 to S430.
[0097] Step S410, obtaining the initial probability of the current event occurring and the first marginal probability corresponding to the historical event set;
[0098] Step S420, multiplying the first occurrence probability by the initial probability of the current event and then dividing by the first marginal probability to obtain a first adjustment coefficient;
[0099] Step S430: adjusting the initial transition probability according to the first adjustment coefficient.
[0100] In the embodiment of the present application, the marginal probability is the probability of an event occurring, which is not conditional on other events. The impact of the historical event set on the current event is conditionally independent. The initial probability of the current event occurring is an unconditional probability, which is not conditional on other events. The initial probability of the current event occurring and the first marginal probability corresponding to the historical event set can be pre-set, for example, the initial probability of the current event occurring is set to 0.5, and the first marginal probability corresponding to the historical event set is set to 1. By setting the initial probability of the current event occurring in the current event E i The first occurrence probability of the historical event set H under the condition of occurrence is multiplied by the initial probability of the current event and then divided by the first marginal probability to obtain a first adjustment coefficient, so that the initial transition probability of the current event to the next event can be further adjusted based on the first adjustment coefficient. Specifically, the adjustment of the initial transition probability according to the first occurrence probability can be performed by formula 3, which is as follows:
[0101]
[0102] In formula 3, P(E j |E i ,H) represents the initial transition probability adjusted based on the historical event set, P(E j |E i ) indicates that from the current event E i Move to next event E j The initial transition probability, P(H|Ei) represents the initial transition probability of the current event E i The first probability of occurrence of the historical event set H under the condition that i ) indicates the current event E i The initial probability of occurrence, P(H) represents the first marginal probability corresponding to the set of historical events.
[0103] In the embodiment of the present application, the influence of historical events on the initial transition probability of the current event to the next event is taken into consideration, and the initial transition probability is adjusted to make the generated event chain more targeted and reasonable.
[0104] Embodiment 2
[0105] Reference Figure 5 , Figure 5 It is a flowchart of the event chain generation method provided in the second embodiment of the present application, including but not limited to steps S510 to S540.
[0106] Step S510, constructing an event chain diagram, wherein each node in the event chain diagram represents an event, the edges between the nodes represent the transition relationship between the events, and the weight of the edge represents the transition probability;
[0107] Step S520, according to the event chain diagram, obtaining the initial transition probability of the current event in the event chain diagram to the next event;
[0108] Step S530, obtaining a historical event set, and calculating a first occurrence probability of the historical event set under the condition that the current event occurs according to user feedback corresponding to the historical events in the historical event set, the similarity between the historical events and the current event, the time interval between the historical events and the current event, and the time decay coefficient;
[0109] Step S540, adjusting the initial transition probability according to the second occurrence probability and the first occurrence probability of the user's current state under the condition that the current event occurs, to obtain an event chain diagram after the transition probability is adjusted.
[0110] In the embodiment of the present application, the process of calculating the impact of the historical event set on the current event is the same as that of the first embodiment, that is, the calculation of the first occurrence probability of the historical event set under the condition that the current event occurs is the same as that of the first embodiment, and the embodiment of the present application will not be repeated. In the embodiment of the present application, in addition to considering the impact of historical events on the current event, the impact of the user's current state on entering the next event is further considered, that is, the second occurrence probability of the user's current state under the condition that the current event occurs is further considered. Taking the event chain diagram shown in 2 as an example, if the current event is E4 (enemy with the natives), and the user's current state S is located near the cave site, fully equipped, and in good health. It can be determined that the current event E4 is more likely to transfer to the next event E5; and if the user's current state S is located far away from the cave site, the equipment is not complete. It can be determined that the current event E4 is less likely to transfer to the next event E5. By considering the impact of the historical event set on the current event and the impact of the user's current state on entering the next event, the initial transfer probability of the current event transferring to the next event is adjusted. Specifically, the initial transition probability is adjusted according to the second occurrence probability and the first occurrence probability of the user's current state under the condition that the current event occurs, so that the event chain after the transition probability adjustment can be more targeted and reasonable.
[0111] Reference Figure 6 , Figure 6 It is a flowchart of the steps of adjusting the initial transition probability according to the second occurrence probability and the first occurrence probability of the user's current state under the condition that the current event occurs, provided by an embodiment of the present application, including but not limited to steps S610 to S630.
[0112] Step S610, obtaining the initial probability of the current event occurring, the first marginal probability corresponding to the historical event set, and the second marginal probability corresponding to the current state of the user;
[0113] Step S620, multiplying the first occurrence probability, the second occurrence probability and the initial probability of the current event and then dividing by the first marginal probability and the second marginal probability to obtain a second adjustment coefficient;
[0114] Step S630: adjusting the initial transition probability according to the second adjustment coefficient.
[0115] In the embodiment of the present application, the impact of the historical event set on the current event is conditionally independent. The initial probability of the current event is an unconditional probability, which is not conditional on other events. The impact of the user's current state on entering the next event is conditionally independent. The initial probability of the current event, the first marginal probability corresponding to the historical event set, and the second marginal probability corresponding to the user's current state can all be pre-set. For example, the initial probability of the current event is set to 0.5, the first marginal probability corresponding to the historical event set is set to 1, and the second marginal probability corresponding to the user's current state is set to 1. By setting the initial probability of the current event to 0.5, the first marginal probability corresponding to the historical event set is set to 1, and the second marginal probability corresponding to the user's current state is set to 1. i The first occurrence probability of the historical event set H under the condition that the current event occurs, the second occurrence probability of the user's current state under the condition that the current event occurs, and the initial probability of the current event occurring are multiplied and then divided by the first marginal probability and the second marginal probability to obtain a second adjustment coefficient, so that the initial transition probability of the current event to the next event can be further adjusted based on the second adjustment coefficient. Specifically, the initial transition probability can be adjusted according to the first occurrence probability and the second occurrence probability through Formula 4, which is as follows:
[0116]
[0117] In formula 4, P(E j |E i ,H,S) represents the initial transition probability adjusted based on the historical event set and the user's current state, P(E j |E i ) indicates that from the current event E i Move to next event E j The initial transition probability, P(H|Ei) represents the initial transition probability of the current event E i The first probability of occurrence of the historical event set H under the condition that the current event E i The second probability of the user's current state S under the condition that the user's current state S occurs, P(E i ) indicates the current event E iThe initial probability of occurrence, P(H) represents the first marginal probability corresponding to the set of historical events, and P(S) represents the second marginal probability corresponding to the user's current state.
[0118] In the embodiment of the present application, the influence of historical events and the user's current state on the initial transition probability of the current event to the next event is taken into consideration, and the initial transition probability is adjusted to make the generated event chain more targeted and reasonable.
[0119] Embodiment 3
[0120] Reference Figure 7 , Figure 7 It is a flowchart of the event chain generation method provided in Example 3 of the present application, including but not limited to steps S710 to S740.
[0121] Step S710, constructing an event chain diagram, wherein each node in the event chain diagram represents an event, the edges between the nodes represent the transition relationship between the events, and the weight of the edge represents the transition probability;
[0122] Step S720, according to the event chain diagram, obtaining the initial transition probability of the current event in the event chain diagram to the next event;
[0123] Step S730, obtaining a historical event set, and calculating a first occurrence probability of the historical event set under the condition that the current event occurs according to user feedback corresponding to the historical events in the historical event set, the similarity between the historical events and the current event, the time interval between the historical events and the current event, and the time decay coefficient;
[0124] Step S740, adjusting the initial transition probability according to the third occurrence probability and the first occurrence probability of the current environmental condition under the condition that the current event occurs, to obtain an event chain diagram after the transition probability is adjusted.
[0125] In the embodiment of the present application, the process of calculating the impact of the historical event set on the current event is the same as that of the first embodiment, that is, the calculation of the first probability of occurrence of the historical event set under the condition of the current event is the same as that of the first embodiment, and the embodiment of the present application will not be repeated. In the embodiment of the present application, in addition to considering the impact of historical events on the current event, the impact of the current environmental conditions on entering the next event is further considered, such as the triggering of certain events needs to meet specific conditions, that is, the third probability of occurrence of the current environmental conditions under the condition of the current event. Taking the event chain diagram shown in 2 as an example, if the current event is E4 (enemy with the natives), and the current environmental condition C is sunny and accompanied by the native guide. It can be determined that the current event E4 is more likely to transfer to the next event E5; and if the current environmental condition C is bad weather, there is no information provided by the natives. It can be determined that the current event E4 is less likely to transfer to the next event E5. By considering the impact of the historical event set on the current event and the impact of the current environmental conditions on entering the next event, the initial transfer probability of the current event transferring to the next event is adjusted. Specifically, the initial transfer probability is adjusted according to the third occurrence probability and the first occurrence probability of the current environmental condition under the condition that the current event occurs, so that the event chain after the transfer probability adjustment can be more targeted and reasonable.
[0126] Reference Figure 8 , Figure 8 It is a flowchart of steps for adjusting the initial transition probability according to the third occurrence probability and the first occurrence probability of the current environmental condition under the condition of the current event, provided by an embodiment of the present application, including but not limited to steps S810 to S830.
[0127] Step S810, obtaining the initial probability of the current event occurring, the first marginal probability corresponding to the historical event set, and the third marginal probability corresponding to the current environmental condition;
[0128] Step S820, multiplying the first occurrence probability, the third occurrence probability and the initial probability of the current event, and then dividing by the first marginal probability and the third marginal probability to obtain a third adjustment coefficient;
[0129] Step S830: adjusting the initial transition probability according to the third adjustment coefficient.
[0130] In the embodiment of the present application, the impact of the historical event set on the current event is conditionally independent. The initial probability of the current event is an unconditional probability, which is not conditional on other events. The impact of the current environmental conditions on entering the next event is conditionally independent. The initial probability of the current event, the first marginal probability corresponding to the historical event set, and the third marginal probability corresponding to the current environmental conditions can all be pre-set. For example, the initial probability of the current event is set to 0.5, the first marginal probability corresponding to the historical event set is set to 1, and the third marginal probability corresponding to the current environmental conditions is set to 1. By setting the initial probability of the current event to 0.5, the first marginal probability corresponding to the historical event set is set to 1, and the third marginal probability corresponding to the current environmental conditions is set to 1. i The first occurrence probability of the historical event set H under the condition of the occurrence of the current event, the third occurrence probability of the current environmental condition under the condition of the current event, and the initial probability of the current event are multiplied and then divided by the first marginal probability and the third marginal probability to obtain a third adjustment coefficient, so that the initial transition probability of the current event to the next event can be further adjusted based on the third adjustment coefficient. Specifically, the initial transition probability can be adjusted according to the first occurrence probability and the third occurrence probability through Formula 5, which is as follows:
[0131]
[0132] In formula 5, P(E j |E i ,H,C) represents the initial transition probability adjusted based on the historical event set and the current environmental conditions, P(E j |E i ) indicates that from the current event E i Move to next event E j The initial transition probability, P(H|Ei) represents the initial transition probability of the current event E i The first probability of occurrence of the historical event set H under the condition that the current event E i The third probability of occurrence of the current environmental condition C under the condition of occurrence, P(E i ) indicates the current event E i The initial probability of occurrence, P(H) represents the first marginal probability corresponding to the set of historical events, and P(C) represents the third marginal probability corresponding to the current environmental conditions.
[0133] In the embodiment of the present application, the influence of historical events and current environmental conditions on the initial transition probability of the current event to the next event is taken into consideration, and the initial transition probability is adjusted to make the generated event chain more targeted and reasonable.
[0134] Embodiment 4
[0135] Reference Fig. 9 , Fig. 9It is a flowchart of the event chain generation method provided in Example 4 of the present application, including but not limited to steps S910 to S940.
[0136] Step S910, constructing an event chain diagram, wherein each node in the event chain diagram represents an event, the edges between the nodes represent the transition relationship between the events, and the weight of the edge represents the transition probability;
[0137] Step S920, according to the event chain diagram, obtaining the initial transition probability of the current event in the event chain diagram to the next event;
[0138] Step S930, obtaining a historical event set, and calculating a first occurrence probability of the historical event set under the condition that the current event occurs according to user feedback corresponding to the historical events in the historical event set, the similarity between the historical events and the current event, the time interval between the historical events and the current event, and the time decay coefficient;
[0139] Step S940, adjusting the initial transition probability according to the second occurrence probability of the user's current state under the condition that the current event occurs, the third occurrence probability of the current environmental condition under the condition that the current event occurs, and the first occurrence probability.
[0140] In the embodiment of the present application, the process of calculating the impact of the historical event set on the current event is the same as that of the first embodiment, that is, the calculation of the first probability of occurrence of the historical event set under the condition of the current event is the same as that of the first embodiment, and the embodiment of the present application is not repeated. In the embodiment of the present application, in addition to considering the impact of historical events on the current event, the impact of the user's current state and the current environmental conditions on entering the next event is further considered, that is, the second probability of occurrence of the user's current state under the condition of the current event and the third probability of occurrence of the current environmental conditions under the condition of the current event are further considered. Taking the event chain diagram shown in 2 as an example, if the current event is E4 (enemy with the natives), and the user's current state S is located near the cave site, fully equipped, in good health, and the current environmental condition C is sunny and accompanied by an indigenous guide. It can be determined that the current event E4 is more likely to transfer to the next event E5; and if the user's current state S is located far away from the cave site, the equipment is not complete, and the current environmental condition C is bad weather, and there is no information provided by the natives. It can be determined that the current event E4 is less likely to transfer to the next event E5. By considering the impact of the historical event set on the current event and the impact of the user's current state and current environmental conditions on entering the next event, the initial transition probability of the current event to the next event is adjusted. Specifically, the initial transition probability is adjusted according to the second occurrence probability of the user's current state under the condition of the current event, the third occurrence probability of the current environmental conditions under the condition of the current event, and the first occurrence probability, so that the event chain after the transition probability adjustment can be more targeted and reasonable.
[0141] Reference Fig.10 , Fig.10 It is a flowchart of steps for adjusting the initial transition probability according to the second occurrence probability of the user's current state under the condition that the current event occurs, the third occurrence probability of the current environmental conditions under the condition that the current event occurs, and the first occurrence probability, provided by an embodiment of the present application, including but not limited to steps S1010 to S1030.
[0142] Step S1010, obtaining the initial probability of the current event occurring, the first marginal probability corresponding to the historical event set, the second marginal probability corresponding to the user's current state, and the third marginal probability corresponding to the current environmental condition;
[0143] Step S1020, multiplying the first occurrence probability, the second occurrence probability, the third occurrence probability and the initial probability of the current event, and then dividing by the first marginal probability, the second marginal probability and the third marginal probability to obtain a fourth adjustment coefficient;
[0144] Step S1030: adjusting the initial transition probability according to the fourth adjustment coefficient.
[0145] In the embodiment of the present application, the impact of the historical event set on the current event is conditionally independent. The initial probability of the current event occurring is an unconditional probability, which is not conditional on other events. The impact of the user's current state on entering the next event is conditionally independent, and the impact of the current environmental conditions on entering the next event is conditionally independent. The initial probability of the current event occurring, the first marginal probability corresponding to the historical event set, the second marginal probability corresponding to the user's current state, and the third marginal probability corresponding to the current environmental conditions can all be pre-set. For example, the initial probability of the current event occurring is set to 0.5, the first marginal probability corresponding to the historical event set is set to 1, the second marginal probability corresponding to the user's current state is set to 1, and the third marginal probability corresponding to the current environmental conditions is set to 1. By setting the initial probability of the current event occurring at the current event E i The first occurrence probability of the historical event set H under the condition that the current event occurs, the second occurrence probability of the user's current state under the condition that the current event occurs, and the third occurrence probability of the current environmental conditions under the condition that the current event occurs are multiplied by the initial probability of the current event and then divided by the first marginal probability, the second marginal probability, and the third marginal probability to obtain a fourth adjustment coefficient, so that the initial transition probability of the current event to the next event can be further adjusted based on the fourth adjustment coefficient. Specifically, the adjustment of the initial transition probability according to the first occurrence probability, the second occurrence probability, and the third occurrence probability can be performed by Formula 6, which is as follows:
[0146]
[0147] In formula 6, P(Ej |E i ,H,C) represents the initial transition probability adjusted based on the historical event set, the user's current state and the current environmental conditions, P(E j |E i ) indicates that from the current event E i Move to next event E j The initial transition probability, P(H|Ei) represents the initial transition probability of the current event E i The first probability of occurrence of the historical event set H under the condition that the current event E i The second probability of the user's current state S under the condition that the current event E occurs, P(C|Ei) represents the probability of the user's current state S under the condition that the current event E occurs. i The third probability of occurrence of the current environmental condition C under the condition of occurrence, P(E i ) indicates the current event E i The initial probability of occurrence, P(H) represents the first marginal probability corresponding to the historical event set, P(S) represents the second marginal probability corresponding to the user's current state, and P(C) represents the third marginal probability corresponding to the current environmental conditions.
[0148] In the embodiment of the present application, the influence of historical events, the user's current state and current environmental conditions on the initial transition probability of the current event to the next event is taken into consideration, and the initial transition probability is adjusted to make the generated event chain more targeted and reasonable.
[0149] The embodiment of the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the above event chain generation method when executing the computer program. The electronic device can be any intelligent terminal including a tablet computer, a car computer, etc.
[0150] See also Fig.11 , Fig.11 : is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application, the electronic device includes:
[0151] The processor 1101 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;
[0152] The memory 1102 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1102 can store an operating system and other applications. When the technical solution provided in the embodiments of this specification is implemented by software or firmware, the relevant program code is stored in the memory 1102, and the processor 1101 calls and executes the event chain generation method of the embodiment of the present application;
[0153] Input / output interface 1103, used to implement information input and output;
[0154] The communication interface 1104 is used to realize the communication interaction between the device and other devices. The communication can be realized through a wired manner (such as USB, network cable, etc.) or a wireless manner (such as mobile network, WIFI, Bluetooth, etc.);
[0155] A bus 1105 that transmits information between various components of the device (e.g., the processor 1101, the memory 1102, the input / output interface 1103, and the communication interface 1104);
[0156] The processor 1101 , the memory 1102 , the input / output interface 1103 and the communication interface 1104 are connected to each other in communication within the device via the bus 1105 .
[0157] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0158] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0159] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0160] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0161] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0162] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0163] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, 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 through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0164] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0165] In addition, each functional unit in each embodiment of the present application 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. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0166] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.
[0167] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and substance of the present invention should be within the scope of the rights of the present invention.
Claims
1. A method for generating an event chain, characterized in that: The method comprises: Constructing an event chain graph, wherein each node in the event chain graph represents an event, the edges between the nodes represent the transition relationship between the events, and the weight of the edge represents the transition probability; According to the event chain diagram, obtaining an initial transition probability from a current event to a next event in the event chain diagram; Acquire a historical event set, and calculate a first occurrence probability of the historical event set under the condition that the current event occurs according to user feedback corresponding to the historical events in the historical event set, the similarity between the historical events and the current event, the time interval between the historical events and the current event, and the time decay coefficient; The initial transfer probability is adjusted according to the first occurrence probability, or according to at least one of the second occurrence probability of the user's current state under the condition that the current event occurs and the third occurrence probability of the current environmental conditions under the condition that the current event occurs, and the first occurrence probability, to obtain an event chain diagram after the transfer probability is adjusted.
2. The method according to claim 1, characterized in that Calculating, based on user feedback corresponding to historical events in the historical event set, the similarity between the historical events and the current event, the time interval between the historical events and the current event, and the time decay coefficient, a first occurrence probability of the historical event set under the condition that the current event occurs includes: Obtaining user feedback corresponding to historical events in the historical event set according to the user's historical behavior records, and characterizing the user feedback corresponding to historical events in the historical event set with importance weights; Calculate the similarity between the historical event and the current event according to the transition path from the historical event to the current event, the transition path length, and the initial transition probability; According to the occurrence time of the historical event and the occurrence time of the current event, obtaining the time interval between the historical event and the current event; The first occurrence probability of the historical event set under the condition that the current event occurs is calculated based on the importance weight, the similarity between the historical event and the current event, the time interval between the historical event and the current event, and the time decay coefficient.
3. The method according to claim 2, characterized in that The similarity between the historical event and the current event is calculated based on the transition path from the historical event to the current event, the transition path length, and the initial transition probability by the following formula: In the formula, E k represents the kth historical event, E i Indicates the current event, sim(E k ,E i ) indicates historical event E k With current events i The similarity between them, n represents the kth historical event E k Transfer to current event E i The number of transfer paths, λ represents the regularization parameter, which is a constant value, L i represents the length of the i-th transfer path, p i represents the weight of the i-th transfer path, where historical event E k Transfer to current event E i The initial transition probability is used as the weight.
4. The method according to claim 2 or 3, characterized in that: The calculation of the first occurrence probability of the historical event set under the condition that the current event occurs is performed by the following formula based on the importance weight, the similarity between the historical event and the current event, the time interval between the historical event and the current event, and the time decay coefficient: In the formula, P(HEi) represents the i The first occurrence probability of the historical event set H under the condition of occurrence, ω k Represents the kth historical event E k The corresponding importance weight, sim(E k ,E i ) indicates historical event E k With current events i The similarity between them, N represents the number of historical events in the historical event set H, γ represents the time decay coefficient, t k Represents the kth historical event E k With current events i time interval.
5. The method according to claim 1 or 4, characterized in that: Adjusting the initial transition probability according to the first occurrence probability includes: Obtaining an initial probability of occurrence of the current event and a first marginal probability corresponding to the set of historical events; Multiplying the first occurrence probability by the initial probability of the current event and then dividing the result by the first marginal probability to obtain a first adjustment coefficient; The initial transfer probability is adjusted according to the first adjustment coefficient.
6. The method according to claim 1 or 4, characterized in that: Adjusting the initial transition probability according to the second occurrence probability of the user's current state under the condition that the current event occurs and the first occurrence probability includes: Obtaining an initial probability of the current event occurring, a first marginal probability corresponding to the historical event set, and a second marginal probability corresponding to the current state of the user; Multiplying the first occurrence probability, the second occurrence probability and the initial probability of the current event and then dividing by the first marginal probability and the second marginal probability to obtain a second adjustment coefficient; The initial transition probability is adjusted according to the second adjustment coefficient.
7. The method according to claim 1 or 4, characterized in that: The initial transition probability is adjusted according to the third occurrence probability of the current environmental condition under the condition that the current event occurs and the first occurrence probability, including: Obtaining an initial probability of occurrence of the current event, a first marginal probability corresponding to the historical event set, and a third marginal probability corresponding to the current environmental condition; The first occurrence probability, the third occurrence probability and the initial probability of the current event occurring are multiplied, and then divided by the first marginal probability and the third marginal probability to obtain a third adjustment coefficient; The initial transfer probability is adjusted according to the third adjustment coefficient.
8. The method according to claim 1 or 4, characterized in that: The initial transition probability is adjusted according to a second occurrence probability of the user's current state under the condition that the current event occurs, a third occurrence probability of the current environmental condition under the condition that the current event occurs, and the first occurrence probability, including: Obtaining an initial probability of the current event occurring, a first marginal probability corresponding to the historical event set, a second marginal probability corresponding to the user's current state, and a third marginal probability corresponding to the current environmental condition; The first occurrence probability, the second occurrence probability, the third occurrence probability and the initial probability of the current event are multiplied and then divided by the first marginal probability, the second marginal probability and the third marginal probability to obtain a fourth adjustment coefficient; The initial transfer probability is adjusted according to the fourth adjustment coefficient.
9. The method according to claim 8, characterized in that The initial transition probability is adjusted according to the second occurrence probability of the user's current state under the condition that the current event occurs, the third occurrence probability of the current environmental condition under the condition that the current event occurs, and the first occurrence probability by the following formula: In the formula, P(E j E i ,H,S,C) represents the initial transition probability adjusted based on the historical event set, the user's current state and the current environmental conditions, P(E j E i ) indicates that from the current event E i Move to next event E j The initial transition probability, P(HEi) represents the probability of the current event E i The first probability of occurrence of the historical event set H under the condition that the current event E i The second probability of the user's current state S under the condition that the current event E i The third probability of occurrence of the current environmental condition C under the condition of occurrence, P(E i ) indicates the current event E i The initial probability of occurrence, P(H) represents the first marginal probability corresponding to the historical event set H, P(S) represents the second marginal probability corresponding to the user's current state S, and P(C) represents the third marginal probability corresponding to the current environmental condition C.
10. An electronic device, characterized in that: The electronic device comprises a memory and a processor, the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 9 when executing the computer program.